Skip to content

xtb 6.5.0 C API test segfaults #635

@susilehtola

Description

@susilehtola

The C API test in xtb 6.5.0 segfaults on Fedora.

Valgrind output

valgrind /home/susi/rpmbuild/BUILD/xtb-6.5.0/redhat-linux-build/test/api/xtb_c_test
==136897== Memcheck, a memory error detector
==136897== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
==136897== Using Valgrind-3.19.0 and LibVEX; rerun with -h for copyright info
==136897== Command: /home/susi/rpmbuild/BUILD/xtb-6.5.0/redhat-linux-build/test/api/xtb_c_test
==136897== 
==136897== Invalid read of size 8
==136897==    at 0x265F3E: UnknownInlinedFun (molecule.f90:358)
==136897==    by 0x265F3E: xtb_newMolecule.constprop.0 (molecule.f90:81)
==136897==    by 0x12427E: testFirst (c_api_example.c:64)
==136897==    by 0x11D11B: main (c_api_example.c:286)
==136897==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==136897== 
==136897== 
==136897== Process terminating with default action of signal 11 (SIGSEGV): dumping core
==136897==  Access not within mapped region at address 0x0
==136897==    at 0x265F3E: UnknownInlinedFun (molecule.f90:358)
==136897==    by 0x265F3E: xtb_newMolecule.constprop.0 (molecule.f90:81)
==136897==    by 0x12427E: testFirst (c_api_example.c:64)
==136897==    by 0x11D11B: main (c_api_example.c:286)
==136897==  If you believe this happened as a result of a stack
==136897==  overflow in your program's main thread (unlikely but
==136897==  possible), you can try to increase the size of the
==136897==  main thread stack using the --main-stacksize= flag.
==136897==  The main thread stack size used in this run was 8388608.
==136897== 
==136897== HEAP SUMMARY:
==136897==     in use at exit: 8,848,192 bytes in 142 blocks
==136897==   total heap usage: 329 allocs, 187 frees, 9,057,943 bytes allocated
==136897== 
==136897== LEAK SUMMARY:
==136897==    definitely lost: 0 bytes in 0 blocks
==136897==    indirectly lost: 0 bytes in 0 blocks
==136897==      possibly lost: 4,608 bytes in 2 blocks
==136897==    still reachable: 8,843,584 bytes in 140 blocks
==136897==         suppressed: 0 bytes in 0 blocks
==136897== Rerun with --leak-check=full to see details of leaked memory
==136897== 
==136897== For lists of detected and suppressed errors, rerun with: -s
==136897== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
Segmentation fault (core dumped)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-APIConcerns the ISO-C layerbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions