[flext] segfault sending message from Threads

Spencer Russell spencer.f.russell at gmail.com
Tue Nov 22 04:25:45 CET 2011


Hmm, I spent some time stripping down to a bare-bones implementation
to try to reproduce the issue but the bare-bones version runs fine. I
think there's another bug elsewhere in my synchronization code that's
causing the thread to continue running after the object it's accessing
is deallocated, which may be the source of the issue.

-s

On Mon, Nov 21, 2011 at 4:38 AM, Thomas Grill <gr at grrrr.org> wrote:
> Hey Spencer,
> this should definitely not happen. Is there a way that you can send me a
> stripped-down version if your project, showing that behavior?
> thanks!
> gr~~~
>
> Am 21.11.2011 um 07:02 schrieb Spencer Russell:
>
>> I'm having some segfault issues that I think are related to messages
>> being queued up by threads, but then the object is destroyed before
>> the messages actually get sent out the outlets. When the message
>> finally gets to the front of the queue it tries to send it out of a
>> non-existent outlet and segfaults.
>>
>> Should i be doing some thing in my object destructor to make sure that
>> the queue gets cleared out before the object goes out of scope?
>>
>> Here's a backtrace. Thanks,
>> Spencer
>>
>> pd_typedmess (x=0xc4da80, s=0xbe79e0, argc=2, argv=0xbf5690) at
>> m_class.c:708
>> 708         for (i = c->c_nmethod, m = c->c_methods; i--; m++)
>> (gdb) bt
>> #0  pd_typedmess (x=0xc4da80, s=0xbe79e0, argc=2, argv=0xbf5690) at
>> m_class.c:708
>> #1  0x0000000000471c1a in outlet_anything (x=<value optimized out>,
>> s=0xbe79e0, argc=2, argv=0xbf5690) at m_obj.c:442
>> #2  0x00007fffe8e8df23 in flext_base_multi_d::ToSysAnything
>> (this=0xbfba00, n=0, s=0xbe79e0, argc=2, argv=0xbf5690)
>>   at source/flclass.h:865
>> #3  0x00007fffe8e924b3 in flext_multi_d::MsgBundle::Msg::Send
>> (this=0xbf5668) at source/flqueue.cpp:270
>> #4  0x00007fffe8e920a2 in flext_multi_d::MsgBundle::Send
>> (this=0xbf5660) at source/flqueue.cpp:190
>> #5  0x00007fffe8e9122e in QWork (syslock=true, flushobj=0x0) at
>> source/flqueue.cpp:398
>> #6  0x00007fffe8e913df in flext_base_multi_d::QWorker () at
>> source/flqueue.cpp:507
>> #7  0x00007fffe8e883da in LaunchHelper (e=0xbf4f80) at
>> source/flthr.cpp:159
>> #8  0x00007ffff702bd8c in start_thread () from
>> /lib/x86_64-linux-gnu/libpthread.so.0
>> #9  0x00007ffff6d7704d in clone () from /lib/x86_64-linux-gnu/libc.so.6
>> #10 0x0000000000000000 in ?? ()
>> _______________________________________________
>> http://grrrr.org/ext/flext
>>
>> flext mailing list
>> flext at grrrr.org
>> http://grrrr.org/cgi-bin/mailman/listinfo/flext
>
>


More information about the flext mailing list