elkav
September 20, 2015, 5:42am
1
Hi
When system configured in PRC to “support-threads”, and loadModel is called multiple times without callback
self.model = loader.loadModel(self.bam_model)
, I sometimes get segmentation fault (not always). When I set in PRC “support-threads #f ”, problem disappears (but it prevents me from loading other models asynchronousely).
output of terminal under gdb is as the following:
[size=85]elkav@ekh4:~/mygame$ gdb python
GNU gdb (Ubuntu 7.7-0ubuntu3.1) 7.7
Copyright (C) 2014 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”.
Type “show configuration” for configuration details.
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/ .
Find the GDB manual and other documentation resources online at:
http://www.gnu.org/software/gdb/documentation/ .
For help, type “help”.
Type “apropos word” to search for commands related to “word”…
Reading symbols from python…(no debugging symbols found)…done.
(gdb) run Main.py
Starting program: /usr/bin/python Main.py
[Thread debugging using libthread_db enabled]
Using host libthread_db library “/lib/x86_64-linux-gnu/libthread_db.so.1”.
Known pipe types:
glxGraphicsPipe
(all display modules loaded.)
[New Thread 0x7fffde325700 (LWP 27481)]
[Thread 0x7fffde325700 (LWP 27481) exited]
[New Thread 0x7fffde325700 (LWP 27482)]
[New Thread 0x7fffd9b23700 (LWP 27483)]
[New Thread 0x7fffd9322700 (LWP 27484)]
:net(error): Unable to open TCP connection to server 127.0.0.1 on port 5185
:pstats(error): Couldn’t connect to PStatServer at localhost:5185
[New Thread 0x7fffd3fff700 (LWP 27485)]
[New Thread 0x7fffd37fe700 (LWP 27486)]
[New Thread 0x7fffd2847700 (LWP 27489)]
:grutil(warning): Rescaling heightfield image /home/elkav/mygame/…/stuff/mymap/hm_tiles/13x2 from 103x129 to 129x129 pixels.
.
.
.
:grutil(warning): Rescaling heightfield image /home/elkav/mygame/…/stuff/mymap/hm_tiles/11x16 from 129x112 to 129x129 pixels.
[New Thread 0x7fffbeffe700 (LWP 27499)]
[New Thread 0x7fffbe7fd700 (LWP 27500)]
[Thread 0x7fffd9322700 (LWP 27484) exited]
[Thread 0x7fffbeffe700 (LWP 27499) exited]
loaded texture: (7, 4)
loaded: (7, 4)
.
.
.
loaded texture: (6, 3)
loaded: (6, 3)
[New Thread 0x7fffd9322700 (LWP 27545)]
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffd9322700 (LWP 27545)]
0x00007fffe9a29eb0 in dlmalloc () from /usr/lib/x86_64-linux-gnu/panda3d/libp3dtool.so.1.10
(gdb) bt
#0 0x00007fffe9a29eb0 in dlmalloc () from /usr/lib/x86_64-linux-gnu/panda3d/libp3dtool.so.1.10
#1 0x00007fffe9a2aed8 in MemoryHook::heap_alloc_array(unsigned long) () from /usr/lib/x86_64-linux-gnu/panda3d/libp3dtool.so.1.10
#2 0x00007fffea556c01 in PNMFileTypePNG::Reader::read_data(pixel*, unsigned short*) () from /usr/lib/x86_64-linux-gnu/panda3d/libpanda.so.1.10
#3 0x00007fffea57cbc1 in PNMImage::read(PNMReader*) () from /usr/lib/x86_64-linux-gnu/panda3d/libpanda.so.1.10
#4 0x00007fffea49d2aa in Texture::do_read_one(Texture::CData*, Filename const&, Filename const&, int, int, int, int, LoaderOptions const&, bool, BamCacheRecord*) ()
from /usr/lib/x86_64-linux-gnu/panda3d/libpanda.so.1.10
#5 0x00007fffea4c7572 in Texture::do_read(Texture::CData*, Filename const&, Filename const&, int, int, int, int, bool, bool, LoaderOptions const&, BamCacheRecord*) ()
from /usr/lib/x86_64-linux-gnu/panda3d/libpanda.so.1.10
#6 0x00007fffea4c07b5 in Texture::do_reload_ram_image(Texture::CData*, bool) () from /usr/lib/x86_64-linux-gnu/panda3d/libpanda.so.1.10
#7 0x00007fffea4af153 in Texture::unlocked_ensure_ram_image(bool) () from /usr/lib/x86_64-linux-gnu/panda3d/libpanda.so.1.10
#8 0x00007fffea4b1ecd in TextureReloadRequest::do_task() () from /usr/lib/x86_64-linux-gnu/panda3d/libpanda.so.1.10
#9 0x00007fffea417d97 in AsyncTask::unlock_and_do_task() () from /usr/lib/x86_64-linux-gnu/panda3d/libpanda.so.1.10
#10 0x00007fffea4220f2 in AsyncTaskChain::service_one_task(AsyncTaskChain::AsyncTaskChainThread*) () from /usr/lib/x86_64-linux-gnu/panda3d/libpanda.so.1.10
#11 0x00007fffea422828 in AsyncTaskChain::AsyncTaskChainThread::thread_main() () from /usr/lib/x86_64-linux-gnu/panda3d/libpanda.so.1.10
#12 0x00007fffea40eee9 in ThreadPosixImpl::root_func(void*) () from /usr/lib/x86_64-linux-gnu/panda3d/libpanda.so.1.10
#13 0x00007ffff7bc4182 in start_thread (arg=0x7fffd9322700) at pthread_create.c:312
#14 0x00007ffff78f100d in clone () at …/sysdeps/unix/sysv/linux/x86_64/clone.S:111
(gdb) [/size]
Any idea?
my system is: ubuntu 14.04, python 2.7.6, wxpython 2.8.12.1, panda 1.9.1 (master branch)
With best regards
Yosi
rdb
September 21, 2015, 12:32pm
2
What other threading-related things do you have going on in your application?
Perhaps you could share the model plus the minimal set of lines of code so we could reproduce the crash?