Skip to content

[bug] Random ctest c_binding segfault on release build with gnu compilers #20

Description

@dfnca

Summary
cea_bindc_rp1311_ex2 generates a segfault (sometimes) when running ctest. I found that it doesn't happen all of the time; repeated executions might be necessary to observe the behavior. I was "lucky" that it happened to me on the first try of a new build.

Reproduction

  • Interface: C (issue is with C interface unit test, not the actual interface)

  • Minimal input / steps (attach .inp if relevant):

  • make -DCEA_ENABLE_BIND_PYTHON=ON -DCEA_BUILD_TESTING=ON --preset core ..
    cmake --build .
    ctest --output-on-failure [NOTE: failure doesn't always occur, but repeatedly invoking the ctest results in a segfault on example 2]

  • Command or API call used:

Expected behavior
What you expected to happen.
100% pass

Actual behavior
7/12 Test #7: cea_bindc_rp1311_ex2 .............***Exception: SegFault 1.07 sec
INFO: Reading thermo database file: data/thermo.lib
INFO: Reading 1269 gaseous products
INFO: Reading 991 condensed products
INFO: Reading 83 reactants
INFO: Building list of unique species
INFO: Found 2019 unique species
INFO: Building list of unique species
INFO: Found 80 unique species
INFO: Building list of unique elements
INFO: Found 59 unique elements
INFO: Reading transport database file: data/trans.lib
INFO: Building list of unique elements
INFO: Found 5 unique elements
INFO: BINDC: Created Mixture object at 0x37DE9050
INFO: Building list of unique elements
INFO: Found 5 unique elements
INFO: BINDC: Created Mixture object at 0x37DF30A0
INFO: BINDC: Created EqSolver from product mixture with options at 0x37C591A0
INFO: BINDC: Created EqSolution object at 0x37C5C2C0
INFO: BINDC: Created EqPartials object at 0x37D53D30

  Start  8: cea_bindc_rp1311_ex3

8/12 Test #8: cea_bindc_rp1311_ex3 ............. Passed 0.01 sec
Start 9: cea_bindc_rp1311_ex6
9/12 Test #9: cea_bindc_rp1311_ex6 ............. Passed 0.01 sec
Start 10: cea_bindc_rp1311_ex7
10/12 Test #10: cea_bindc_rp1311_ex7 ............. Passed 0.01 sec
Start 11: cea_bindc_rp1311_ex8
11/12 Test #11: cea_bindc_rp1311_ex8 ............. Passed 0.00 sec
Start 12: cea_bindc_rp1311_ex9
12/12 Test #12: cea_bindc_rp1311_ex9 ............. Passed 0.01 sec

92% tests passed, 1 tests failed out of 12

Total Test time (real) = 1.23 sec

The following tests FAILED:
7 - cea_bindc_rp1311_ex2 (SEGFAULT)
Errors while running CTest

Environment

  • OS: Ubuntu 13.3.0-6ubuntu2~24.04
  • CEA version/commit: [a09e328]
  • Compiler or Python version (if relevant): gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0

Additional context
The compiler issues multiple warnings on the C binding tests. One of them pointed to the cause of the segfaults that I observed.

This is an easy fix so I will put in a PR

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions