Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
question about debugging X apps with --sync [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
mikegpitt
Advocate
Advocate


Joined: 22 May 2004
Posts: 3224

PostPosted: Mon Oct 06, 2008 3:32 pm    Post subject: question about debugging X apps with --sync [SOLVED] Reply with quote

I'm trying to track down a bug in an app I wrote. After it runs for a while I receive an error that looks like this:
Code:
The program 'myapp' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadIDChoice (invalid resource ID chosen for this connection)'.
  (Details: serial 765442671 error_code 14 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.)


I've been able to track the bug down to one argument in one line of my code, but it doesn't seem to make sense that multiple calls to this function would cause an X error.

The next logical debugging step is to actually do what they tell me to do in the error, but I'm confused on how to actually do this. I've been searching documentation trying to figure out where the --sync option should go, but haven't found anything.

My question, does --sync get passed to the X server, client, or my app itself? I know my app won't see the --sync, unless I need to build in a few hooks.

Any tips on debugging such an error?


Last edited by mikegpitt on Mon Oct 06, 2008 3:40 pm; edited 1 time in total
Back to top
View user's profile Send private message
mikegpitt
Advocate
Advocate


Joined: 22 May 2004
Posts: 3224

PostPosted: Mon Oct 06, 2008 3:40 pm    Post subject: Reply with quote

I may have just figured out what to do... I was searching for the wrong thing. It looks like --sync is a GTK option that all GTK apps can see. This page has more info:

http://library.gnome.org/devel/gtk-tutorial/stable/c39.html
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum