X error: BadValue from XCreateColormap

Hi,

I get the following error message in any SDL program:

X Error of failed request: BadValue (integer parameter out of range for
operation)
Major opcode of failed request: 78 (X_CreateColormap)
Value in failed request: 0x0
Serial number of failed request: 23
Current serial number in output stream: 24

I can’t figure out what is causing this – it seems that BadValue can be
set if the last parameter of XCreateColormap() (int alloc) is not
AllocNone or AllocAll, but it definitely is one of those two values!

Does anybody have any idea what could be causing this? Failing that,
does anybody have any pointers to where I would look in X to figure out
what’s causing the error?

By the way, this is a 64-bit platform (Pentium D) with a 64-bit Linux
kernel etc.

Many thanks, and bye for now,–
Laurence Withers http://www.lwithers.me.uk/
mailto:@Laurence_Withers tel:+447753988197 jabber:l.withers at jabber.org

Are you using more than one thread?

ChrisOn 5/27/06, Laurence Withers wrote:

Hi,

I get the following error message in any SDL program:

X Error of failed request: BadValue (integer parameter out of range for
operation)
Major opcode of failed request: 78 (X_CreateColormap)
Value in failed request: 0x0
Serial number of failed request: 23
Current serial number in output stream: 24


E-Mail: Chris Nystrom <@Chris_Nystrom>
http://www.newio.org/
AIM: nystromchris

Hi Chris,

No, there is only a single thread (I verified this with strace). This
happens even with the programs in the ‘test’ subdirectory of the SDL
source. This doesn’t seem to happen with those tests that don’t call
SDL_Init(SDL_INIT_VIDEO) – e.g. testtimer (and also testsem) works
perfectly.

Bye for now,On Saturday 27 May 2006 14:19, Chris Nystrom wrote:

Are you using more than one thread?


Laurence Withers http://www.lwithers.me.uk/
mailto:@Laurence_Withers tel:+447753988197 jabber:l.withers at jabber.org

OK, having dug into this a little deeper, I discovered what I believe is
a bug in the X server where it would actually return BadValue instead
of BadMatch. So the error should actually have been BadMatch.

It seems that this occurs if the visual in the XCreateColormap() call is
of a different class than that of the window – and I think SDL is
using a DirectColor visual whereas my root window is TrueColor. But
even when I hacked add_visual() in SDL_x11modes.c to skip anything that
wasn’t TrueColor, I still got the failed request (albeit from a
different call to XCreateColormap in SDL_x11video.c).

Unfortunately my knowledge of X is pretty limited and I can’t figure out
what’s really going wrong here. Interestingly, the allegro library
displays a very similar problem.

So, does anybody have any suggestions about what I do next? :slight_smile:

Bye for now,On Saturday 27 May 2006 13:38, Laurence Withers wrote:

X Error of failed request: BadValue (integer parameter out of range
for operation)
Major opcode of failed request: 78 (X_CreateColormap)
Value in failed request: 0x0
Serial number of failed request: 23
Current serial number in output stream: 24


Laurence Withers http://www.lwithers.me.uk/
mailto:@Laurence_Withers tel:+447753988197 jabber:l.withers at jabber.org