← Back to team overview

yade-dev team mailing list archive

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

 

Hi all,

Unfortunately I am still affected by this bug. I cannot provide a simple
script but below is what I obtained in debug mode. Could you please
help? Thanks very much. Chiara

yade --debug                              
Welcome to Yade unknown (debug build)
TCP python prompt on localhost:9001, auth cookie `ksyecu'
XMLRPC info provider on http://localhost:21001
Traceback (most recent call last):
  File "/home/chia/yade/inst/lib/yade/dbg/py/yade/remote.py", line 121, in run
    def run(self): self.func()
  File "/usr/lib/python2.6/SocketServer.py", line 224, in serve_forever
    r, w, e = select.select([self], [], [], poll_interval)
select.error: (4, 'Interrupted system call')
[[ ^L clears screen, ^U kills line. F12 controller, F11 3d view, F10 both, F9 generator, F8 plot. ]]
Yade [1]: O.load('test_removeBodies.xml.bz2')
python: /usr/include/boost/smart_ptr/shared_ptr.hpp:418: T* boost::shared_ptr< <template-parameter-1-1> >::operator->() const [with T = Body]: Assertion `px != 0' failed.
SIGSEGV/SIGABRT handler called; gdb batch file is `/tmp/yade-yk3ih0/tmp-0'
GNU gdb (GDB) 7.1-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
[Thread debugging using libthread_db enabled]
[New Thread 0x7faeb4bb7700 (LWP 25248)]
0x00007faed433a2bd in __libc_waitpid (pid=25250, stat_loc=<value optimised out>, options=0) at ../sysdeps/unix/sysv/linux/waitpid.c:41
41	../sysdeps/unix/sysv/linux/waitpid.c: No such file or directory.
	in ../sysdeps/unix/sysv/linux/waitpid.c
No symbol "info" in current context.

Thread 2 (Thread 0x7faeb4bb7700 (LWP 25248)):
#0  sem_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S:86
#1  0x00000000004d4498 in PyThread_acquire_lock ()
#2  0x00000000004a20e4 in PyEval_RestoreThread ()
#3  0x00000000004f701e in ?? ()
#4  0x00000000004a7c5e in PyEval_EvalFrameEx ()
#5  0x00000000004a9671 in PyEval_EvalCodeEx ()
#6  0x00000000004a7809 in PyEval_EvalFrameEx ()
#7  0x00000000004a9671 in PyEval_EvalCodeEx ()
#8  0x0000000000537620 in ?? ()
#9  0x000000000041f0c7 in PyObject_Call ()
#10 0x0000000000427dff in ?? ()
#11 0x000000000041f0c7 in PyObject_Call ()
#12 0x00000000004a1b03 in PyEval_CallObjectWithKeywords ()
#13 0x00007faeb53c2d3b in ?? () from /usr/lib/pymodules/python2.6/sip.so
#14 0x00007faeb566a468 in ?? () from /usr/lib/pymodules/python2.6/PyQt4/QtCore.so
#15 0x00007faeb569a630 in ?? () from /usr/lib/pymodules/python2.6/PyQt4/QtCore.so
#16 0x00007faed0802775 in ?? () from /usr/lib/libQtCore.so.4
#17 0x00007faed549c9ca in start_thread (arg=<value optimised out>) at pthread_create.c:300
#18 0x00007faed4376cdd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#19 0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7faed58a3700 (LWP 25244)):
#0  0x00007faed433a2bd in __libc_waitpid (pid=25250, stat_loc=<value optimised out>, options=0) at ../sysdeps/unix/sysv/linux/waitpid.c:41
#1  0x00007faed42d17e9 in do_system (line=<value optimised out>) at ../sysdeps/posix/system.c:149
#2  0x00007faed42d1b20 in __libc_system (line=<value optimised out>) at ../sysdeps/posix/system.c:190
#3  0x00007faed574d473 in crashHandler (sig=6) at core/main/pyboot.cpp:45
#4  <signal handler called>
#5  0x00007faed42c3a75 in *__GI_raise (sig=<value optimised out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#6  0x00007faed42c75c0 in *__GI_abort () at abort.c:92
#7  0x00007faed42bc941 in *__GI___assert_fail (assertion=0x7faecb5e30d4 "px != 0", file=<value optimised out>, line=418, function=0x7faecb6064e0 "T* boost::shared_ptr< <template-parameter-1-1> >::operator->() const [with T = Body]") at assert.c:81
#8  0x00007faecb39669b in boost::shared_ptr<Body>::operator-> (this=0x7faeaad1b410) at /usr/include/boost/smart_ptr/shared_ptr.hpp:418
#9  0x00007faecb337327 in InteractionContainer::insert (this=0x83c8e30, i=...) at /home/chia/yade/src/yade/core/InteractionContainer.cpp:19
#10 0x00007faecb338bcc in InteractionContainer::postLoad__calledFromScene (this=0x83c8e30, bb=...) at /home/chia/yade/src/yade/core/InteractionContainer.cpp:160
#11 0x00007faecb33a029 in Scene::postLoad (this=0x2ce0600) at /home/chia/yade/src/yade/core/Scene.cpp:60
#12 0x00007faecb4dd110 in Scene::serialize<boost::archive::xml_iarchive> (this=0x2ce0600, ar=..., version=0) at /home/chia/yade/build/build-current-rolling-jkr-allowBigger/dbg/include/yade/core/Scene.hpp:75
#13 0x00007faecb4cece0 in boost::serialization::access::serialize<boost::archive::xml_iarchive, Scene> (ar=..., t=..., file_version=0) at /usr/include/boost/serialization/access.hpp:109
#14 0x00007faecb4b9dd7 in boost::serialization::serialize<boost::archive::xml_iarchive, Scene> (ar=..., t=..., file_version=0) at /usr/include/boost/serialization/serialization.hpp:74
#15 0x00007faecb493af7 in boost::serialization::serialize_adl<boost::archive::xml_iarchive, Scene> (ar=..., t=..., file_version=0) at /usr/include/boost/serialization/serialization.hpp:133
#16 0x00007faecb47920d in boost::archive::detail::iserializer<boost::archive::xml_iarchive, Scene>::load_object_data (this=0x7faecb7f13b0, ar=..., x=0x2ce0600, file_version=0) at /usr/include/boost/archive/detail/iserializer.hpp:170
#17 0x00007faed24d8a22 in boost::archive::detail::basic_iarchive::load_object(void*, boost::archive::detail::basic_iserializer const&) () from /usr/lib/libboost_serialization.so.1.40.0
#18 0x00007faecb4f417c in boost::archive::detail::load_non_pointer_type<boost::archive::xml_iarchive, Scene>::load_standard::invoke (ar=..., t=...) at /usr/include/boost/archive/detail/iserializer.hpp:357
#19 0x00007faecb4edd4f in boost::archive::detail::load_non_pointer_type<boost::archive::xml_iarchive, Scene>::invoke (ar=..., t=...) at /usr/include/boost/archive/detail/iserializer.hpp:417
#20 0x00007faecb4e709d in boost::archive::load<boost::archive::xml_iarchive, Scene> (ar=..., t=...) at /usr/include/boost/archive/detail/iserializer.hpp:542
#21 0x00007faecb4dfb2c in boost::archive::detail::common_iarchive<boost::archive::xml_iarchive>::load_override<Scene> (this=0x7fffbd96b440, t=...) at /usr/include/boost/archive/detail/common_iarchive.hpp:61
#22 0x00007faecb4d2aed in boost::archive::basic_xml_iarchive<boost::archive::xml_iarchive>::load_override<Scene> (this=0x7fffbd96b440, t=...) at /usr/include/boost/archive/basic_xml_iarchive.hpp:81
#23 0x00007faecb4c206b in boost::archive::xml_iarchive_impl<boost::archive::xml_iarchive>::load_override<boost::serialization::nvp<Scene> const> (this=0x7fffbd96b440, t=...) at /usr/include/boost/archive/xml_iarchive.hpp:75
#24 0x00007faecb4a01f2 in boost::archive::detail::interface_iarchive<boost::archive::xml_iarchive>::operator>><boost::serialization::nvp<Scene> const> (this=0x7fffbd96b440, t=...) at /usr/include/boost/archive/detail/interface_iarchive.hpp:61
#25 0x00007faecb480e78 in boost::archive::detail::pointer_iserializer<boost::archive::xml_iarchive, Scene>::load_object_ptr (this=0x7faecb7f13a0, ar=..., x=@0x2c9c9b0, file_version=0) at /usr/include/boost/archive/detail/iserializer.hpp:304
#26 0x00007faed24d8e1d in boost::archive::detail::basic_iarchive::load_pointer(void*&, boost::archive::detail::basic_pointer_iserializer const*) () from /usr/lib/libboost_serialization.so.1.40.0
#27 0x00007faecb5019c0 in boost::archive::detail::load_pointer_type<boost::archive::xml_iarchive, Scene*>::invoke (ar=..., t=@0x7fffbd96b108) at /usr/include/boost/archive/detail/iserializer.hpp:478
#28 0x00007faecb4fdab7 in boost::archive::load<boost::archive::xml_iarchive, Scene*> (ar=..., t=@0x7fffbd96b108) at /usr/include/boost/archive/detail/iserializer.hpp:542
#29 0x00007faecb4fabee in boost::archive::detail::common_iarchive<boost::archive::xml_iarchive>::load_override<Scene*> (this=0x7fffbd96b440, t=@0x7fffbd96b108) at /usr/include/boost/archive/detail/common_iarchive.hpp:61
#30 0x00007faecb4f5995 in boost::archive::basic_xml_iarchive<boost::archive::xml_iarchive>::load_override<Scene*> (this=0x7fffbd96b440, t=...) at /usr/include/boost/archive/basic_xml_iarchive.hpp:81
#31 0x00007faecb4efbad in boost::archive::xml_iarchive_impl<boost::archive::xml_iarchive>::load_override<boost::serialization::nvp<Scene*> const> (this=0x7fffbd96b440, t=...) at /usr/include/boost/archive/xml_iarchive.hpp:75
#32 0x00007faecb4e8f74 in boost::archive::detail::interface_iarchive<boost::archive::xml_iarchive>::operator>><boost::serialization::nvp<Scene*> const> (this=0x7fffbd96b440, t=...) at /usr/include/boost/archive/detail/interface_iarchive.hpp:61
#33 0x00007faecb4e365b in boost::serialization::load<boost::archive::xml_iarchive, Scene> (ar=..., t=..., file_version=1) at /usr/include/boost/serialization/shared_ptr.hpp:136
#34 0x00007faecb4d7529 in boost::serialization::free_loader<boost::archive::xml_iarchive, boost::shared_ptr<Scene> >::invoke (ar=..., t=..., file_version=1) at /usr/include/boost/serialization/split_free.hpp:58
#35 0x00007faecb4caf55 in boost::serialization::split_free<boost::archive::xml_iarchive, boost::shared_ptr<Scene> > (ar=..., t=..., file_version=1) at /usr/include/boost/serialization/split_free.hpp:74
#36 0x00007faecb4b505f in boost::serialization::serialize<boost::archive::xml_iarchive, Scene> (ar=..., t=..., file_version=1) at /usr/include/boost/serialization/shared_ptr.hpp:153
#37 0x00007faecb48d343 in boost::serialization::serialize_adl<boost::archive::xml_iarchive, boost::shared_ptr<Scene> > (ar=..., t=..., file_version=1) at /usr/include/boost/serialization/serialization.hpp:133
#38 0x00007faecb472c3d in boost::archive::detail::iserializer<boost::archive::xml_iarchive, boost::shared_ptr<Scene> >::load_object_data (this=0x7faecb7f5cb0, ar=..., x=0x1aaf4f0, file_version=1) at /usr/include/boost/archive/detail/iserializer.hpp:170
#39 0x00007faed24d89e6 in boost::archive::detail::basic_iarchive::load_object(void*, boost::archive::detail::basic_iserializer const&) () from /usr/lib/libboost_serialization.so.1.40.0
#40 0x00007faecb444acd in boost::archive::detail::load_non_pointer_type<boost::archive::xml_iarchive, boost::shared_ptr<Scene> >::load_standard::invoke (ar=..., t=...) at /usr/include/boost/archive/detail/iserializer.hpp:357
#41 0x00007faecb43d4b1 in boost::archive::detail::load_non_pointer_type<boost::archive::xml_iarchive, boost::shared_ptr<Scene> >::invoke (ar=..., t=...) at /usr/include/boost/archive/detail/iserializer.hpp:417
#42 0x00007faecb425fbb in boost::archive::load<boost::archive::xml_iarchive, boost::shared_ptr<Scene> > (ar=..., t=...) at /usr/include/boost/archive/detail/iserializer.hpp:542
#43 0x00007faecb414496 in boost::archive::detail::common_iarchive<boost::archive::xml_iarchive>::load_override<boost::shared_ptr<Scene> > (this=0x7fffbd96b440, t=...) at /usr/include/boost/archive/detail/common_iarchive.hpp:61
#44 0x00007faecb405155 in boost::archive::basic_xml_iarchive<boost::archive::xml_iarchive>::load_override<boost::shared_ptr<Scene> > (this=0x7fffbd96b440, t=...) at /usr/include/boost/archive/basic_xml_iarchive.hpp:81
#45 0x00007faecb3f0a7f in boost::archive::xml_iarchive_impl<boost::archive::xml_iarchive>::load_override<boost::serialization::nvp<boost::shared_ptr<Scene> > const> (this=0x7fffbd96b440, t=...) at /usr/include/boost/archive/xml_iarchive.hpp:75
#46 0x00007faecb3dbb24 in boost::archive::detail::interface_iarchive<boost::archive::xml_iarchive>::operator>><boost::serialization::nvp<boost::shared_ptr<Scene> > const> (this=0x7fffbd96b440, t=...) at /usr/include/boost/archive/detail/interface_iarchive.hpp:61
#47 0x00007faecb3be8f3 in yade::ObjectIO::load<boost::shared_ptr<Scene>, boost::archive::xml_iarchive> (ifs=..., objectTag=..., object=...) at /home/chia/yade/build/build-current-rolling-jkr-allowBigger/dbg/include/yade/lib/serialization/ObjectIO.hpp:42
#48 0x00007faecb39db4a in yade::ObjectIO::load<boost::shared_ptr<Scene> > (fileName=..., objectTag=..., object=...) at /home/chia/yade/build/build-current-rolling-jkr-allowBigger/dbg/include/yade/lib/serialization/ObjectIO.hpp:63
#49 0x00007faecb3404bd in Omega::loadSimulation (this=0x1aaf460, f=..., quiet=false) at /home/chia/yade/src/yade/core/Omega.cpp:231
#50 0x00007faeba79fabf in pyOmega::load (this=0x1a3e6b0, fileName=..., quiet=false) at py/wrapper/yadeWrapper.cpp:374
#51 0x00007faeba8ac331 in boost::python::detail::invoke<int, void (pyOmega::*)(std::string, bool), boost::python::arg_from_python<pyOmega&>, boost::python::arg_from_python<std::string>, boost::python::arg_from_python<bool> > (f=@0x1bb3c48, tc=..., ac0=..., ac1=...) at /usr/include/boost/python/detail/invoke.hpp:94
#52 0x00007faeba88df82 in boost::python::detail::caller_arity<3u>::impl<void (pyOmega::*)(std::string, bool), boost::python::default_call_policies, boost::mpl::vector4<void, pyOmega&, std::string, bool> >::operator() (this=0x1bb3c48, args_=0x29191e0) at /usr/include/boost/python/detail/caller.hpp:223
#53 0x00007faeba86afbd in boost::python::objects::caller_py_function_impl<boost::python::detail::caller<void (pyOmega::*)(std::string, bool), boost::python::default_call_policies, boost::mpl::vector4<void, pyOmega&, std::string, bool> > >::operator() (this=0x1bb3c40, args=0x29191e0, kw=0x0) at /usr/include/boost/python/object/py_function.hpp:38
#54 0x00007faed2032c2e in boost::python::objects::function::call(_object*, _object*) const () from /usr/lib/libboost_python-py26.so.1.40.0
#55 0x00007faed2032ed8 in ?? () from /usr/lib/libboost_python-py26.so.1.40.0
#56 0x00007faed203a54b in boost::python::handle_exception_impl(boost::function0<void>) () from /usr/lib/libboost_python-py26.so.1.40.0
#57 0x00007faed202f7d8 in ?? () from /usr/lib/libboost_python-py26.so.1.40.0
#58 0x000000000041f0c7 in PyObject_Call ()
#59 0x00000000004a7378 in PyEval_EvalFrameEx ()
#60 0x00000000004a9671 in PyEval_EvalCodeEx ()
#61 0x00000000004a9742 in PyEval_EvalCode ()
#62 0x00000000004a887b in PyEval_EvalFrameEx ()
#63 0x00000000004a9671 in PyEval_EvalCodeEx ()
#64 0x00000000004a7809 in PyEval_EvalFrameEx ()
#65 0x00000000004a9671 in PyEval_EvalCodeEx ()
#66 0x00000000004a7809 in PyEval_EvalFrameEx ()
#67 0x00000000004a8550 in PyEval_EvalFrameEx ()
#68 0x00000000004a9671 in PyEval_EvalCodeEx ()
#69 0x00000000004a7809 in PyEval_EvalFrameEx ()
#70 0x00000000004a9671 in PyEval_EvalCodeEx ()
#71 0x00000000004a7809 in PyEval_EvalFrameEx ()
#72 0x00000000004a9671 in PyEval_EvalCodeEx ()
#73 0x0000000000537620 in ?? ()
#74 0x000000000041f0c7 in PyObject_Call ()
#75 0x0000000000427dff in ?? ()
#76 0x000000000041f0c7 in PyObject_Call ()
#77 0x000000000042708d in ?? ()
#78 0x000000000041f0c7 in PyObject_Call ()
#79 0x00000000004a7378 in PyEval_EvalFrameEx ()
#80 0x00000000004a9671 in PyEval_EvalCodeEx ()
#81 0x00000000004a7809 in PyEval_EvalFrameEx ()
#82 0x00000000004a9671 in PyEval_EvalCodeEx ()
#83 0x00000000004a9742 in PyEval_EvalCode ()
#84 0x00000000004c9a0e in PyRun_FileExFlags ()
#85 0x00000000004c9c24 in PyRun_SimpleFileExFlags ()
#86 0x000000000041a7ff in Py_Main ()
#87 0x00007faed42aec4d in __libc_start_main (main=<value optimised out>, argc=<value optimised out>, ubp_av=<value optimised out>, init=<value optimised out>, fini=<value optimised out>, rtld_fini=<value optimised out>, stack_end=0x7fffbd96d508) at libc-start.c:226
#88 0x00000000004199f9 in _start ()
zsh: abort      yade --debug



On 15 Jun 2012, at 10:04, Anton Gladky wrote:

> Hi Chiara,
> 
> the fix is here [1]. It checks, whether the body exist before
> clearing its intrs-container.
> 
> If you are still affected by this bug, please, send a short
> script, reproducing the problem
> 
> Thanks
> Anton
> 
> [1]
> https://github.com/yade/trunk/commit/ce52daf69cc7b0d804703a0877ffffec68fafae8
> 
> 
> 2012/6/15 Chiara Modenese <c.modenese@xxxxxxxxx>:
>> Hi Anton,
>> 
>> I am currently affected by this bug. I am using an older release (but
>> not too old) andI updated the code following your fix in r2880. The bug
>> still occurs though but I have have not rerun the test. I reload the old
>> test using the code I recompiled after the change, I remove the bodies I
>> do not need anymore, save the test and then reload it again (but the
>> crash occurs). Do I perhaps need to rerun the test for the change to be
>> effected?
>> 
>> Also, could you explain in words your fix in the code?
>> 
>> Thank you.
>> Chiara
>> 
> 
> -- 
> 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:
>  Fix Released
> 
> 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
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-dev
> Post to     : yade-dev@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~yade-dev
> More help   : https://help.launchpad.net/ListHelp

-- 
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:
  Fix Released

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


Follow ups

References