Mantis - Squeak
Viewing Issue Advanced Details
7760 VM crash always 04-13-13 13:22 04-18-13 01:21
lewis  
lewis  
normal  
assigned  
open  
none    
none  
0007760: FloatMathPlugin crashes the VM if compiled in 64 bit mode
FloatMathPluginTest pass when VM is compiled 32 bit, but fail when compiled 64 bit. testCos (and probably others) will crash the VM.
Tested on Linux with interpreter VM, but presumably effects all platforms.
related to 0007592closed lewis FloatMathPlugin crashes the VM if compiled with gcc optimization 

Notes
(0014347)
lewis   
04-18-13 00:53   
The failure occurs in the support library, e.g. a segfault within the call to __ieee754_cos(). This is a gcc optimization bug, and turning off optimization makes it go away. This was identified in issue 7592 but it looks like we have reenabled too much of the optimization. Fix should go into config.cmake to set optimization to -O0, probably like this:

IF (CMAKE_COMPILER_IS_GNUCC AND CMAKE_SYSTEM_NAME STREQUAL "Linux")
  SET (LIBM_CFLAGS "${CMAKE_C_FLAGS} -O0")
ENDIF ()
(0014348)
lewis   
04-18-13 01:21   
To refine this a bit, on my SuSE Linux box the optimization -O0 and -O1 both work, and -O2 crashes with a segfault. So it may be a crashworthy compromise to set it as:

IF (CMAKE_COMPILER_IS_GNUCC AND CMAKE_SYSTEM_NAME STREQUAL "Linux")
  SET (LIBM_CFLAGS "${CMAKE_C_FLAGS} -O1")
ENDIF ()