Bug 69363 - SYNC extension segfault creating Fence object on screen 1
Summary: SYNC extension segfault creating Fence object on screen 1
Status: RESOLVED MOVED
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/General (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: medium normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-14 23:51 UTC by Kevin Ryde
Modified: 2018-12-13 22:11 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
program provoking server segfault (975 bytes, text/plain)
2013-09-14 23:51 UTC, Kevin Ryde
no flags Details

Description Kevin Ryde 2013-09-14 23:51:16 UTC
Created attachment 85838 [details]
program provoking server segfault

With recent debian i386 xvfb test server 1.12.4, in the SYNC extension 3.1 a CreateFence on screen number 1 causes the server to segfault.

For example the program foo.c below

  cc foo.c -lXext -lX11 -o foo

run as

  xvfb-run --auto-servernum --server-args="-screen 0 640x480x24 -screen 1 640x480x24" -e /dev/stdout ./foo

prints

Backtrace:
0: Xvfb (xorg_backtrace+0x49) [0xb7696779]
1: Xvfb (0xb753a000+0x1603c4) [0xb769a3c4]
2: linux-gate.so.1 (__kernel_rt_sigreturn+0x0) [0xb7518410]

Segmentation fault at address (nil)

Fatal server error:
Caught signal 11 (Segmentation fault). Server aborting


gdb sbows

#0  0x00000000 in ?? ()
#1  0xb769e049 in miSyncInitFence ()
#2  0xb7636192 in ?? ()
#3  0xb76fca25 in ?? ()
#4  0xb76133ea in ?? ()
#5  0xb7248585 in __libc_start_main () from /lib/i386-linux-gnu/libc.so.6
#6  0xb7613749 in _start ()

I don't have a good debug setup but it appears to be the indirect call in miSyncInitFence() having NULL as destination

    pScreenPriv->funcs.CreateFence(pScreen, pFence, initially_triggered);


Nosing around miext/sync/misync.c, I wonder if the bit of miSyncSetup(),

    if (dixPrivateKeyRegistered(syncScreenPrivateKey))
	return TRUE;

causes it to return immediately for the init of the second and subsequent screens and therefore not set pScreenPriv->funcs on screen 1.  Is it supposed to be a "register if not already registered" of the key but setup pScreenPriv for each screen?

If that's so then I would expect this segfault running foo.c on screen 1 and higher of any server, not just xvfb.
Comment 1 GitLab Migration User 2018-12-13 22:11:53 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xorg/xserver/issues/322.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.