IMGlib problem

I’ve started to get segfaults in IMG_Load() from IMGlib. This started to
happen when I added loading more images. (approx. 18 more 256x128 images
over what I was loading before… about the 144th image currently loaded
in memory).

I’m calling it with this command:
im = IMG_Load(buf);
buf contains 46 character explicit path to “8x0.bmp”.

At this point, the processes is using about 20mb of RAM. It doesn’t
matter if I change the order of images loaded either, it still segfaults
on this exact number of images loaded.

I get the parachute message, but it usually just hangs, the program never
exits (probably in the SDL signal handler). It doesn’t hang in the
debugger, when gdb overrides the SDL signal handling.

----here is stack trace: -----

#0 0x401c94e1 in chunk_alloc (ar_ptr=0x4025e040, nb=16) at malloc.c:2699
#1 0x401c940a in __libc_malloc (bytes=8) at malloc.c:2643
#2 0x400d10a3 in SDL_AllocBlitMap () from /usr/lib/libSDL-1.0.so.0
#3 0x400d149a in SDL_CreateRGBSurface () from /usr/lib/libSDL-1.0.so.0
#4 0x400cecfe in SDL_LoadBMP_RW () from /usr/lib/libSDL-1.0.so.0
#5 0x4015c4ce in IMG_LoadBMP_RW (src=0x889a530) at IMG_bmp.c:52
#6 0x4015c41d in IMG_Load_RW (src=0x889a530, freesrc=1) at IMG.c:75
#7 0x8050066 in s_load_image (fname=0xbffff7f4 “twr/8x0”, type=1
’\001’, area_rnum=0) at utils.c:113
#8 0x804e689 in read_area (area_rnum=0) at db.c:595
#9 0x804faa1 in init_game (argc=1, argv=0xbffffb04) at init.c:187
#10 0x80496f1 in main (argc=1, argv=0xbffffb04) at main.c:41

It turns out I was doing something wrong with memory before that call.
I spoke too soon in the previous mail. Sorry to be a bother.–
Brian