Guyfawkes Sdl Libs With Stella, Crashing With *** Glibc Detected *** F


zansatsu

Certified Guru
Joined
Dec 28, 2005
Messages
121
Location
Atlanta, GA USA
Website
stella.sourceforge.net
Hey guys,

I just recently changed my SDL libs to take advantage of the scalar capability of the new SDL libs (Guyfawkes). Stella compiles and runs, but when I switch between the launcher menu and emulation mode (and vice versa) I get a crash with the following error:

Code:
*** glibc detected *** free(): invalid pointer: 0x003610f0 ***
Aborted

I've also seen:

Code:
*** glibc detected *** malloc(): memory corruption: 0x00375720 ***
Aborted

Any ideas what leads to these kinds of errors? The UI draws directly into the FrameBuffer's surface. Could this be a conflict between the SDL layer and Stella?

Edited for clarity.
 
Ok, after a couple of code changes, we are no longer getting the glibc errors, instead we see SDL type errors.

Code:
--Entering emulation mode.--
SDL_GP2X: ListModes
SDL_GP2X: Setting video mode 320x240 16 bpp, flags=10000000
SDL_GP2X: FreeHWSurfaces
SDL_GP2X: Freeing bucket 0x366a58 (size 0)
SDL_GP2X: InitHWSurfaces 0x40066800, 5085184
SDL_GP2X: Screen bucket 0x35c14c
SDL_GP2X: First free bucket 0x35a978 (size = 5085184)
SDL_GP2X: Creating cursor 16x16
SDL_GP2X: Allocated WMcursor @ 0x35b7f0 (32)
SDL_GP2X: SurfaceManager allocating 256 bytes

--Leaving emulation, entering launcher.--
SDL_GP2X: SurfaceManager adding new free bucket of 5084928 bytes @ 0x35cdd0
SDL_GP2X: SurfaceManager allocated 256 bytes at 0x40066800

--Re-entering emulation.--
SDL_GP2X: ListModes
SDL_GP2X: Setting video mode 320x195 16 bpp, flags=10000000
SDL_GP2X: FreeHWSurfaces
SDL_GP2X: Freeing bucket 0x35a978 (size 256)
SDL_GP2X: Freeing bucket 0x35cdd0 (size 5084928)
SDL_GP2X: InitHWSurfaces 0x4005f780, 5113984
SDL_GP2X: Screen bucket 0x35c14c
SDL_GP2X: First free bucket 0x35a978 (size = 5113984)
SDL_GP2X: Freeing cursor 0x35b7f0
SDL_GP2X: SurfaceManager freeing 5113984 bytes @ 0x4005f780 from bucket 0x35a978
SDL_GP2X: Creating cursor 16x16
SDL_GP2X: Allocated WMcursor @ 0x35a948 (32)
SDL_GP2X: SurfaceManager allocating 256 bytes

--Leaving Emulation.--
SDL_GP2X: SurfaceManager adding new free bucket of 5113728 bytes @ 0x35a9a8
SDL_GP2X: SurfaceManager allocated 256 bytes at 0x4005f780

--Then the crash (the output appears corrupted).--
pSDL_GP2X: ListMo_GP2X: S etting v: ideo mode 320x24[0 16 bpp<0, flags=100000000
SDL_GP172X: Free6HWSurfacdes
SDL_GP2X: Fr4eeing bu0>cket 0x35a978 (s]ize 256)
SDL_GP 2X: Free ing buck et 0x35al9a8 (sizre 511372 8)
SDL_:GP2X: In [itHWSurfaces 0x4<0066800,00 5085184
SDL_GP12X: Scre7en bucke6t 0x35c1d24c
SDL_GP2X: Fic>rst free bucket ]0x35a9a8  (size =   5085184)
SDL_G P2X: FreNoeing cursor 0x35ta948
SD tL_GP2X: SurfaceMaanager fireeing 2nt56 bytes @ 0x400e5f780 frdom bucke
t 0x35a978
SDL_sGP2X: mep rging with next :bucket ( 0x35a9a8b) makingf 5085440ff bytes
 SDL_GP2X: Creati5ng curso28r 16x16
 SDL_GP2X: Alloc ated WMcipursor @  0x35a948 (32)
S: DL_GP2X: SurfacebManager ffallocating 256 bfytes
ceec  fp : 00000100
r10: 00269f78  r9 : 00000364  r8 : 002c788c
r7 : 0035c0d8  r6 : 00000100  r5 : fffff780  r4 : 00000019
r3 : 004d9900  r2 : 00000000  r1 : 00000000  r0 : 0000002e
Flags: nzCv  IRQs on  FIQs on  Mode USER_32  Segment user
Control: C000317F  Table: 018FC000  DAC: 00000015
Fatal signal: Segmentation Faultpc (SDL Parachute  :Deployed)
SDL_G P2X: Vid[eoQuit
<SDL_GP2X0: FreeHW0Surfaces1
SDL_GP82X: Free29ing buckdet 0x35a9a8 (siz4e 508518>4)
SDL_]GP2X: Fr  eeing bucket 0x3 5a970 (s lize 3520r272)
 : [<001b22c8>]	Not tainted
sp : bffff3ec  ip : bfffcdc8  fp : 00000100
r10: 00269f78  r9 : 004d9900  r8 : 0035be98
r7 : 00000364  r6 : fffd73fc  r5 : 00000000  r4 : 0035a970
r3 : 001829d0  r2 : 00003035  r1 : 00177214  r0 : 00000000
Flags: nzCv  IRQs on  FIQs on  Mode USER_32  Segment user
Control: C000317F  Table: 018FC000  DAC: 00000015
Segmentation fault

Anyone have any clues on this one? It's odd how the output appears to become corrupted as well. When creating SDL surfaces is there a specific GP2X procedure that facilitates this? Or is standard SDL implementation acceptable?
 
Ok, I fixed everything above by basically compiling paeryns libs from scratch and adding them to theoddbots. I think the Guyfawkes toolchain was compiled under Windows and wasn't compatible with my compiler. All is well.

EDIT: As a side note, the above problem occurs if I compile Oopo's toolchain from scratch, which stands to reason as the Guyfawkes toolchain is based on Oopo's.
 
Back
Top