﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
3170	Under Mac OS X, BouncingBall FMU segfaults in fmuCheck	cxh@…	somebody	"Under Mac OS X, using the OpenModelica svn head from 20-Feb-2015, a BouncingBall FMU created with OpenModelica segfaults in fmuCheck.

See Ticket #3169 at https://trac.openmodelica.org/OpenModelica/ticket/3169 for setup.  

Note that it is necessary to unzip the fmu in a tmp directory and do:

mv binaries/x86_64-apple-darwin13.4.0/ binaries/darwin64  
zip -r ../BouncingBallFMI20.fmu *     

I created a debug version of fmuCheck by editing FMUChecker-2.0.1/build/CMakeCache.txt and changing various places where optimization was used and -g was not used to -ggdb

{{{
//Flags used by the compiler during debug builds.
CMAKE_CXX_FLAGS_DEBUG:STRING=-ggdb

//Flags used by the compiler during release builds for minimum
// size.
CMAKE_CXX_FLAGS_MINSIZEREL:STRING=-ggdb

//Flags used by the compiler during release builds.
CMAKE_CXX_FLAGS_RELEASE:STRING=-ggdb

//Flags used by the compiler during release builds with debug info.
CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-ggdb

...

//Flags used by the compiler during debug builds.
CMAKE_C_FLAGS_DEBUG:STRING=-ggdb

//Flags used by the compiler during release builds for minimum
// size.
CMAKE_C_FLAGS_MINSIZEREL:STRING=-ggdb

//Flags used by the compiler during release builds.
CMAKE_C_FLAGS_RELEASE:STRING=-ggdb

//Flags used by the compiler during release builds with debug info.
CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-ggdb
}}}

I also changed strip to touch
{{{
//Path to a program.
CMAKE_STRIP:FILEPATH=touch
}}}

I then reran cmake .. and make, which gives me a debug version of fmuCheck.darwin64.



I still can't get a complete stack trace, but at least an assertion is failing:

{{{
bash-3.2$ ggdb /Users/cxh/src/fmi/FMUChecker-2.0.1/build/fmuCheck.darwin64                                  
GNU gdb (GDB) 7.7.1                                                                                         
Copyright (C) 2014 Free Software Foundation, Inc.                                                           
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>                               
This is free software: you are free to change and redistribute it.                                          
There is NO WARRANTY, to the extent permitted by law.  Type ""show copying""                                  
and ""show warranty"" for details.                                                                            
This GDB was configured as ""x86_64-apple-darwin13.2.0"".                                                     
Type ""show configuration"" for configuration details.                                                        
For bug reporting instructions, please see:                                                                 
<http://www.gnu.org/software/gdb/bugs/>.                                                                    
Find the GDB manual and other documentation resources online at:                                            
<http://www.gnu.org/software/gdb/documentation/>.                                                           
For help, type ""help"".                                                                                      
Type ""apropos word"" to search for commands related to ""word""...                                             
Reading symbols from /Users/cxh/src/fmi/FMUChecker-2.0.1/build/fmuCheck.darwin64...done.                    
(gdb) r BouncingBallFMI20.fmu                                                                               
Starting program: /Users/cxh/src/fmi/FMUChecker-2.0.1/build/fmuCheck.darwin64 BouncingBallFMI20.fmu         
[INFO][FMUCHK] FMI compliance checker Test [FMILibrary: Test] build date: Feb 19 2015                       
[INFO][FMUCHK] Called with following options:                                                               
[INFO][FMUCHK] /Users/cxh/src/fmi/FMUChecker-2.0.1/build/fmuCheck.darwin64 BouncingBallFMI20.fmu            
[INFO][FMUCHK] Will process FMU BouncingBallFMI20.fmu                                                       
[INFO][FMILIB] XML specifies FMI standard version 2.0                                                       
Assertion failed: (index < a->size), function jm_vector_get_itemp_char, file /Users/cxh/src/fmi/FMUChecker-\
2.0.1/FMIL/src/Util/include/JM/jm_vector.h, line 352.                                                       
                                                                                                            
Program received signal SIGABRT, Aborted.                                                                   
0x00007fff8af53866 in ?? ()                                                                                 
(gdb) where                                                                                                 
#0  0x00007fff8af53866 in ?? ()                                                                             
#1  0x00007fff8620935c in ?? ()                                                                             
#2  0x0000000000000000 in ?? ()                                                                             
(gdb)                                                                                                       
#0  0x00007fff8af53866 in ?? ()                                                                             
#1  0x00007fff8620935c in ?? ()                                                                             
#2  0x0000000000000000 in ?? ()                                                                             
(gdb)
}}}"	defect	new	high	Future	*unknown*	trunk			
