Closed
Bug 934359
Opened 11 years ago
Closed 11 years ago
Encounter 'java.lang.OutOfMemoryError' error when compiling with command 'make -f client.mk'
Categories
(Firefox Build System :: General, defect)
Firefox Build System
General
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla28
People
(Reporter: cewang, Assigned: ckitching)
Details
Attachments
(1 file, 3 obsolete files)
1.15 KB,
patch
|
kats
:
review+
ckitching
:
feedback+
|
Details | Diff | Splinter Review |
I encountered the following error when compiling gecko with command 'make -f client.mk' Exception in thread "main" java.lang.OutOfMemoryError: Java heap space at java.util.Arrays.copyOf(Arrays.java:2882) at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:100) at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:572) at java.lang.StringBuilder.append(StringBuilder.java:203) at org.mozilla.gecko.annotationProcessors.utils.Utils.writeTypeSignature(Utils.java:248) at org.mozilla.gecko.annotationProcessors.utils.Utils.getTypeSignatureString(Utils.java:228) at org.mozilla.gecko.annotationProcessors.utils.AlphabeticMethodComparator.compare(AlphabeticMethodComparator.java:23) at org.mozilla.gecko.annotationProcessors.utils.AlphabeticMethodComparator.compare(AlphabeticMethodComparator.java:10) at java.util.Arrays.mergeSort(Arrays.java:1270) at java.util.Arrays.sort(Arrays.java:1210) at org.mozilla.gecko.annotationProcessors.utils.GeneratableEntryPointIterator.<init>(GeneratableEntryPointIterator.java:30) at org.mozilla.gecko.annotationProcessors.AnnotationProcessor.main(AnnotationProcessor.java:44) This compile error is caused by the following code segment in 'gecko/build/annotationProcessors/utils/Utils.java' int len = name.length(); while (name.endsWith("[]")) { sb.append('['); name = name.substring(0, len - 2); } The variable 'len' is not assigned the new length(len -2) at the end of the 'while', so when the variable 'name' is a string likes 'boolean[][]',there will be a endless loop.
Assignee | ||
Comment 1•11 years ago
|
||
Whoops! You appear to be exactly right. He's an patch doing exactly what you said. Flagging the original reviewer of this code for a rubber-stamp.
Assignee: cewang → chriskitching
Status: NEW → ASSIGNED
Attachment #826645 -
Flags: review?(bugmail.mozilla)
Reporter | ||
Comment 2•11 years ago
|
||
Hi, Chris Kitching,could you help me review this patch?
Attachment #826646 -
Flags: review?(chriskitching)
Reporter | ||
Updated•11 years ago
|
Attachment #826646 -
Attachment is obsolete: true
Attachment #826646 -
Flags: review?(chriskitching)
Assignee | ||
Updated•11 years ago
|
Attachment #826645 -
Attachment is obsolete: true
Attachment #826645 -
Flags: review?(bugmail.mozilla)
Assignee | ||
Comment 3•11 years ago
|
||
Comment on attachment 826646 [details] [diff] [review] Solve endless loop problem in gecko/build/annotationProcessors/utils/Utils.java Sorry. Beat you to it by a tiny bit there! Still, your patch looks fine - probably not necessary to include "[PATCH]" at the beginning of the commit message. It also occurs to me that my patch is actually sort of dumb - an extra function call? that's not sensible. Your approach will perform a little better, as well as being shorter. Let's do it your way. Just tweak that commit message thing (I think there's sort of strict rules about everything starting with just "Bug XXXXX") and it looks fine to me!
Attachment #826646 -
Flags: feedback+
Assignee | ||
Updated•11 years ago
|
Attachment #826646 -
Attachment is obsolete: false
Assignee | ||
Comment 4•11 years ago
|
||
You could also perhaps formulate it as len -= 2?
Assignee | ||
Comment 5•11 years ago
|
||
This seems to have stagnated for a while... Rubberstamp, please!
Attachment #826646 -
Attachment is obsolete: true
Attachment #833355 -
Flags: review?(bugmail.mozilla)
Comment 6•11 years ago
|
||
Comment on attachment 833355 [details] [diff] [review] Solve endless loop problem in gecko/build/annotationProcessors/utils/Utils.java Review of attachment 833355 [details] [diff] [review]: ----------------------------------------------------------------- Either use cedric's version or move the int to be local inside the loop (or just inline it). I don't like exiting the loop with len !〓 length() even though len isn't used after that. rs〓me with any of those.
Attachment #833355 -
Flags: review?(bugmail.mozilla) → review+
Assignee | ||
Comment 7•11 years ago
|
||
(In reply to Kartikaya Gupta (email:kats@mozilla.com) from comment #6) > Either use cedric's version or move the int to be local inside the loop (or > just inline it). I don't like exiting the loop with len != length() even > though len isn't used after that. rs=me with any of those. Amazing, I uploaded the wrong patch. Yes, Cedric's approach is clearly far more sane than what I just uploaded. Subtraction! It's subtraction! How did I get subtraction wrong!? :P Actual rubber-stamp this time, then we can add this to the ever-increasing queue of things to land once the tree opens.
Attachment #833355 -
Attachment is obsolete: true
Attachment #833373 -
Flags: review?(bugmail.mozilla)
Comment 8•11 years ago
|
||
Comment on attachment 826646 [details] [diff] [review] Solve endless loop problem in gecko/build/annotationProcessors/utils/Utils.java This one has the right author.
Attachment #826646 -
Attachment is obsolete: false
Attachment #826646 -
Flags: review+
Updated•11 years ago
|
Attachment #833373 -
Attachment is obsolete: true
Attachment #833373 -
Flags: review?(bugmail.mozilla)
Reporter | ||
Updated•11 years ago
|
Keywords: checkin-needed
Comment 9•11 years ago
|
||
https://hg.mozilla.org/integration/fx-team/rev/94d56e88f893
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/94d56e88f893
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
Updated•6 years ago
|
Product: Core → Firefox Build System
You need to log in
before you can comment on or make changes to this bug.
Description
•