Find the answer to your Linux question:
Results 1 to 3 of 3
Howdy all. I'm writing a program with Gtk, and I'm getting an error that I don't understand. My program essentially displays images. That worked. So my image-viewing code works (I ...
  1. #1
    Trusted Penguin Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,230

    Debugging X errors in Gtk

    Howdy all. I'm writing a program with Gtk, and I'm getting an error that I don't understand.

    My program essentially displays images. That worked. So my image-viewing code works (I am using the same images, and I have not touched that code).

    I have recently attempted to add a text bar across the top that displays the path of the current image. In doing so, I added a vbox and an entry. This seems to have ruined everything.

    When I run the program now, just after gtk_main() is called, my program quits and gives the following X error:
    Code:
    The program 'a.out' received an X Window System error.
    This probably reflects a bug in the program.
    The error was 'BadDrawable (invalid Pixmap or Window parameter)'.
      (Details: serial 319 error_code 9 request_code 72 minor_code 0)
      (Note to programmers: normally, X errors are reported asynchronously;
       that is, you will receive the error a while after causing it.
       To debug your program, run it with the --sync command line
       option to change this behavior. You can then get a meaningful
       backtrace from your debugger if you break on the gdk_x_error() function.)
    When I run my program in gdb, I get this error:
    Code:
    The program 'a.out' received an X Window System error.
    This probably reflects a bug in the program.
    The error was 'BadAlloc (insufficient resources for operation)'.
      (Details: serial 332 error_code 11 request_code 53 minor_code 0)
      (Note to programmers: normally, X errors are reported asynchronously;
       that is, you will receive the error a while after causing it.
       To debug your program, run it with the --sync command line
       option to change this behavior. You can then get a meaningful
       backtrace from your debugger if you break on the gdk_x_error() function.)
    Aside from the fact that these are different errors, they offer no help whatsoever. Also note that in the gdb one, I set _Xdebug = 1, which according to a guide, should give me synchronous reporting of X errors.

    Does anyone have any experience in dealing with these errors before? I can certainly provide code if that would help.
    DISTRO=Arch
    Registered Linux User #388732

  2. #2
    Linux Engineer Javasnob's Avatar
    Join Date
    Jul 2005
    Location
    Wisconsin
    Posts
    942
    The dreaded X error code...I've seen my share of those. If you feel like it, you can send your code to me at hoelz@wisc.edu and I'll get to it probably some time today. The problem is probably that you're drawing on a Window or Pixmap that doesn't exist.
    Flies of a particular kind, i.e. time-flies, are fond of an arrow.

    Registered Linux User #408794

  3. #3
    Trusted Penguin Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,230
    Thanks a bunch for the offer! It is happily bundled and on its way to you.
    DISTRO=Arch
    Registered Linux User #388732

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...