[TIMOB-27300] Android: AssetCryptImpl buffer overflow for large JS assets
GitHub Issue | n/a |
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2019-08-07T00:29:57.000+0000 |
Affected Version/s | Release 8.1.0 |
Fix Version/s | Release 8.1.0 |
Components | Android |
Labels | android, engSchedule |
Reporter | Gary Mathews |
Assignee | Gary Mathews |
Created | 2019-07-30T22:28:47.000+0000 |
Updated | 2019-12-05T03:48:44.000+0000 |
Description
*Summary:*
A buffer overflow or out-of-memory exception can occur for device builds (ie: encrypted assets) if the total byte size of all JavaScript source code exceeds the max heap size. This is more likely to happen when transpiled and source-maps are enabled.
*Steps to reproduce:*
Create a Classic Titanium app project using current *8_1_X*
Unzip the attached [^TIMOB-27300.zip] to the project's "Resources" directory.
Build and run on a physical Android device. (Alternatively, build with deployment type -D test
.)
When the app launches, note that an exception occurs in the log.
*Result:*
- An "BufferOverflowException" gets logged.
*Expected Result:*
- App should have successfully started and display a green window.
*Notes*
- If you receive an "OutOfMemory" exception, test on a different device that has enough RAM to load the test case.
*Recommended Solution:*
Refactor titanium_prep
to prevent BufferOverflowException
for large Javascript files.
Attachments
titanium_prep: https://github.com/appcelerator/titanium_prep/pull/33 8_1_X: https://github.com/appcelerator/titanium_mobile/pull/11100 master: https://github.com/appcelerator/titanium_mobile/pull/11103
FR's Passed. PR's Merged.
Verified the fix in SDK 8.1.0.v20190806151528 & 8.2.0.v20190806115125. Closing.