Begin forwarded message:

From: [EMAIL PROTECTED]
Date: Sat Jul 19, 2003  5:17:39  PM US/Eastern
To: [EMAIL PROTECTED]
Subject: TuxPaint OSX build

Hi.  You're credited on the New Breed Software site with contributing
the TuxPaint build for OSX, so I thought I'd ask you first - under
10.2.6/6L60, most things I tried seemed to work, but "open" crashes
with a bad_access:

Exception:  EXC_BAD_ACCESS (0x0001)
Codes:      KERN_INVALID_ADDRESS (0x0001) at 0xbff745d0

Thread 0 Crashed:
 #0   0x00012684 in do_open (crt.c:300)
 #1   0x0000650c in mainloop (crt.c:300)
 #2   0x00005a88 in SDL_main (crt.c:300)

I looked in sourceforge CVS thinking to at least try a fresh build,
but although there's macosx_print.m and some __APPLE__ ifdefs in
tuxpaint.c, it didn't look like there was enough to actually build
the whole thing.  Suggestions?

Turns out, this is a nasty bug involving TuxPaint exceeding the 512KB stack limit that Mac OS X places on all applications.


To see how this works...

> cd path_to_tuxpaint
> cd Tux\ Paint.app/Contents/
> ./MacOS/Tux\ Paint

Now select "open" and it should crash...

The fix?

> unlimit
> cd path_to_tuxpaint
> cd Tux\ Paint.app/Contents/
> ./MacOS/Tux\ Paint

Now it will not crash since the unlimit command removed the 512KB stack size limit.

In summary, the do_open() function is using too much space on the stack. I can see two ways to fix this. One, don't use so much stack-allocated memory (malloc instead). Two, use setrlimit() to increase our stack limit.

Thoughts?

_______________________________________________
Tuxpaint-dev mailing list
[EMAIL PROTECTED]
http://tux4kids.net/mailman/listinfo/tuxpaint-dev

Reply via email to