|
Home > Archive > Unix Programming > March 2004 > qt3 "async reply" problem
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
qt3 "async reply" problem
|
|
| Darko M. 2004-03-19, 11:36 am |
| I have this problem of unexpected error messages while the compiler
reports nothing during compilation. For an example, a function does
fork(), the parent wait()s for the child, and the child does execlp()
for an external program which doesn't actualy exist. When execlp
therefore fails, it returns (doesn't "become" another programs body),
and the function then does exit( 1 ) in the child. The parent gets
notified of this, reads exit status (1), and reports an error message.
The program then goes back to it's main loop. This should work fine,
and it is just an example of a situation when things go wrong; and it
does work fine for me on Linux Mandrake 9.0, Qt 3.1, but it reports
these error messages on Linux 2.4.24, Qt 3.2.1:
X Error: BadIDChoice (invalid resource ID chosen for this connection)
14
Major opcode: 1
Minor opcode: 0
Resource id: 0x40090b
X Error: BadIDChoice (invalid resource ID chosen for this connection)
14
Major opcode: 1
Minor opcode: 0
Resource id: 0x40090c
X Error: BadIDChoice (invalid resource ID chosen for this connection)
14
Major opcode: 1
Minor opcode: 0
Resource id: 0x40090d
X Error: BadIDChoice (invalid resource ID chosen for this connection)
14
Major opcode: 1
Minor opcode: 0
Resource id: 0x40090e
X Error: BadIDChoice (invalid resource ID chosen for this connection)
14
Major opcode: 53
Minor opcode: 0
Resource id: 0x40090f
X Error: BadIDChoice (invalid resource ID chosen for this connection)
14
Major opcode: 53
Minor opcode: 0
Resource id: 0x400910
Xlib: unexpected async reply (sequence 0x5529)!
Xlib: unexpected async reply (sequence 0x552a)!
Is this something I should ignore, or is it something I can improve?
Thanks in advance.
| |
| Erwin S. Andreasen 2004-03-19, 2:35 pm |
| mdanko@tesla.rcub.bg.ac.yu (Darko M.) writes:
> a function does
> fork(), the parent wait()s for the child, and the child does execlp()
> for an external program which doesn't actualy exist. When execlp
> therefore fails, it returns (doesn't "become" another programs body),
> and the function then does exit( 1 ) in the child.
[...]
> Xlib: unexpected async reply (sequence 0x5529)!
> Xlib: unexpected async reply (sequence 0x552a)!
Never use exit() at that point, but instead _exit. exit will cause
open streams to be flushed, atexit handlers to run and most
importantly , the destructors of static-duration objects to run.
In your case, it sounds like this causes QT to execute some X calls
which is obviously bad when the two processes share the same X connection.
You should probably be using QProcess instead of messing with
fork+exec anyway.
--
========================================
=======================
<erwin@andreasen.org> Herlev, Denmark
<URL:http://www.andreasen.org/> <*>
========================================
=======================
|
|
|
|
|