fzenke / auryn

Auryn: A fast simulator for spiking neural networks with synaptic plasticity
https://fzenke.net/auryn/
GNU General Public License v3.0
98 stars 42 forks source link

Segfaults when trying to save a simulation that uses AdExGroup #21

Closed sanjayankur31 closed 9 years ago

sanjayankur31 commented 9 years ago

Hiya,

I was running some simulations with AdEx that use the system's save_network_state method and keep running into segfaults. This is the backtrace:

Program received signal SIGSEGV, Segmentation fault.
0x0000000000455022 in NeuronGroup::virtual_serialize (this=0x6a3590, ar=..., version=<optimized out>) at /home/asinha/Documents/02_Code/00_repos/00_mine/herts-research-repo/auryn/src/NeuronGroup.cpp:351
351                     ar & *(post_state_traces[i]);
(gdb) bt
#0  0x0000000000455022 in NeuronGroup::virtual_serialize (this=0x6a3590, ar=..., version=<optimized out>) at /home/asinha/Documents/02_Code/00_repos/00_mine/herts-research-repo/auryn/src/NeuronGroup.cpp:351
#1  0x000000000043ab8f in serialize<boost::archive::binary_oarchive> (version=<optimized out>, ar=..., this=0x6a3590) at /home/asinha/Documents/02_Code/00_repos/00_mine/herts-research-repo/auryn/src/SpikingGroup.h:58
#2  serialize<boost::archive::binary_oarchive, SpikingGroup> (file_version=<optimized out>, t=..., ar=...) at /usr/include/boost/serialization/access.hpp:118
#3  serialize<boost::archive::binary_oarchive, SpikingGroup> (file_version=<optimized out>, t=..., ar=...) at /usr/include/boost/serialization/serialization.hpp:69
#4  serialize_adl<boost::archive::binary_oarchive, SpikingGroup> (file_version=<optimized out>, t=..., ar=...) at /usr/include/boost/serialization/serialization.hpp:128
#5  boost::archive::detail::oserializer<boost::archive::binary_oarchive, SpikingGroup>::save_object_data (this=<optimized out>, ar=..., x=0x6a3590) at /usr/include/boost/archive/detail/oserializer.hpp:148
#6  0x00007ffff771e1db in boost::archive::detail::basic_oarchive_impl::save_object (this=0x756770, ar=..., t=0x6a3590, bos=...) at libs/serialization/src/basic_oarchive.cpp:292
#7  0x0000000000433436 in invoke<SpikingGroup> (t=..., ar=...) at /usr/include/boost/archive/detail/oserializer.hpp:253
#8  invoke<SpikingGroup> (t=..., ar=...) at /usr/include/boost/archive/detail/oserializer.hpp:308
#9  save<boost::archive::binary_oarchive, SpikingGroup const> (t=..., ar=...) at /usr/include/boost/archive/detail/oserializer.hpp:525
#10 save_override<SpikingGroup const> (t=..., this=0x7fffffffc630) at /usr/include/boost/archive/detail/common_oarchive.hpp:69
#11 save_override<SpikingGroup> (version=0, t=..., this=0x7fffffffc630) at /usr/include/boost/archive/basic_binary_oarchive.hpp:81
#12 save_override<SpikingGroup> (t=..., this=0x7fffffffc630) at /usr/include/boost/archive/binary_oarchive_impl.hpp:63
#13 operator<< <SpikingGroup> (t=..., this=0x7fffffffc630) at /usr/include/boost/archive/detail/interface_oarchive.hpp:63
#14 System::save_network_state (this=0x6a2ad0, basename="0000-stable-netsave") at /home/asinha/Documents/02_Code/00_repos/00_mine/herts-research-repo/auryn/src/System.cpp:546
#15 0x0000000000412694 in main (ac=3, av=0x7fffffffddb8) at vogels.cpp:447

The same simulation using TIFGroup does not give me a segfault. I've checked my simulation code and don't think there's an error there. I compared the sources of the TIF and AdEx groups and noticed that the AdEx group doesn't override the "virtual_serialize" methods - could this be the reason? (I'm looking at the boost docs now, but I haven't used this part before.)

fzenke commented 9 years ago

Hi! D'oh it seems some code from one of my feature branches has leaked into the development branch without being finished. This part of the code was still buggy. I am currently compiling the library. Should be able to commit a hotfix within the hour. Have to go now and make coffee, bye! F

sanjayankur31 commented 9 years ago

Hiya! It turned out to be PEBKAC. I had a stray libauryn.a file somewhere and it was linking against it instead of the latest build. Sorry for the noise. Closing. :(

fzenke commented 9 years ago

Alright. Still seems as if you were compiling code from the develop branch. I cherry-picked some commits there which should resolve that issue.

sanjayankur31 commented 9 years ago

I am compiling against the develop branch nowadays, yeah. I just pulled your changes and they do fix the issue. Thanks! :)