Force SDL to create a segfault

Hi all,

i have a problem that my game sometimes crashes with:

X Error of failed request: BadValue (integer parameter out of range for
operation)
Major opcode of failed request: 149 (MIT-SHM)
Minor opcode of failed request: 3 (X_ShmPutImage)
Value in failed request: 0xffff
Serial number of failed request: 19134
Current serial number in output stream: 19135

and i would like to get the game just crashing with a segfault because
then i can trace back where the game crashed.

maybe someone know what i mean with this…
bye bye
Steffen–

Steffen Pohle (@Steffen_Pohle)| _ x
http://stpohle.bei.t-online.de | /#/ BomberClone - The Clone of
JabberID: stpohle at amessage.de ||###| DynaBlaster and Bomberman
ICQ: 370965 Yahoo: stpohle | #/ http://www.bomberclone.de
MSN: stpohle at hotmail.com |

Hi all,

i have a problem that my game sometimes crashes with:

X Error of failed request: BadValue (integer parameter out of range for
operation)
Major opcode of failed request: 149 (MIT-SHM)
Minor opcode of failed request: 3 (X_ShmPutImage)
Value in failed request: 0xffff
Serial number of failed request: 19134
Current serial number in output stream: 19135

You need to clip the rectangles that you pass into SDL_UpdateRects()
SDL_BlitSurface does clip the rectangles, and you can pass the resulting
rectangles directly to SDL_UpdateRects(), however if you do things yourself,
you’ll need to do your own clipping.

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

Hi all,

i have a problem that my game sometimes crashes with:

X Error of failed request: BadValue (integer parameter out of range
for operation)
Major opcode of failed request: 149 (MIT-SHM)
Minor opcode of failed request: 3 (X_ShmPutImage)
Value in failed request: 0xffff
Serial number of failed request: 19134
Current serial number in output stream: 19135

You need to clip the rectangles that you pass into SDL_UpdateRects()
SDL_BlitSurface does clip the rectangles, and you can pass the
resulting rectangles directly to SDL_UpdateRects(), however if you do
things yourself, you’ll need to do your own clipping.

Yep,

I found already where i did something wrong. But this was more a general
question because i’ve got this error serval times and it would be a
faster way if i can just tell the GDB that he have to stop and then i
can use backtrace to locate faster the problem.

bye bye
SteffenOn Sun, 23 May 2004 14:58:11 -0700 Sam Lantinga wrote:

Steffen Pohle (@Steffen_Pohle)| _ x
http://stpohle.bei.t-online.de | /#/ BomberClone - The Clone of
JabberID: stpohle at amessage.de ||###| DynaBlaster and Bomberman
ICQ: 370965 Yahoo: stpohle | #/ http://www.bomberclone.de
MSN: stpohle at hotmail.com |

Try the ‘break’ command of the gdb:


break test.cpp:8
run

… will stop execution at row 8 of test.cpp. Then you may
’step’ and ‘display’ or ‘print’ stuff that is interesting.
Use ‘help step’ etc. for more info…

/Olof

Steffen Pohle: “Re: [SDL] force SDL to create a segfault” (2004-05-24…

#On Sun, 23 May 2004 14:58:11 -0700
#Sam Lantinga wrote:#
#>
#> > Hi all,
#>
#> > i have a problem that my game sometimes crashes with:
#>
#> > X Error of failed request: BadValue (integer parameter out of range
#> > for operation)
#> > Major opcode of failed request: 149 (MIT-SHM)
#> > Minor opcode of failed request: 3 (X_ShmPutImage)
#> > Value in failed request: 0xffff
#> > Serial number of failed request: 19134
#> > Current serial number in output stream: 19135
#>
#> You need to clip the rectangles that you pass into SDL_UpdateRects()
#> SDL_BlitSurface does clip the rectangles, and you can pass the
#> resulting rectangles directly to SDL_UpdateRects(), however if you do
#> things yourself, you’ll need to do your own clipping.

#Yep,

#I found already where i did something wrong. But this was more a general
#question because i’ve got this error serval times and it would be a
#faster way if i can just tell the GDB that he have to stop and then i
#can use backtrace to locate faster the problem.

#bye bye
#Steffen

you may be looking for the SDL_INIT_NOPARACHUTE flag, used here:

SDL_Init ( SDL_INIT_VIDEO | SDL_INIT_TIMER | SDL_INIT_NOPARACHUTE);

cheers,
John.On Monday 24 May 2004 00:53, Olof Bjarnason wrote:

Try the ‘break’ command of the gdb:


break test.cpp:8
run

… will stop execution at row 8 of test.cpp. Then you may
’step’ and ‘display’ or ‘print’ stuff that is interesting.
Use ‘help step’ etc. for more info…

/Olof

Steffen Pohle: “Re: [SDL] force SDL to create a segfault” (2004-05-24…

#On Sun, 23 May 2004 14:58:11 -0700
#Sam Lantinga wrote:

#>
#> > Hi all,
#>
#> > i have a problem that my game sometimes crashes with:
#>
#> > X Error of failed request: BadValue (integer parameter out of range
#> > for operation)
#> > Major opcode of failed request: 149 (MIT-SHM)
#> > Minor opcode of failed request: 3 (X_ShmPutImage)
#> > Value in failed request: 0xffff
#> > Serial number of failed request: 19134
#> > Current serial number in output stream: 19135
#>
#> You need to clip the rectangles that you pass into SDL_UpdateRects()
#> SDL_BlitSurface does clip the rectangles, and you can pass the
#> resulting rectangles directly to SDL_UpdateRects(), however if you do
#> things yourself, you’ll need to do your own clipping.

#Yep,

#I found already where i did something wrong. But this was more a general
#question because i’ve got this error serval times and it would be a
#faster way if i can just tell the GDB that he have to stop and then i
#can use backtrace to locate faster the problem.

#bye bye
#Steffen


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

(Quotes fixed–replies go below quotes.)On Mon, May 24, 2004 at 03:05:05AM +0100, John Popplewell wrote:

#> > i have a problem that my game sometimes crashes with:
#>
#> > X Error of failed request: BadValue (integer parameter out of range
#> > for operation)
#> > Major opcode of failed request: 149 (MIT-SHM)
#> > Minor opcode of failed request: 3 (X_ShmPutImage)
#> > Value in failed request: 0xffff
#> > Serial number of failed request: 19134
#> > Current serial number in output stream: 19135

Try the ‘break’ command of the gdb:

you may be looking for the SDL_INIT_NOPARACHUTE flag, used here:

SDL_Init ( SDL_INIT_VIDEO | SDL_INIT_TIMER | SDL_INIT_NOPARACHUTE);

None of these are related to X errors. If you want to catch those, try:

static XErrorHandler OldHandler = NULL;
static int XErrorCallback(Display *dpy, XErrorEvent *error)
{
char str[1024];
XGetErrorText(dpy, error->error_code, str, sizeof(str) );
printf("%s\n", str);

...
return (*OldHandler)(dpy, error);

}


OldHandler = XSetErrorHandler(XErrorCallback);

Call this after initializing X (eg. after SDL video init). You can then
place a breakpoint on XErrorCallback.

(Bear in mind that not all errors are fatal; SDL installs an error handler
that ignores a few.)


Glenn Maynard