Hi Dave,

Per an earlier thread, I am building a very simple multithreaded UAS
> redirect server.  (Note: in my earlier thread I was running it in stateless
> mode, but now I am running in stateful mode).
>
>
:-)


> The simple scenario is an INVITE that gets handed to a different worker
> thread, a short time later the main thread crashes when trying to send a 100
> Trying due to a timer expiring in the stack.
>
> It looks like this:
>
> 1.  Main thread creates root, run event loop, gets incoming INVITE
> 2. Main thread sends su_msg_r to clone task (in separate thread) to look up
> a contact for this request
> 3.  Main thread returns 0 from the sip request callback
> 4. Short time later, N1 timer goes off and stack attempts to generate a 100
> Trying (I have deliberately put a sleep in my clone task temporarily to make
> this happen)
> 5. Library crashes in freeaddrinfo
>
>
Pretty strange. I actually do more or less the same.

Crashes in free() usually show a previous problem regarding heap memory
corruption.

I would run your program with valgrind memcheck tool and see if there are
any invalid writes reported in your code. That is usually the fastest way to
see where the heap was corrupted. You could also use electric fence also,
which will force a segfault as soon as any invalid write in heap happens.

Cheers,
-Aleksander
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel

Reply via email to