SCTP Discussions

Text archives Help


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


Chronological Thread 
  • From: Michael Tuexen <Michael.Tuexen AT micmac.franken.de>
  • To: Julio Kriger <juliokriger AT gmail.com>
  • Cc: discussion AT sctp.de
  • Subject: Re: [SCTP-Discussion] a weird bug (segmentation fault)
  • Date: Mon May 22 21:02:05 2006
  • List-id: SCTP Discussions <discussion.sctp.de>

Hi Julio,

you have to make sure that only one thread uses the sctplib at a given time.
The socketapi provides this for you... So the simplest way is to use it.

Best regards
Michael

On May 22, 2006, at 8:44 PM, Julio Kriger wrote:

Hi Michael!
I don't undestand... where (or when) should I do locking?
I attach the sample app. It's based en echo_tool.c
I don't do anything complicated. Just launch 4 threads and start sending packages to another pc, which have the same app that launch 4 threads.
should I use the sockeapi to be thread safe ?
Regards,
Julio

On 5/22/06, Michael Tuexen < Michael.Tuexen AT micmac.franken.de> wrote:Hi Julio,

the sctplib is NOT thread safe. So do you do the necessary locking?

Best regards
Michael

On May 22, 2006, at 2:33 AM, 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:
>
> (gdb) down
> #0 0xb7ef8c82 in scu_associate (noOfOutStreams=1, noOfInStreams=1,
> destinationList=0x1, numDestAddresses=1, withPRSCTP=1) at SCTP-
> control.c:399
> (gdb) Quit
> (gdb) Quit
> (gdb)
>
> Does anyone has an idea why this happens? I'm working with version
> 1.0.3. Ths bug if fixed on 1.0.4 ?
>
> Regards,
> Julio
>
> --
> --
> Stewie: [After Lois tries to feed Stewie his broccoli "airplane
> style"] Damn you, Damn the Broccoli, and Damn the Wright Brothers.
> ----------------------------
> Julio Kriger
> mailto:
juliokriger AT gmail.com




--
--
Stewie: [After Lois tries to feed Stewie his broccoli "airplane style"] Damn you, Damn the Broccoli, and Damn the Wright Brothers.
----------------------------
Julio Kriger
mailto:juliokriger AT gmail.com
<echo_tool2.c>





Archive powered by MHonArc 2.6.19+.

Top of page