Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

What does this tk X Error mean?

970 views
Skip to first unread message

Mike Mogridge

unread,
Apr 5, 1993, 12:06:46 PM4/5/93
to
G'day,
a few people I've distributed a Tk application to have experienced the
following problem leading to application termination:

X Error of failed request: BadAlloc (insufficient resources for operation)
Major opcode of failed request: 53 (X_CreatePixmap)
Serial number of failed request: 314
Current serial number in output stream: 448

What's going on? Is this a tk problem, a problem with my appplication or a
problem on the user's end of things? Any ideas on how it can be solved?
What tk command(s) would generate the X_CreatePixmap requests?
Thanks,
Mike
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Mike Mogridge | "Just once I wish we could encounter an <
> Bell-Northern Research Ltd. | alien menace that wasn't immune to bullets."<
> P.O. Box 3511 Station C | -The Brigadier, Doctor Who. <
> Ottawa, ONT, Canada K1Y 4H7 | INTERNET: m...@bnr.ca <
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

John Ousterhout

unread,
Apr 5, 1993, 4:30:35 PM4/5/93
to

I'm not sure if this is the problem or not, but it's possible to run out
of pixmaps if you have a long-running Tk application. Tk allocates new
pixmaps for each redisplay of most widgets, then frees them at the end of
the redisplay. Unfortunately, Xlib is not able to re-use resource
identifier space, so when it reaches the end of the space (something like
256k resource ids, shared among windows, pixmaps, etc.) it dies. It looks
to me like this is what's happening to your users. I've complained about
this to the X authorities, since it's really an X bug, and I was told that
this is a known problem but one that will probably not be fixed anytime
soon.

David Gorgen

unread,
Apr 6, 1993, 10:13:42 AM4/6/93
to

John, you describe a valid Xlib problem but I don't believe it explains
Mike's trouble. His BadAlloc comes at only request number 314 in the X
protocol stream; I don't see how you could run out of 256K resource ids
in so short a session.

Mike's message seems to indicate, not exhaustion of resource id's in
Xlib, but actual insufficient Pixmap memory in the X server. Getting
at why this happened involves knowing how the particular X server
allocates Pixmaps. A workstation X server may put them in virtual
memory or in extra graphics video memory; if the latter, they may or
may not be virtualized by use of main memory as secondary storage. X
servers that put Pixmaps in frame buffer memory may have additional,
separate limits on the x and y dimensions of Pixmaps which cause
allocation failures if exceeded, even when the required amount of
memory is available. A server in an X terminal usually has a brick
wall at the end of its complement of memory, which has to contain
Pixmaps and all other resources too.

The server's pool of Pixmap memory serves all its clients, of course,
so you have to consider not only the Pixmap allocation behavior of the
Tk application in question, but also of all the other clients running
on the same server.

After picking the clients you suspect of using up the Pixmaps, I would
suggest either grep'ping source code for XCreatePixmap... and
XFreePixmap calls (as well as use of toolkit routines which themselves
make these calls, of course), or using an X protocol monitor such as
xscope or xmon to look at patterns of CreatePixmap/FreePixmap protocol
requests.

Mike, you have some digging to do here, but I hope this helps you get
started.
--
===============================================================================
Dave Gorgen Internet: gor...@ann-arbor.applicon.slb.com
Applicon Inc. gor...@aaaca1.sinet.slb.com
Ann Arbor, Michigan (USA) UUCP: ...!uunet!sharkey!applga!gorgen

Mike Mogridge

unread,
Apr 6, 1993, 11:10:26 AM4/6/93
to
In article <1pq4tb$k...@agate.berkeley.edu>, ous...@sprite.Berkeley.EDU (John Ousterhout) writes:
> In article <1993Apr5.1...@bmerh85.bnr.ca>, m...@bmerh504.bnr.ca (Mike Mogridge) writes:
> |> G'day,
> |> a few people I've distributed a Tk application to have experienced the
> |> following problem leading to application termination:
> |>
> |> X Error of failed request: BadAlloc (insufficient resources for operation)
> |> Major opcode of failed request: 53 (X_CreatePixmap)
> |> Serial number of failed request: 314
> |> Current serial number in output stream: 448
> |>
> |> What's going on? Is this a tk problem, a problem with my appplication or a
> |> problem on the user's end of things? Any ideas on how it can be solved?
> |> What tk command(s) would generate the X_CreatePixmap requests?
> |> Thanks,
> |> Mike
> |> --
> |>
>
> I'm not sure if this is the problem or not, but it's possible to run out
> of pixmaps if you have a long-running Tk application. Tk allocates new
> pixmaps for each redisplay of most widgets, then frees them at the end of
> the redisplay. Unfortunately, Xlib is not able to re-use resource
> identifier space, so when it reaches the end of the space (something like
> 256k resource ids, shared among windows, pixmaps, etc.) it dies. It looks
> to me like this is what's happening to your users. I've complained about
> this to the X authorities, since it's really an X bug, and I was told that
> this is a known problem but one that will probably not be fixed anytime
> soon.

John,
your explanation seems to be spot on! I've just been informed that some of
the users are leaving the application running all week which would be in line
with the long-running tk application scenario you've suggested.
Thanks,
Mike.

0 new messages