Xorg segfaults on XOpenDisplay multi thread

Matan Drori matan at graphtech.co.il
Mon Dec 29 04:29:53 PST 2008

Hi Eirik,

Thank you for your replay,
We tried to use XInitThreads but it doesn't help us
because X crashes in XOpenDisplay and in order to use
XLockDisplay & XUnLockDisplay we need to have a display structure.

I will re-explain the problem.
We are using a machine that has 4 graphics pipes,
our X server is configured to manage all these 4 pipes,
and we have 4 different displays :0.0, :0.1, :0.2, :0.3

What we are trying to do ?
Run X server which manage all available pipes and then to
run a program with number of threads as the number of
managed pipes and to draw something to each pipe.

Currently we are calling XOpenDisplay in each thread,
when the returned display structure is private for each thread.

For example, we re-wrote the program and instead of using threads
we used 'fork' and created 4 processes (1 for each display)
in this case the program ran without any problems,
but when we are trying to use threads X crashes from XOpenDisplay.

Thank you,

Eirik Byrkjeflot Anonsen wrote:
> Matan Drori <matan at graphtech.co.il> writes:
>> Machine spec:
>> IA64
>> /SUSE Linux Enterprise Server/ 10 sp 2
>> xorg x11 6.9.0-50.58
>> I have a very simple test program that opens 4 threads and does
>> XOpenDisplay(opening 4 separate display objects).
>> i keep getting segfaults on different places in the function
>> seems like some kind timing problem that causes memory corruption.
> You have called XInitThreads?  (See "man XInitThreads")
> (I don't know how thread-safe xorg is.  I have the impression that
> there are some issues.  But without XInitThreads(), it isn't supposed
> to be thread-safe).
> eirik

Sagi Ben-Akiva - sagi at graphtech.co.il
GraphTech Computer Systems,

Tel: +972-9-9703334
Mob: +972-54-4970634

More information about the xorg mailing list