A question about XOpenDisplay fail

Ma, Qingyu (GE Healthcare) Qingyu.Ma at ge.com
Tue Apr 27 23:50:50 PDT 2010

During my developing work, I meet a problem about XOpenDisplay. Could
you please give me some consult?
I'm developing a system, which uses fvwm as WM. Two fvwm are executed to
implement two separated screens. My process is displayed on one
screen(DISPLAY). It calls XOpenDisplay(NULL) to get one Display
connection to be used as display image, and another Display to be used
as toggle keyboard led (whenever keyboard led state is changed, a new
Display is opened and closed). The function is OK. But when I was doing
monkey and cycle test, there is a very very little possibility that my
process may crash. I looked through my code, and found a bug which was
that I didn't check the return value of XOpenDisplay, and use it
directly . I have checked that a NULL Display will cause process crash
in following code. It's just my analysis and guess, I'm not sure whether
it does be the root cause. And, by now, the cycle and monkey cannot
re-occur the issue.  
So, I want to get some information from you to help to reach the root
cause. What will cause XOpenDisplay return NULL? How can I simulate the
case?(When my process is executed, I'm sure the XWindow and fvwm have
been booted up.)
Thanks in advance!
Best Regards,
Ma Qingyu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.x.org/archives/xorg/attachments/20100428/8d9f9039/attachment.html>

More information about the xorg mailing list