|
From: Philippe W. <phi...@sk...> - 2012-06-28 06:43:06
|
On Thu, 2012-06-28 at 05:28 +0200, Roland Mainz wrote: > Erm... ksh93 doesn't use |fork()| for command substitutions in a > subshell (e.g. x=$(...)) or in subshells itself (mainly for > performance reasons... which gives a *major* performance boost (and > causes less scalabilty issues with very large SMP/NUMA machines)) > unless you touch a system resource which can't be reversed by the > shell itself (e.g. changing ulimit will force a |fork()| ... which is > used in some tests of the AST/ksh93 test suite to test whether > |fork()| causes trouble... see below...). Shell variables (and other > resources) are handled in a copy-on-write manner if changed in the > subshell. > The interesting part is... if we force a |fork()| in the tests (e.g. > do a x=$( ulimit -c 0 ; ...) instead of x=$(...)) the problem goes > away. You might try other tools to search for possible bugs causing this (e.g. --tool=helgrind, --tool=drd, --tool=exp-sgcheck). (is the ksh93 using threads ? if not, helgrind/drd cannot help) Alternatively, if you are doing tricky things with signals, maybe --vex-iropt-precise-memory-exns=yes might help. You can also debug in parallel a native run of ksh93 and a run under Valgrind, and see when they start to diverge. Philippe |