All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-java][PATCH] ecj-initial.in: Disable multithreading to mitigate segfaulting
@ 2015-11-10  6:55 Erkka Kääriä
  0 siblings, 0 replies; only message in thread
From: Erkka Kääriä @ 2015-11-10  6:55 UTC (permalink / raw)
  To: openembedded-devel

Cacao-initial-native suffers from sporadic segmentation faults, when the Java
program uses multiple Java threads, due to a race condition. In particular,
jamvm-native and classpath-native builds would occasionally fail as the
eclipse compiler used during build task by default uses multiple threads.

As fixing the race condition would require large changes to the
cacao-initial-native codebase, and as it is only used briefly during the
bootstrapping process, it is easier and safer to just force ecj-initial to run
in a singlethreaded mode.

Signed-off-by: Erkka Kääriä <erkka.kaaria@intel.com>
---
 recipes-core/ecj/files/ecj-initial.in | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/recipes-core/ecj/files/ecj-initial.in b/recipes-core/ecj/files/ecj-initial.in
index 2099991..30c1c8a 100755
--- a/recipes-core/ecj/files/ecj-initial.in
+++ b/recipes-core/ecj/files/ecj-initial.in
@@ -1 +1,3 @@
-${RUNTIME} -Xmx512m -cp ${ECJ_JAR} org.eclipse.jdt.internal.compiler.batch.Main ${1+"$@"}
+# -Djdt.compiler.useSingleThread=true forces the compiler to only use a single thread. This is a workaround to a race condition
+# bug in cacao-initial-native, where using multiple java thread could cause sporadic segmentation faults
+${RUNTIME} -Xmx512m -Djdt.compiler.useSingleThread=true -cp ${ECJ_JAR} org.eclipse.jdt.internal.compiler.batch.Main ${1+"$@"}
-- 
2.1.4

---------------------------------------------------------------------
Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki 
Business Identity Code: 0357606 - 4 
Domiciled in Helsinki 

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-11-10  6:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-10  6:55 [meta-java][PATCH] ecj-initial.in: Disable multithreading to mitigate segfaulting Erkka Kääriä

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.