SCTP Discussions

Text archives Help


Re: [SCTP-Discussion] a weird bug (segmentation fault)


Chronological Thread 
  • From: Thomas Dreibholz <dreibh AT iem.uni-due.de>
  • To: "Julio Kriger" <juliokriger AT gmail.com>
  • Cc: discussion AT sctp.de
  • Subject: Re: [SCTP-Discussion] a weird bug (segmentation fault)
  • Date: Tue May 23 10:32:01 2006
  • List-id: SCTP Discussions <discussion.sctp.de>

On Monday 22 May 2006 02:33, Julio Kriger wrote:
> Hi!
> I have program that launch 4 threads, each thread open a SCTP connection to
> another PC. And a weird bug present (actually is a segmentation fault).
> Here is some code;
>
> sctpInstance = SCTP_registerInstance(cp->sourcePort, inputStreams,
> outputStreams, noOfLocalAddresses, localAddressList, LLServerEchoUlp);
>
> //sleep(5);
>
> SCTP_associate(sctpInstance, outputStreams, destinationAddress,
> cp->destPort, clientParamIndex);
>
> If I don't put the "sleep", everyhing works good. But ...
>
> If I put the "sleep" for 10 seconds (on each thread) I get a core dump:

This looks like a thread-safety problem. Check whether your mutex locking is
okay. That is, do you call sctp_extendedEventLoop() with the correct locking
functions and do you obtain the mutex before you call any sctplib function?

The best recommendation when using multiple threads is to use the socket API
library. Unlike the sctplib, the socket API library is thread-safe. For
further details on how to get your sctplib programs thread-safe, you can also
have a look into the socket API sources, especially sctpsocketmaster.cc.


Best regards
--
=======================================================================
Dipl.-Inform. Thomas Dreibholz

University of Essen, Room ES210
Inst. for Experimental Mathematics Ellernstraße 29
Computer Networking Technology Group D-45326 Essen/Germany
-----------------------------------------------------------------------
E-Mail:
dreibh AT exp-math.uni-essen.de
Homepage: http://www.exp-math.uni-essen.de/~dreibh
=======================================================================

Attachment: pgp1dzn9OusDY.pgp
Description: PGP signature




Archive powered by MHonArc 2.6.19+.

Top of page