crash at attempt to save in binary format (should error out instead)

Bug #516576 reported by Bruno Chareyre
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Yade
Fix Released
Undecided
Unassigned

Bug Description

In r1985, on ubuntu hardy, it is not possible to save in binary format (same result with QtGui and pythonUI).

INFO yade.Omega - /home/bruno/YADE/yade-bzr/core/Omega.cpp:314 saveSimulation: Saving file /home/bruno/YADE/bin/Test2.yade
terminate called after throwing an instance of 'FactoryCantCreate'
  what(): ClassFactory::create - cannot create class named: BINFormatManager
SIGSEGV/SIGABRT handler called; gdb batch file is `/tmp/yade-zsE5GK/tmp-0'
GNU gdb 6.8-debian
Copyright (C) 2008 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 "i486-linux-gnu".
(no debugging symbols found)
(no debugging symbols found)
[Thread debugging using libthread_db enabled]
[New Thread 0xb7dc98c0 (LWP 31837)]
[New Thread 0xb0c3eb90 (LWP 31840)]
[New Thread 0xb195db90 (LWP 31839)]
[New Thread 0xb215eb90 (LWP 31838)]
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
---Type <return> to continue, or q <return> to quit---(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
warning: Lowest section in /usr/lib/libicudata.so.38 is .hash at 000000b4
0xb7f81410 in __kernel_vsyscall ()
No symbol "info" in current context.

Thread 4 (Thread 0xb215eb90 (LWP 31838)):
#0 0xb7f81410 in __kernel_vsyscall ()
#1 0xb7f53bb8 in accept () from /lib/tls/i686/cmov/libpthread.so.0
#2 0xb230ee84 in ?? () from /usr/lib/python2.5/lib-dynload/_socket.so
#3 0x080ca5c6 in PyEval_EvalFrameEx ()
#4 0x080c96e5 in PyEval_EvalFrameEx ()
#5 0x080c96e5 in PyEval_EvalFrameEx ()
#6 0x080c96e5 in PyEval_EvalFrameEx ()
#7 0x080cb1f7 in PyEval_EvalCodeEx ()
#8 0x0811370e in ?? ()
#9 0x0805cb97 in PyObject_Call ()
#10 0x08062bfb in ?? ()
#11 0x0805cb97 in PyObject_Call ()
#12 0x080c2e9c in PyEval_CallObjectWithKeywords ()
#13 0x080f5988 in ?? ()
#14 0xb7f4c4fb in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#15 0xb7ea0e5e in clone () from /lib/tls/i686/cmov/libc.so.6

Thread 3 (Thread 0xb195db90 (LWP 31839)):
#0 0xb7f81410 in __kernel_vsyscall ()
#1 0xb7f53bb8 in accept () from /lib/tls/i686/cmov/libpthread.so.0
#2 0xb230ee84 in ?? () from /usr/lib/python2.5/lib-dynload/_socket.so
#3 0x080ca5c6 in PyEval_EvalFrameEx ()
#4 0x080c96e5 in PyEval_EvalFrameEx ()
#5 0x080c96e5 in PyEval_EvalFrameEx ()
#6 0x080c96e5 in PyEval_EvalFrameEx ()
#7 0x080cb1f7 in PyEval_EvalCodeEx ()
#8 0x0811370e in ?? ()
#9 0x0805cb97 in PyObject_Call ()
#10 0x08062bfb in ?? ()
#11 0x0805cb97 in PyObject_Call ()
#12 0x080c2e9c in PyEval_CallObjectWithKeywords ()
#13 0x080f5988 in ?? ()
#14 0xb7f4c4fb in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#15 0xb7ea0e5e in clone () from /lib/tls/i686/cmov/libc.so.6

Thread 2 (Thread 0xb0c3eb90 (LWP 31840)):
#0 0xb7f81410 in __kernel_vsyscall ()
#1 0xb7e5f4fb in waitpid () from /lib/tls/i686/cmov/libc.so.6
#2 0xb7e02643 in do_system () from /lib/tls/i686/cmov/libc.so.6
#3 0xb7e02a02 in system () from /lib/tls/i686/cmov/libc.so.6
#4 0xb7f54d7d in system () from /lib/tls/i686/cmov/libpthread.so.0
#5 0xb7baa86a in crashHandler (sig=6) at core/main/pyboot.cpp:43
#6 <signal handler called>
#7 0xb7f81410 in __kernel_vsyscall ()
#8 0xb7df5085 in raise () from /lib/tls/i686/cmov/libc.so.6
#9 0xb7df6a01 in abort () from /lib/tls/i686/cmov/libc.so.6
#10 0xb7c73480 in __gnu_cxx::__verbose_terminate_handler () from /usr/lib/gcc/i486-linux-gnu/4.2.4/libstdc++.so
#11 0xb7c70d05 in ?? () from /usr/lib/gcc/i486-linux-gnu/4.2.4/libstdc++.so
#12 0xb7c70d42 in std::terminate () from /usr/lib/gcc/i486-linux-gnu/4.2.4/libstdc++.so
#13 0xb7c70e6a in __cxa_throw () from /usr/lib/gcc/i486-linux-gnu/4.2.4/libstdc++.so
#14 0xb6e0899f in ClassFactory::createShared (this=0x8225490, name=@0xb0c3cbc8) at /home/bruno/YADE/yade-bzr/lib/factory/ClassFactory.cpp:67
#15 0xb6c67a44 in IOFormatManager::saveToStream<boost::shared_ptr<Scene> > (libName=@0xb0c3ce94, out=@0xb0c3cc14, name=@0xb0c3ce90, t=@0x8206a1c) at /home/bruno/YADE/build-last-debug/include/yade-last/yade/lib-serialization/IOFormatManager.tpp:38
#16 0xb6c67ddb in IOFormatManager::saveToFile<boost::shared_ptr<Scene> > (libName=@0xb0c3ce94, fileName=@0xb0c3cf24, name=@0xb0c3ce90, t=@0x8206a1c) at /home/bruno/YADE/build-last-debug/include/yade-last/yade/lib-serialization/IOFormatManager.tpp:63
#17 0xb6b18b1b in Omega::saveSimulation (this=0x82069d0, name=@0xb0c3cf24) at /home/bruno/YADE/yade-bzr/core/Omega.cpp:322
#18 0xb4713cd8 in SimulationController::pbSaveClicked (this=0x843e408) at gui/qt3/SimulationController.cpp:256
#19 0xb4738a2c in QtGeneratedSimulationController::qt_invoke (this=0x843e408, _id=57, _o=0xb0c3d008) at /home/bruno/YADE/build-last-debug/gui/qt3/moc_QtGeneratedSimulationController.cc:172
#20 0xb7309704 in QObject::activate_signal () from /usr/lib/libqt-mt.so.3
#21 0xb730a1e9 in QObject::activate_signal () from /usr/lib/libqt-mt.so.3
#22 0xb76a2a35 in QButton::clicked () from /usr/lib/libqt-mt.so.3
#23 0xb73a71ea in QButton::mouseReleaseEvent () from /usr/lib/libqt-mt.so.3
#24 0xb733fe33 in QWidget::event () from /usr/lib/libqt-mt.so.3
#25 0xb729dc36 in QApplication::internalNotify () from /usr/lib/libqt-mt.so.3
#26 0xb729fde5 in QApplication::notify () from /usr/lib/libqt-mt.so.3
#27 0xb722e301 in QApplication::sendSpontaneousEvent () from /usr/lib/libqt-mt.so.3
#28 0xb722cf8d in QETWidget::translateMouseEvent () from /usr/lib/libqt-mt.so.3
#29 0xb722b12f in QApplication::x11ProcessEvent () from /usr/lib/libqt-mt.so.3
#30 0xb7242943 in QEventLoop::processEvents () from /usr/lib/libqt-mt.so.3
#31 0xb72b8f90 in QEventLoop::enterLoop () from /usr/lib/libqt-mt.so.3
#32 0xb729f75d in QApplication::enter_loop () from /usr/lib/libqt-mt.so.3
#33 0xb74bc6c7 in QDialog::exec () from /usr/lib/libqt-mt.so.3
#34 0xb462ac1b in FileDialog::getSaveFileName (directory=@0xb0c3d984, filters=@0xb0c3d95c, caption=@0xb0c3d980, parent=0x0, selectedFilter=@0xb0c3d994) at gui/qt3/FileDialog.cpp:61
#35 0xb4713ae3 in SimulationController::pbSaveClicked (this=0x843e408) at gui/qt3/SimulationController.cpp:247
#36 0xb4738a2c in QtGeneratedSimulationController::qt_invoke (this=0x843e408, _id=57, _o=0xb0c3da58) at /home/bruno/YADE/build-last-debug/gui/qt3/moc_QtGeneratedSimulationController.cc:172
#37 0xb7309704 in QObject::activate_signal () from /usr/lib/libqt-mt.so.3
#38 0xb730a1e9 in QObject::activate_signal () from /usr/lib/libqt-mt.so.3
#39 0xb76a2a35 in QButton::clicked () from /usr/lib/libqt-mt.so.3
#40 0xb73a71ea in QButton::mouseReleaseEvent () from /usr/lib/libqt-mt.so.3
#41 0xb733fe33 in QWidget::event () from /usr/lib/libqt-mt.so.3
#42 0xb729dc36 in QApplication::internalNotify () from /usr/lib/libqt-mt.so.3
#43 0xb729fde5 in QApplication::notify () from /usr/lib/libqt-mt.so.3
#44 0xb722e301 in QApplication::sendSpontaneousEvent () from /usr/lib/libqt-mt.so.3
#45 0xb722cf8d in QETWidget::translateMouseEvent () from /usr/lib/libqt-mt.so.3
#46 0xb722b12f in QApplication::x11ProcessEvent () from /usr/lib/libqt-mt.so.3
#47 0xb7242943 in QEventLoop::processEvents () from /usr/lib/libqt-mt.so.3
#48 0xb72b8f90 in QEventLoop::enterLoop () from /usr/lib/libqt-mt.so.3
#49 0xb72b8c8e in QEventLoop::exec () from /usr/lib/libqt-mt.so.3
#50 0xb729f7df in QApplication::exec () from /usr/lib/libqt-mt.so.3
#51 0xb4709082 in boost::_mfi::mf0<int, QApplication>::operator() (this=0xb0c3e3c0, p=0x844a180) at /usr/include/boost/bind/mem_fn_template.hpp:49
#52 0xb47090f6 in boost::_bi::list1<boost::_bi::value<QApplication*> >::operator()<int, boost::_mfi::mf0<int, QApplication>, boost::_bi::list0> (this=0xb0c3e3c8, f=@0xb0c3e3c0, a=@0xb0c3e333) at /usr/include/boost/bind.hpp:221
#53 0xb4709147 in boost::_bi::bind_t<int, boost::_mfi::mf0<int, QApplication>, boost::_bi::list1<boost::_bi::value<QApplication*> > >::operator() (this=0xb0c3e3c0) at /usr/include/boost/bind/bind_template.hpp:20
#54 0xb4709171 in boost::detail::function::void_function_obj_invoker0<boost::_bi::bind_t<int, boost::_mfi::mf0<int, QApplication>, boost::_bi::list1<boost::_bi::value<QApplication*> > >, void>::invoke (function_obj_ptr=@0xb0c3e3c0) at /usr/include/boost/function/function_template.hpp:155
#55 0xb7a3301b in boost::function0<void, std::allocator<boost::function_base> >::operator() () from /usr/lib/libboost_thread-gcc42-mt-1_34_1.so.1.34.1
#56 0xb7a32c27 in ?? () from /usr/lib/libboost_thread-gcc42-mt-1_34_1.so.1.34.1
#57 0xb7f4c4fb in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#58 0xb7ea0e5e in clone () from /lib/tls/i686/cmov/libc.so.6

Thread 1 (Thread 0xb7dc98c0 (LWP 31837)):
#0 0xb7f81410 in __kernel_vsyscall ()
#1 0xb7e99881 in select () from /lib/tls/i686/cmov/libc.so.6
#2 0xb03f3aa9 in ?? () from /usr/lib/python2.5/lib-dynload/readline.so
#3 0x0810a68b in PyOS_Readline ()
#4 0x080bf9ca in ?? ()
#5 0x080c9ab3 in PyEval_EvalFrameEx ()
#6 0x080cb1f7 in PyEval_EvalCodeEx ()
#7 0x080c93fe in PyEval_EvalFrameEx ()
#8 0x080cb1f7 in PyEval_EvalCodeEx ()
#9 0x080c93fe in PyEval_EvalFrameEx ()
#10 0x080cb1f7 in PyEval_EvalCodeEx ()
#11 0x080c93fe in PyEval_EvalFrameEx ()
#12 0x080cb1f7 in PyEval_EvalCodeEx ()
#13 0x0811370e in ?? ()
#14 0x0805cb97 in PyObject_Call ()
#15 0x08062bfb in ?? ()
#16 0x0805cb97 in PyObject_Call ()
#17 0x08063124 in ?? ()
#18 0x0805cb97 in PyObject_Call ()
#19 0x080c7aa7 in PyEval_EvalFrameEx ()
#20 0x080cb1f7 in PyEval_EvalCodeEx ()
#21 0x080cb347 in PyEval_EvalCode ()
#22 0x080ea818 in PyRun_FileExFlags ()
#23 0x080eaab9 in PyRun_SimpleFileExFlags ()
#24 0x08059335 in Py_Main ()
#25 0x080587f2 in main ()
#0 0xb7f81410 in __kernel_vsyscall ()

terminate called after throwing an instance of 'FactoryCantCreate'
  what(): ClassFactory::create - cannot create class named: BINFormatManager

Related branches

Revision history for this message
Václav Šmilauer (eudoxos) wrote :

We removed binary format support at least year ago. (There were some clashes between it and back-then hack where python was abusing the serialization interface, which is no longer the case) It would be technically possible to ressurect it, but

1. We want to use boost::serialization at some point anyway (which is faster by orders of magnitude), so it is not worth the effort.

2. If you use .xml.bz2, you will probably have files that are not larger than what binary files would be.

(Feel free to talk back if you absolutely need binary for some reason I don't see)

This bug is invalid in that sense, but I retitle it so that it says that yade should refuse to save in that format, rather than crashing.

summary: - can't save scene in bin format
+ crash at attempt to save in binary format (should error out instead)
Changed in yade:
status: New → Confirmed
Revision history for this message
Bruno Chareyre (bruno-chareyre) wrote : Re: [Yade-dev] [Bug 516576] Re: can't save scene in bin format

The size of files was not my initial idea, I tried bin to see if it
could speed-up save/load for 50k+ elements.
I don't really need that, I was just mentionning the crash.

Revision history for this message
Václav Šmilauer (eudoxos) wrote :

Boost::serialization will be much faster. All the framework is in place, but last time I tried it slowed down the compilation horribly, perhaps 10x (bunch of templates everywhere) and it was throwing at some class that was not registered, but I couldn't find which one.

Binary format wouldn't be faster, at least not that you would notice, I think.

Revision history for this message
Janek Kozicki (cosurgi) wrote : Re: [Bug 516576] Re: crash at attempt to save in binary format (should error out instead)

Václav Šmilauer said: (by the date of Wed, 03 Feb 2010 20:02:21 -0000)

> Boost::serialization will be much faster. All the framework is in place,
> but last time I tried it slowed down the compilation horribly, perhaps
> 10x (bunch of templates everywhere) and it was throwing at some class
> that was not registered, but I couldn't find which one.
>
> Binary format wouldn't be faster, at least not that you would notice, I
> think.

binary yade::serialization was faster than xml, I was using it for
that reason for few years. Though the speed difference was IIRC only
about 2 or 3 times faster.

boost::serialization in binary is more than 10 or 20 times faster.
I was loading and saving the same data in both formats, when doing snow
stuff. Apparently the only tradeoff is the compilation time...

--
Janek Kozicki |

Revision history for this message
Bruno Chareyre (bruno-chareyre) wrote : Re: [Yade-dev] [Bug 516576] Re: crash at attempt to save in binary format (should error out instead)

>
>> it slowed down the compilation horribly, perhaps
>> 10x (bunch of templates everywhere)
>>

Compilation takes enough time already. If one day somebody is
implementing bin serialization, please keep it optional...

Revision history for this message
Václav Šmilauer (eudoxos) wrote :

That is not related to binary specifically, boost::serialization can save to both binary and xml; once we make the switch, we will dump old yade serialization framework.

There is a note on compilation speed in b::s documentation, but speeding it up would mean moving the serialization function definition to the .cpp file (rather than .hpp), which would mean duplicating attribute list in the .cpp file as well.

Last time I tried it was not _that_ horrible, maybe 2-3x slower with monolithic build.

Revision history for this message
Václav Šmilauer (eudoxos) wrote :

fixed in r2019

Changed in yade:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.