You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In #1479 and BlueBrain/CoreNeuron#652 I addressed several issues flagged by the LLVM undefined behaviour sanitizer. This issue describes the issues that are not fixed in those changesets.
Now that #1842 is merged, it should be sufficient to:
Build with Clang (Clang 14 is used in the CI), using -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ or similar
Pass -DNRN_SANITIZERS=undefined -DNRN_ENABLE_TESTS=ON -DCORENRN_SANITIZERS=undefined to enable UBSan
Below is some older information, which is less up-to-date than the above
Older information
Overview of the issue
With the two changesets above, running the CTest suite locally (on a machine with no GPU) produces 80 messages like:
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/ivoc/ocobserv.h:23:28 in
in total there are 11 different problematic expressions:
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/ivoc/ocobserv.h:23:28 in
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/nrncvode/netcvode.cpp:405:16 in
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/nrncvode/netcvode.cpp:405:36 in
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/nrncvode/netcvode.cpp:5148:31 in
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/nrncvode/netcvode.cpp:5148:51 in
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/nrncvode/netcvode.cpp:5151:33 in
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/nrncvode/netcvode.cpp:5151:53 in
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/nrniv/netpar.cpp:984:32 in
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/nrniv/netpar.cpp:991:8 in
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/nrniv/netpar.cpp:992:8 in
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/nrniv/netpar.cpp:993:12 in
and these are triggered in the tests:
"parallel_bas" start time: Oct 05 17:24 CEST
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/nrncvode/netcvode.cpp:405:16 in
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/nrncvode/netcvode.cpp:405:36 in
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/ivoc/ocobserv.h:23:28 in
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/nrniv/netpar.cpp:984:32 in
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/nrniv/netpar.cpp:991:8 in
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/nrniv/netpar.cpp:992:8 in
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/nrniv/netpar.cpp:993:12 in
"parallel_bas" end time: Oct 05 17:24 CEST
"coreneuron_modtests::spikes_py" start time: Oct 05 17:24 CEST
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/nrncvode/netcvode.cpp:5148:31 in
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/nrncvode/netcvode.cpp:5148:51 in
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/ivoc/ocobserv.h:23:28 in
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/nrncvode/netcvode.cpp:5151:33 in
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/nrncvode/netcvode.cpp:5151:53 in
"coreneuron_modtests::spikes_py" end time: Oct 05 17:24 CEST
"coreneuron_modtests::spikes_file_mode_py" start time: Oct 05 17:24 CEST
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/nrncvode/netcvode.cpp:5148:31 in
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/nrncvode/netcvode.cpp:5148:51 in
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/ivoc/ocobserv.h:23:28 in
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/nrncvode/netcvode.cpp:5151:33 in
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/nrncvode/netcvode.cpp:5151:53 in
"coreneuron_modtests::spikes_file_mode_py" end time: Oct 05 17:24 CEST
"coreneuron_modtests::fornetcon_py" start time: Oct 05 17:24 CEST
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/nrncvode/netcvode.cpp:405:16 in
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/nrncvode/netcvode.cpp:405:36 in
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/ivoc/ocobserv.h:23:28 in
"coreneuron_modtests::fornetcon_py" end time: Oct 05 17:24 CEST
"coreneuron_modtests::datareturn_py" start time: Oct 05 17:24 CEST
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/nrncvode/netcvode.cpp:405:16 in
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/nrncvode/netcvode.cpp:405:36 in
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/ivoc/ocobserv.h:23:28 in
"coreneuron_modtests::datareturn_py" end time: Oct 05 17:24 CEST
"coreneuron_modtests::test_netmove_py" start time: Oct 05 17:24 CEST
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/nrncvode/netcvode.cpp:405:16 in
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/nrncvode/netcvode.cpp:405:36 in
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/ivoc/ocobserv.h:23:28 in
"coreneuron_modtests::test_netmove_py" end time: Oct 05 17:24 CEST
"coreneuron_modtests::spikes_mpi_py" start time: Oct 05 17:24 CEST
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/nrncvode/netcvode.cpp:5148:31 in
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/nrncvode/netcvode.cpp:5148:51 in
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/ivoc/ocobserv.h:23:28 in
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/nrncvode/netcvode.cpp:5151:33 in
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/nrncvode/netcvode.cpp:5151:53 in
"coreneuron_modtests::spikes_mpi_py" end time: Oct 05 17:24 CEST
"coreneuron_modtests::spikes_mpi_file_mode_py" start time: Oct 05 17:24 CEST
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/nrncvode/netcvode.cpp:5148:31 in
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/nrncvode/netcvode.cpp:5148:51 in
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/ivoc/ocobserv.h:23:28 in
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/nrncvode/netcvode.cpp:5151:33 in
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/nrncvode/netcvode.cpp:5151:53 in
"coreneuron_modtests::spikes_mpi_file_mode_py" end time: Oct 05 17:25 CEST
"external_ringtest::neuron" start time: Oct 05 17:25 CEST
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/nrncvode/netcvode.cpp:405:16 in
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/nrncvode/netcvode.cpp:405:36 in
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/ivoc/ocobserv.h:23:28 in
"external_ringtest::neuron" end time: Oct 05 17:25 CEST
"external_ringtest::neuron_mpi" start time: Oct 05 17:25 CEST
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/nrncvode/netcvode.cpp:405:16 in
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/nrncvode/netcvode.cpp:405:36 in
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/ivoc/ocobserv.h:23:28 in
"external_ringtest::neuron_mpi" end time: Oct 05 17:25 CEST
"external_ringtest::coreneuron_cpu_mpi" start time: Oct 05 17:25 CEST
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/nrncvode/netcvode.cpp:405:16 in
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/nrncvode/netcvode.cpp:405:36 in
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/ivoc/ocobserv.h:23:28 in
"external_ringtest::coreneuron_cpu_mpi" end time: Oct 05 17:25 CEST
"external_ringtest::coreneuron_cpu_mpi_offline::preparation" start time: Oct 05 17:25 CEST
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/nrncvode/netcvode.cpp:405:16 in
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/nrncvode/netcvode.cpp:405:36 in
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/ivoc/ocobserv.h:23:28 in
"external_ringtest::coreneuron_cpu_mpi_offline::preparation" end time: Oct 05 17:25 CEST
"external_ringtest::coreneuron_cpu_mpi_threads" start time: Oct 05 17:25 CEST
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/nrncvode/netcvode.cpp:405:16 in
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/nrncvode/netcvode.cpp:405:36 in
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/ivoc/ocobserv.h:23:28 in
"external_ringtest::coreneuron_cpu_mpi_threads" end time: Oct 05 17:25 CEST
Example messages for each of the 11 SUMMARY: UndefinedBehavioirSanitizer: ... lines:
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/ivoc/ocobserv.h:23:28 in
/Users/olupton/build/nrn/src/nrniv/netpar.cpp:984:32: runtime error: member access within address 0x7f8ff1e81040 which does not point to an object of type 'PreSyn'
0x7f8ff1e81040: note: object has invalid vptr
00 00 00 00 bd 7c 1e ff f8 07 00 00 c2 96 1e ff f8 07 00 30 0d 00 00 00 00 00 00 00 00 00 00 00
^~~~~~~~~~~~~~~~~~~~~~~
invalid vptr
#0 0x10cf9408e in nrnmpi_gid_clear(int) netpar.cpp:984
#1 0x10d057998 in gid_clear(void*) ocbbs.cpp:639
#2 0x10d1bbf16 in hoc_call_ob_proc hoc_oop.cpp:759
#3 0x10d1bf0ed in hoc_object_component() hoc_oop.cpp:1174
#4 0x10d5f735d in component(PyHocObject*) nrnpy_hoc.cpp:464
#5 0x10d5f63df in fcall(void*, void*) nrnpy_hoc.cpp:660
#6 0x10d05da2a in OcJumpImpl::fpycall(void* (*)(void*, void*), void*, void*) ocjump.cpp:222
...
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/nrncvode/netcvode.cpp:405:16 in
/Users/olupton/build/nrn/src/nrncvode/netcvode.cpp:405:36: runtime error: member call on address 0x7f8ff1e93ab0 which does not point to an object of type 'ObjObservable'
0x7f8ff1e93ab0: note: object is of type 'ivObservable'
01 00 00 00 98 b0 94 0d 01 00 00 00 d0 3a e9 f1 8f 7f 00 00 d0 22 f8 f1 8f 7f 00 00 40 0d 2e 13
^~~~~~~~~~~~~~~~~~~~~~~
vptr for 'ivObservable'
#0 0x10ccfeaa3 in NetCon::disconnect(ivObservable*) netcvode.cpp:405
#1 0x10d840c66 in ivObservable::~ivObservable() observe.cpp:47
#2 0x10cccfc2f in ObjObservable::~ObjObservable() ocobserv.cpp:38
#3 0x10cccf454 in hoc_obj_disconnect ocobserv.cpp:10
#4 0x10d1b9215 in hoc_obj_unref hoc_oop.cpp:2020
#5 0x10d5fb209 in hocobj_dealloc(PyHocObject*) nrnpy_hoc.cpp:185
...
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/nrncvode/netcvode.cpp:405:36 in
/Users/olupton/build/nrn/src/ivoc/ocobserv.h:23:28: runtime error: member access within address 0x7f8ff1e93ab0 which does not point to an object of type 'ObjObservable'
0x7f8ff1e93ab0: note: object is of type 'ivObservable'
01 00 00 00 98 b0 94 0d 01 00 00 00 d0 3a e9 f1 8f 7f 00 00 d0 22 f8 f1 8f 7f 00 00 40 0d 2e 13
^~~~~~~~~~~~~~~~~~~~~~~
vptr for 'ivObservable'
#0 0x10ccfed31 in ObjObservable::object() ocobserv.h:23
#1 0x10ccfeac6 in NetCon::disconnect(ivObservable*) netcvode.cpp:405
#2 0x10d840c66 in ivObservable::~ivObservable() observe.cpp:47
#3 0x10cccfc2f in ObjObservable::~ObjObservable() ocobserv.cpp:38
#4 0x10cccf454 in hoc_obj_disconnect ocobserv.cpp:10
#5 0x10d1b9215 in hoc_obj_unref hoc_oop.cpp:2020
#6 0x10d5fb209 in hocobj_dealloc(PyHocObject*) nrnpy_hoc.cpp:185
...
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/nrncvode/netcvode.cpp:5148:31 in
/Users/olupton/build/nrn/src/nrncvode/netcvode.cpp:5148:51: runtime error: member call on address 0x7ffa32cf7a20 which does not point to an object of type 'ObjObservable'
0x7ffa32cf7a20: note: object is of type 'ivObservable'
00 00 00 00 98 e0 8b 0b 01 00 00 00 40 7a cf 32 fa 7f 00 00 00 79 cf 32 fa 7f 00 00 00 00 00 00
^~~~~~~~~~~~~~~~~~~~~~~
vptr for 'ivObservable'
#0 0x10acea355 in PreSyn::disconnect(ivObservable*) netcvode.cpp:5148
#1 0x10b7b3c66 in ivObservable::~ivObservable() observe.cpp:47
#2 0x10ac42c2f in ObjObservable::~ObjObservable() ocobserv.cpp:38
#3 0x10ac42454 in hoc_obj_disconnect ocobserv.cpp:10
#4 0x10b12c215 in hoc_obj_unref hoc_oop.cpp:2020
#5 0x10b56e209 in hocobj_dealloc(PyHocObject*) nrnpy_hoc.cpp:185
...
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/nrncvode/netcvode.cpp:5148:51 in
/Users/olupton/build/nrn/src/ivoc/ocobserv.h:23:28: runtime error: member access within address 0x7ffa32cf7a20 which does not point to an object of type 'ObjObservable'
0x7ffa32cf7a20: note: object is of type 'ivObservable'
00 00 00 00 98 e0 8b 0b 01 00 00 00 40 7a cf 32 fa 7f 00 00 00 79 cf 32 fa 7f 00 00 00 00 00 00
^~~~~~~~~~~~~~~~~~~~~~~
vptr for 'ivObservable'
#0 0x10ac71d31 in ObjObservable::object() ocobserv.h:23
#1 0x10acea37b in PreSyn::disconnect(ivObservable*) netcvode.cpp:5148
#2 0x10b7b3c66 in ivObservable::~ivObservable() observe.cpp:47
#3 0x10ac42c2f in ObjObservable::~ObjObservable() ocobserv.cpp:38
#4 0x10ac42454 in hoc_obj_disconnect ocobserv.cpp:10
#5 0x10b12c215 in hoc_obj_unref hoc_oop.cpp:2020
#6 0x10b56e209 in hocobj_dealloc(PyHocObject*) nrnpy_hoc.cpp:185
...
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/nrncvode/netcvode.cpp:5151:33 in
/Users/olupton/build/nrn/src/nrncvode/netcvode.cpp:5151:53: runtime error: member call on address 0x7ffa32cf7a20 which does not point to an object of type 'ObjObservable'
0x7ffa32cf7a20: note: object is of type 'ivObservable'
00 00 00 00 98 e0 8b 0b 01 00 00 00 40 7a cf 32 fa 7f 00 00 00 79 cf 32 fa 7f 00 00 00 00 00 00
^~~~~~~~~~~~~~~~~~~~~~~
vptr for 'ivObservable'
#0 0x10acea51b in PreSyn::disconnect(ivObservable*) netcvode.cpp:5151
#1 0x10b7b3c66 in ivObservable::~ivObservable() observe.cpp:47
#2 0x10ac42c2f in ObjObservable::~ObjObservable() ocobserv.cpp:38
#3 0x10ac42454 in hoc_obj_disconnect ocobserv.cpp:10
#4 0x10b12c215 in hoc_obj_unref hoc_oop.cpp:2020
#5 0x10b56e209 in hocobj_dealloc(PyHocObject*) nrnpy_hoc.cpp:185
...
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/nrncvode/netcvode.cpp:5151:53 in
#0 0x10e7d8862 in PreSyn::disconnect(ivObservable*) netcvode.cpp:5148
#1 0x10f2a1c66 in ivObservable::~ivObservable() observe.cpp:47
#2 0x10e730c2f in ObjObservable::~ObjObservable() ocobserv.cpp:38
#3 0x10e730454 in hoc_obj_disconnect ocobserv.cpp:10
#4 0x10ec1a215 in hoc_obj_unref hoc_oop.cpp:2020
#5 0x10f05c209 in hocobj_dealloc(PyHocObject*) nrnpy_hoc.cpp:185
...
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/nrniv/netpar.cpp:984:32 in
/Users/olupton/build/nrn/src/nrniv/netpar.cpp:991:8: runtime error: member access within address 0x7f8ff1e81040 which does not point to an object of type 'PreSyn'
0x7f8ff1e81040: note: object has invalid vptr
00 00 00 00 bd 7c 1e ff f8 07 00 00 c2 96 1e ff f8 07 00 30 0d 00 00 00 00 00 00 00 00 00 00 00
^~~~~~~~~~~~~~~~~~~~~~~
invalid vptr
#0 0x10cf940de in nrnmpi_gid_clear(int) netpar.cpp:991
#1 0x10d057998 in gid_clear(void*) ocbbs.cpp:639
#2 0x10d1bbf16 in hoc_call_ob_proc hoc_oop.cpp:759
#3 0x10d1bf0ed in hoc_object_component() hoc_oop.cpp:1174
#4 0x10d5f735d in component(PyHocObject*) nrnpy_hoc.cpp:464
#5 0x10d5f63df in fcall(void*, void*) nrnpy_hoc.cpp:660
#6 0x10d05da2a in OcJumpImpl::fpycall(void* (*)(void*, void*), void*, void*) ocjump.cpp:222
...
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/nrniv/netpar.cpp:991:8 in
/Users/olupton/build/nrn/src/nrniv/netpar.cpp:992:8: runtime error: member access within address 0x7f8ff1e81040 which does not point to an object of type 'PreSyn'
0x7f8ff1e81040: note: object has invalid vptr
00 00 00 00 bd 7c 1e ff f8 07 00 00 c2 96 1e ff f8 07 00 30 0d 00 00 00 00 00 00 00 00 00 00 00
^~~~~~~~~~~~~~~~~~~~~~~
invalid vptr
#0 0x10cf9411f in nrnmpi_gid_clear(int) netpar.cpp:992
#1 0x10d057998 in gid_clear(void*) ocbbs.cpp:639
#2 0x10d1bbf16 in hoc_call_ob_proc hoc_oop.cpp:759
#3 0x10d1bf0ed in hoc_object_component() hoc_oop.cpp:1174
#4 0x10d5f735d in component(PyHocObject*) nrnpy_hoc.cpp:464
#5 0x10d5f63df in fcall(void*, void*) nrnpy_hoc.cpp:660
#6 0x10d05da2a in OcJumpImpl::fpycall(void* (*)(void*, void*), void*, void*) ocjump.cpp:222
...
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/olupton/build/nrn/src/nrniv/netpar.cpp:992:8 in
/Users/olupton/build/nrn/src/nrniv/netpar.cpp:993:12: runtime error: member access within address 0x7f8ff1e81040 which does not point to an object of type 'PreSyn'
0x7f8ff1e81040: note: object has invalid vptr
00 00 00 00 bd 7c 1e ff f8 07 00 00 c2 96 1e ff f8 07 00 30 0d 00 00 00 00 00 00 00 00 00 00 00
^~~~~~~~~~~~~~~~~~~~~~~
invalid vptr
#0 0x10cf94158 in nrnmpi_gid_clear(int) netpar.cpp:993
#1 0x10d057998 in gid_clear(void*) ocbbs.cpp:639
#2 0x10d1bbf16 in hoc_call_ob_proc hoc_oop.cpp:759
#3 0x10d1bf0ed in hoc_object_component() hoc_oop.cpp:1174
#4 0x10d5f735d in component(PyHocObject*) nrnpy_hoc.cpp:464
#5 0x10d5f63df in fcall(void*, void*) nrnpy_hoc.cpp:660
#6 0x10d05da2a in OcJumpImpl::fpycall(void* (*)(void*, void*), void*, void*) ocjump.cpp:222
...
olupton
changed the title
UndefinedBehaviourSanitizer errors in ocobserv.h, netcvode.cpp and netpar.cpp
Fix remaining UndefinedBehaviourSanitizer errors
Jun 17, 2022
Context
In #1479 and BlueBrain/CoreNeuron#652 I addressed several issues flagged by the LLVM undefined behaviour sanitizer. This issue describes the issues that are not fixed in those changesets.
The latest list of outstanding issues is in the suppression file used in the CI: https://github.com/neuronsimulator/nrn/blob/master/.sanitizers/undefined.supp.
Now that #1842 is merged, it should be sufficient to:
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
or similar-DNRN_SANITIZERS=undefined -DNRN_ENABLE_TESTS=ON -DCORENRN_SANITIZERS=undefined
to enable UBSanBelow is some older information, which is less up-to-date than the above
Older information
Overview of the issue
With the two changesets above, running the CTest suite locally (on a machine with no GPU) produces 80 messages like:
in total there are 11 different problematic expressions:
and these are triggered in the tests:
Example messages for each of the 11
SUMMARY: UndefinedBehavioirSanitizer: ...
lines:(not sure about the
BallAndStick[100]
etc. in this last one... 🧐Expected result/behavior
No tests should trigger undefined behaviour!
NEURON setup
master
with UndefinedBehaviourSanitizer fixes #1479 and UndefinedBehaviourSanitizer fixes BlueBrain/CoreNeuron#652Logs
The test log from which the above stacktraces were extracted: LastTest.log
The text was updated successfully, but these errors were encountered: