← Back to team overview

yade-dev team mailing list archive

[Bug 803774] Re: Saving, loading simulation with erased bodies crash.

 

For futur readers, including myself: it seems a "if (p)" before a "p->"
would help...

#7  0x00007ffcc32a6941 in *__GI___assert_fail (assertion=0x7ffcbb0eff24 "px != 0", file=<value optimized out>, line=418, function=0x7ffcbb113240 "T* boost::shared_ptr< <template-parameter-1-1> >::operator->() const [with T = Body]") at assert.c:81
#8  0x00007ffcbaec0d63 in boost::shared_ptr<Body>::operator-> (this=0x2197670) at /usr/include/boost/smart_ptr/shared_ptr.hpp:418
#9  0x00007ffcbae641d1 in InteractionContainer::clear (this=0x2197f60) at /home/francoisk/yade/core/InteractionContainer.cpp:32
#10 0x00007ffcbae6535c in InteractionContainer::postLoad__calledFromScene (this=0x2197f60, bb=...) at /home/francoisk/yade/core/InteractionContainer.cpp:158

-- 
You received this bug notification because you are a member of Yade
developers, which is the registrant for Yade.
https://bugs.launchpad.net/bugs/803774

Title:
  Saving, loading simulation with erased bodies crash.

Status in Yet Another Dynamic Engine:
  New

Bug description:
  Here is the bug :

  - launch yade (for example without any script)
  - add a sphere : O.bodies.append(utils.sphere((0.2,0.2,0.2),0.006))
  - delete it : O.bodies.erase(0)
  - save yade's universe : O.save("./test")
  - quit yade
  - launch yade
  - load the file : O.load("./test")
  ->segmentation fault

  I think it's because when you erase something the size of O.bodies (etc...) doesn't change and now contains an empty value. (the c++ array may not be dynamic ?)
  So when the O.load() function is called, yade try to load a non-existant body ?

  Maybe this can be fixed by changing the load() method ?

  I joined the debug output.

To manage notifications about this bug go to:
https://bugs.launchpad.net/yade/+bug/803774/+subscriptions


References