erdemolkun / plist

Automatically exported from code.google.com/p/plist
0 stars 0 forks source link

OutOfMemoryError when parsing a binary plist file on Android #46

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Open binary file home-buttons.plist
2. Application crashes

What is the expected output? What do you see instead?
Expected : NSDictionary object
Instead : 
03-27 09:57:36.081: E/AndroidRuntime(8726): FATAL EXCEPTION: main
03-27 09:57:36.081: E/AndroidRuntime(8726): java.lang.OutOfMemoryError: int[] 
of length 1795162112 exceeds the VM limit
03-27 09:57:36.081: E/AndroidRuntime(8726):     at 
com.dd.plist.BinaryPropertyListParser.doParse(BinaryPropertyListParser.java:95)
03-27 09:57:36.081: E/AndroidRuntime(8726):     at 
com.dd.plist.BinaryPropertyListParser.parse(BinaryPropertyListParser.java:60)
03-27 09:57:36.081: E/AndroidRuntime(8726):     at 
com.dd.plist.BinaryPropertyListParser.parse(BinaryPropertyListParser.java:118)
03-27 09:57:36.081: E/AndroidRuntime(8726):     at 
com.dd.plist.BinaryPropertyListParser.parse(BinaryPropertyListParser.java:131)
03-27 09:57:36.081: E/AndroidRuntime(8726):     at 
com.dd.plist.PropertyListParser.parse(PropertyListParser.java:67)
03-27 09:57:36.081: E/AndroidRuntime(8726):     at 
------------------------------------
03-27 09:57:36.081: E/AndroidRuntime(8726):     at 
------------------------------------
03-27 09:57:36.081: E/AndroidRuntime(8726):     at 
android.app.Activity.performCreate(Activity.java:5104)
03-27 09:57:36.081: E/AndroidRuntime(8726):     at 
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
03-27 09:57:36.081: E/AndroidRuntime(8726):     at 
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
03-27 09:57:36.081: E/AndroidRuntime(8726):     at 
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
03-27 09:57:36.081: E/AndroidRuntime(8726):     at 
android.app.ActivityThread.access$600(ActivityThread.java:141)
03-27 09:57:36.081: E/AndroidRuntime(8726):     at 
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
03-27 09:57:36.081: E/AndroidRuntime(8726):     at 
android.os.Handler.dispatchMessage(Handler.java:99)
03-27 09:57:36.081: E/AndroidRuntime(8726):     at 
android.os.Looper.loop(Looper.java:137)
03-27 09:57:36.081: E/AndroidRuntime(8726):     at 
android.app.ActivityThread.main(ActivityThread.java:5039)
03-27 09:57:36.081: E/AndroidRuntime(8726):     at 
java.lang.reflect.Method.invokeNative(Native Method)
03-27 09:57:36.081: E/AndroidRuntime(8726):     at 
java.lang.reflect.Method.invoke(Method.java:511)
03-27 09:57:36.081: E/AndroidRuntime(8726):     at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
03-27 09:57:36.081: E/AndroidRuntime(8726):     at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
03-27 09:57:36.081: E/AndroidRuntime(8726):     at 
dalvik.system.NativeStart.main(Native Method)

What version of the product are you using? On what operating system?

r108 on Galaxy Nexus Android 4.2.1

Please provide any additional information below.

See attached file to reproduce problem.

Original issue reported on code.google.com by djl...@gmail.com on 27 Mar 2014 at 9:23

Attachments:

GoogleCodeExporter commented 9 years ago
Additional information : when converted to XML, the file is correctly parsed.

Original comment by djl...@gmail.com on 27 Mar 2014 at 9:24

GoogleCodeExporter commented 9 years ago
I could not reproduce that error using r108 your property list file and a 
sample application running on my Nexus 5 with Android 4.4.2.

Also the line numbers given in the stack trace do not seem to match r108, are 
you sure you are using the latest version?

Also what code are you using to parse the property list?

From the errors given it looks like the parser wants to allocate 7 GB of RAM 
for a huge int array. This could only have resulted by wrongly interpreting 
some length information in the property list file. However I do not see this 
error occuring on either my PC or my Android phone with the property list you 
just provided.

I can only assume tjhat you either use some old version that had a bug or you 
are not passing the property list InputStream correctly to the parser.

Original comment by daniel.dreibrodt on 27 Mar 2014 at 11:03

GoogleCodeExporter commented 9 years ago
No further information received. Issue closed.

Original comment by daniel.dreibrodt on 13 Aug 2014 at 4:56