[JDEV] jabberd 1.4.3 RC running under Cygwin (mio.c diff)

Frank Seesink frank at mail.wvnet.edu
Wed Nov 12 19:40:01 CST 2003

Frank Seesink wrote:

> More info regarding the segfault caused by using -D under Cygwin:

Well, in short, I found it!  Attached here please find the relevant
patch to ./jabberd/mio.c (basically one line of code to increase the Pth
thread stack size, wrapped in a #ifdef __CYGWIN__...that's IT!), along
with the full version of the file in case the patch is a goof.  With
this one change, Jabberd 1.4.3CVS now builds under Cygwin as it does
elsewhere, and works the same I believe, INCLUDING running in proper
debug mode!

Can't speak for anyone else, but just being able to tackle this problem,
let alone see it through to a solution and having the ability to
semi-grasp in what limited way I can what's going on is pretty darn
exciting.  Haven't done this in forever, let alone at this depth, and it
juices me! :-)

It's a bit late now, but tomorrow I'll write up in detail what all I
went through, just in case there are any new coders out there who wish
to keep Cygwin in mind when they're coding.  Honestly, it's quite robust
now, but there are just a few potential gotchas along the way...things
like no ability to change stack size via ulimit (but you can use an i386
PE-specific ld switch --stack and/or --heap to set the reserve size for
each in your app).

And the glitch in this case was actually a stack overflow issue WITHIN
GNU Pth, but likely due to the thread stack size not being large enough.
   I basically set a conditional so that under Cygwin the
PTH_ATTR_STACKSIZE was set to 128KB instead of the default 64KB, just
before calling pth_spawn() to generate a thread.  That's all it took.

It's possible this can be ratcheted down to 96KB (basically something <
128KB), but for now this should do.  Note I have not stress-tested this,
but if someone has a simple script/tool--that's easy to use--to beat
against a Jabber server, I'll be more than glad to give it a whack and
see what it can take.

Anyway, off to bed.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: jabberd143CVSdebug.diff
URL: <http://mail.jabber.org/pipermail/jdev/attachments/20031112/5bab137a/attachment-0002.txt>

More information about the JDev mailing list