Problems with newer toolchains

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
goumba
Posts: 7
Joined: Thu Nov 20, 2008 8:59 am

Problems with newer toolchains

Post by goumba »

Hi,

I've been working on this game for a while now:

http://forums.qj.net/showthread.php?t=1 ... ght=sabacc

With the most recent toolchain (svn 2446), I can no longer build a version without it crashing on the PSP.

I get at varying points an error regarding the threaded malloc (mallocr).

I don't do anything with threads other than that needed for starting the app (and in fact the 1.50 version I let SDL set it up for me). A build for any firmware version crashes. The 1.50 version gives me the following in a psp-gdb backtrace:

#0 _malloc_r (reent_ptr=0x8c9cba8, bytes=<value optimized out>)
at ../../../../../newlib/libc/stdlib/mallocr.c:2376
#1 0x08a04a7c in SDL_AllocBlitMap () at SDL_pixels.c:521
#2 0x08a01f50 in SDL_CreateRGBSurface (flags=<value optimized out>, width=64,
height=64, depth=32, Rmask=255, Gmask=65280, Bmask=16711680,
Amask=4278190080) at SDL_surface.c:147
#3 0x08a28600 in IMG_LoadPNG_RW (src=0x90782e0) at IMG_png.c:219
#4 0x08a25484 in IMG_LoadTyped_RW (src=0x90782e0, freesrc=1, type=0x0)
at IMG.c:135

and

#0 _malloc_r (reent_ptr=0x8c9cba8, bytes=<value optimized out>)
at ../../../../../newlib/libc/stdlib/mallocr.c:2376
#1 0x089ba3a4 in FT_Alloc (memory=0x8c9cba8, size=147443656, P=0x88fea9c)
at /home/anthony/src/psplibraries/build/freetype/src/base/ftutil.c:59
#2 0x089bb090 in FT_Add_Module (library=0x9a12e10, clazz=0x8b08280)
at /home/anthony/src/psplibraries/build/freetype/src/base/ftobjs.c:2739
#3 0x089b5288 in FT_Add_Default_Modules (library=0x9a12e10)
at /home/anthony/src/psplibraries/build/freetype/src/base/ftinit.c:92
#4 0x089b5310 in FT_Init_FreeType (alibrary=0x903cc70)
at /home/anthony/src/psplibraries/build/freetype/src/base/ftinit.c:133

Neither of these involve my own code, and this is when the program first starts, with apparently sufficient free memory available. Each time the program is run, the error is from a different point, two examples shown above.

Any suggestions greatly appreciated,
Anthony
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

From that thread, it sounds like you've had issues with memory corruption from the start... malloc could certainly crash if its data structures get screwed up.
Post Reply