modelica-tools / FMUComplianceChecker

FMI Compliance Checker for validation of FMUs 1.0 and 2.0
BSD 3-Clause "New" or "Revised" License
42 stars 31 forks source link

Debugging Segmentation Fault. #35

Closed jbkoh closed 5 years ago

jbkoh commented 5 years ago

Hi,

I am trying to validate EnergyPlus's FMU export function in Ubuntu. I convert a basic example inside EnergyPlus 8.5 and then validate it through this Checker, but it shows "Segmentation Fault".

Here's what I did: (EnergyPlus-specific steps)

  1. Create an expanded IDF file from EnergyPlus (EnergyPlus-8-5-0/ExampleFiles/BasicFiles/Excercise2B-Solution.idf), which will create *.expidf
  2. Convert the IDF file into FMU using an export tool (http://simulationresearch.lbl.gov/fmu/EnergyPlus/export/)

(Checker step)

  1. Run fmuCheck.linux64 -l 6 ./eplusout_expidf.fmu

It results in

[VERBOSE][FMUCHK] Setting log level to [DEBUG]
[VERBOSE][FMUCHK] This binary is build without debug log messages.
 Reconfigure with FMUCHK_ENABLE_LOG_LEVEL_DEBUG=ON and rebuild to enable debug level logging
[INFO][FMUCHK] FMI compliance checker Test [FMILibrary: Test] build date: Oct 11 2018
[INFO][FMUCHK] Called with following options:
[INFO][FMUCHK] /home/jbkoh/tools/FMUComplianceChecker-2.0.4/build/fmuCheck.linux64 -l 6 ./eplusout_expidf.fmu
[INFO][FMUCHK] Will process FMU ./eplusout_expidf.fmu
[VERBOSE][FMILIB] Allocating FMIL context
[VERBOSE][FMILIB] Detecting FMI standard version
[VERBOSE][FMIZIP] Unpacking FMU into /tmp/fmucktmpTD5gNL
[VERBOSE][FMIXML] Parsing XML to detect FMI standard version
[VERBOSE][FMIXML] XML specifies FMI 1.0
[INFO][FMILIB] XML specifies FMI standard version 1.0
[VERBOSE][FMILIB] Parsing model description XML
[VERBOSE][FMI1XML] Parsing XML element fmiModelDescription
[VERBOSE][FMI1XML] Parsing XML element ModelVariables
[VERBOSE][FMI1XML] Checking alias information
[VERBOSE][FMI1XML] Setting up direct dependencies cross-references
[INFO][FMI1XML] Processing implementation element (co-simulation FMU detected)
Segmentation fault (core dumped)

I wanted to have a hint from the EnergyPlus communuity, but was out of luck, so decided to debug it myself. How should I devug Segmentation fault in this case?

Thanks!

chrbertsch commented 5 years ago

Hello Jason, unfortunately I have no experience with debugging within the compliance checker, but I found this description of how to debug an FMU simulation with FMPy and PyCharm: https://github.com/CATIA-Systems/FMPy/wiki/Hacking . With this method you could perhaps identify in which fmi-function-call the error happens. Would also have the benefit to test in another tool to see whether the problem comes from the FMU or the importing tool. (Perhaps https://stackoverflow.com/tags/fmi would be a good location to discuss such topics) Best, Christian

jbkoh commented 5 years ago

@chrbertsch Thanks for the prompt response! I've tested it on a few frameworks (fmpy, pyfmi, and this checker), but same error. So far not defining any variables for FMU seems to be the source of the problem. I can follow the procedure with FMPy for the precise debugging.

Thanks a lot!

sjoelund commented 5 years ago

I would have just run gdb on it...