[Soot-list] I got a heap memory error

Eric Bodden eric.bodden at ec-spride.de
Fri Dec 30 05:36:38 EST 2011


Hi Shim.

Ben Bellamy was so nice to look into this issue. The problem
originates from the lack of a complete type hierarchy when there is no
JDK on Soot's classpath. We are still looking into how to best fix
this issue. Having said this, a simple workaround for you may be to
just include "rt.jar" from the JDK on Soot's classpath. Can you try
this?

Eric

On 22 December 2011 09:26, Eric Bodden <eric.bodden at ec-spride.de> wrote:
> I have emailed Ben Bellamy who contributed that code. Hopefully he
> will find some time to give us some advice. May not happen over the
> holidays, though...
>
> Cheers,
> Eric
>
> On 22 December 2011 07:03, Heejong Lee <heejong at gmail.com> wrote:
>> HI, Eric.
>>
>> Unfortunately, we cannot remove -allow-phantom-refs option for now since
>> we do not have a complete list of dependencies.
>>
>> After a brief investigation, I can confirm that there is an infinite
>> loop problem
>> in applyAssignmentConstraints(Typing, IEvalFunction, IHierarchy) method.
>> The variable LinkedList<Typing> sigma monotonically increases until the heap
>> memory overflow occurs. I diagramed the size fluctuation of sigma and figured
>> out that it looks virtually linear.
>>
>> How do we guarantee that the sigma will be eventually empty? Is there any
>> bound condition for guaranteeing it?
>>
>> Regards,
>>
>> - Heejong Lee
>>
>> On Wed, Dec 21, 2011 at 9:41 PM, Eric Bodden <eric.bodden at ec-spride.de> wrote:
>>> Hmm, indeed there appears to be an infinite loop in the worklist
>>> algorithm of the type assigner.
>>>
>>> Does this also happen when you do not use the phantom-refs option? The
>>> use of phantom refs applies some tweaks to the type assigner, not all
>>> of which may be correct.
>>>
>>> Eric
>>>
>>> 2011/12/21 Shim Gyuhang <plto001 at gmail.com>:
>>>> I've tried the command from email you sent. But we still had the same error
>>>> message from Soot framework.
>>>>
>>>> For your reference, I ran the Visual VM to check what type of data is most
>>>> used during execution.
>>>> As a result, about 1.5 GB of memory was assigned for HashMap. I assumed
>>>> there is an infinite loop maybe...
>>>>
>>>> Is there any solution?
>>>>
>>>> --------------------------------------
>>>> Thanks.
>>>> Life is good. All the time. :)
>>>>
>>>> Fasoo.com Inc, PA dev team
>>>> Gyuhang Shim starblood at fasoo.com
>>>>
>>>> Dec 21, 2011, 1:50 AM, Rule One 작성:
>>>>
>>>> Try,
>>>>
>>>> java -Xms2048m -Xmx2048m -jar sootclasses.jar -cp /tmp
>>>> org.apache.harmony.luni.tests.java.util.Arrays2Test -allow-phantom-refs
>>>>
>>>>
>>>> From: plto001 at gmail.com
>>>> Date: Tue, 20 Dec 2011 18:21:35 +0900
>>>> To: soot-list at sable.mcgill.ca
>>>> CC: pa_dev at fasoo.com
>>>> Subject: [Soot-list] I got a heap memory error
>>>>
>>>>
>>>> Hello.
>>>> My name is Gyuhang from Fasoo.com Inc.
>>>>
>>>> We have been used soot framework for analyzing Java codes.
>>>> Yesterday, we have a Heap Memory Error from soot framework while analyzing
>>>> Android source codes.
>>>>
>>>> The stack trace is like below.
>>>>
>>>> Soot has run out of the memory allocated to it by the Java VM.
>>>> To allocate more memory to Soot, use the -Xmx switch to Java.
>>>> For example (for 400MB): java -Xmx400m soot.Main ...
>>>> Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
>>>>       at java.util.LinkedList.addBefore(LinkedList.java:778)
>>>>       at java.util.LinkedList.addLast(LinkedList.java:164)
>>>>       at soot.jimple.toolkits.typing.fast.QueuedSet.addLast(QueuedSet.java:64)
>>>>       at soot.jimple.toolkits.typing.fast.QueuedSet.addLast(QueuedSet.java:74)
>>>>       at
>>>> soot.jimple.toolkits.typing.fast.TypeResolver.applyAssignmentConstraints(TypeResolver.java:450)
>>>>       at
>>>> soot.jimple.toolkits.typing.fast.TypeResolver.inferTypes(TypeResolver.java:113)
>>>>       at
>>>> soot.jimple.toolkits.typing.TypeAssigner.internalTransform(TypeAssigner.java:101)
>>>>       at soot.BodyTransformer.transform(BodyTransformer.java:51)
>>>>       at soot.Transform.apply(Transform.java:104)
>>>>       at soot.JimpleBodyPack.applyPhaseOptions(JimpleBodyPack.java:66)
>>>>       at soot.JimpleBodyPack.internalApply(JimpleBodyPack.java:89)
>>>>       at soot.Pack.apply(Pack.java:124)
>>>>       at soot.coffi.CoffiMethodSource.getBody(CoffiMethodSource.java:117)
>>>>       at soot.SootMethod.getBodyFromMethodSource(SootMethod.java:82)
>>>>       at soot.SootMethod.retrieveActiveBody(SootMethod.java:315)
>>>>       at soot.PackManager.retrieveAllBodies(PackManager.java:989)
>>>>       at soot.PackManager.runPacks(PackManager.java:338)
>>>>       at soot.Main.run(Main.java:198)
>>>>       at soot.Main.main(Main.java:141)
>>>>
>>>>
>>>> The command line input for soot framework is like below. (I located the
>>>> package to /tmp directory.)
>>>> java -Xmx2048m -jar sootclasses.jar -cp /tmp
>>>> org.apache.harmony.luni.tests.java.util.Arrays2Test -allow-phantom-refs
>>>>
>>>> It will be very thankful, if you have me some advices.
>>>>
>>>> The attached file below contains whole directory structure contains class
>>>> file that causes Heap Memory Error.
>>>>
>>>>
>>>>
>>>> -------------------------------------- Thanks. Life is good. All the time.
>>>> :) Fasoo.com Inc, PA dev team Gyuhang Shim starblood at fasoo.com
>>>> _______________________________________________ Soot-list mailing
>>>> list Soot-list at sable.mcgill.ca http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> Soot-list mailing list
>>>> Soot-list at sable.mcgill.ca
>>>> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>>>>
>>>
>>>
>>>
>>> --
>>> Eric Bodden, Ph.D., http://bodden.de/
>>> Head of Secure Software Engineering Group at EC SPRIDE
>>> Principal Investigator in Secure Services at CASED
>>> Tel: +49 6151 16-75422    Fax: +49 6151 16-72051
>>> Room 3.2.14, Mornewegstr. 30, 64293 Darmstadt
>>> _______________________________________________
>>> Soot-list mailing list
>>> Soot-list at sable.mcgill.ca
>>> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>>
>>
>>
>> --
>> Heejong Lee
>>
>> Associate Research Engineer
>> Program Analysis Division
>> Fasoo.com, Inc. (www.spa-arrow.com)
>
>
>
> --
> Eric Bodden, Ph.D., http://bodden.de/
> Head of Secure Software Engineering Group at EC SPRIDE
> Principal Investigator in Secure Services at CASED
> Tel: +49 6151 16-75422    Fax: +49 6151 16-72051
> Room 3.2.14, Mornewegstr. 30, 64293 Darmstadt



-- 
Eric Bodden, Ph.D., http://bodden.de/
Head of Secure Software Engineering Group at EC SPRIDE
Principal Investigator in Secure Services at CASED
Tel: +49 6151 16-75422    Fax: +49 6151 16-72051
Room 3.2.14, Mornewegstr. 30, 64293 Darmstadt


More information about the Soot-list mailing list