x11vnc able to segfault xorg

Bug #525066 reported by Brian J. Murrell
24
This bug affects 4 people
Affects Status Importance Assigned to Milestone
xorg-server (Ubuntu)
Fix Released
High
Bryce Harrington

Bug Description

Binary package hint: xorg

Lots of discussion over at: http://ubuntuforums.org/showthread.php?t=965695

But the gist of it is, x11vnc is able to segfault xorg. Quite simple to reproduce. Find a "victim" machine and boot it up to the gdm login prompt. Then ssh into the machine and run:

# DISPLAY=:0 x11vnc

(notice logged in as root) and then connect with a vnc client. Try to log in and very quickly the vnc connection will be closed and when you reconnect you will be at a new login prompt. That's because the last X11 server crashed. Check out /var/log/Xorg.0.log.old on the victim machine.

(gdb) attach 3038
...
0x00007f7652ee9485 in ?? () from /lib/libdrm_intel.so.1
(gdb) cont
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0x00007f765395b662 in RecordAReply (pcbl=0x7e29a0, nulldata=0x0, calldata=0x7fffc929a050) at ../../record/record.c:601
 in ../../record/record.c
(gdb)
(gdb) bt
#0 0x00007f765395b662 in RecordAReply (pcbl=0x7e29a0, nulldata=0x0, calldata=0x7fffc929a050) at ../../record/record.c:601
#1 0x000000000043191c in _CallCallbacks (pcbl=0x7e29a0, call_data=0x7fffc929a050) at ../../dix/dixutils.c:743
#2 CallCallbacks (pcbl=0x7e29a0, call_data=0x7fffc929a050) at ../../dix/dixutils.c:877
#3 0x0000000000460091 in WriteToClient (who=0x41c8270, count=60, __buf=0x3d0b838) at ../../os/io.c:800
#4 0x00007f765395a8d2 in RecordFlushReplyBuffer (pContext=0x3d0b810, data1=0x0, len1=0, data2=<value optimized out>, len2=<value optimized out>)
    at ../../record/record.c:251
#5 0x00007f765395a946 in RecordFlushAllContexts (pcbl=<value optimized out>, nulldata=<value optimized out>, calldata=<value optimized out>)
    at ../../record/record.c:867
#6 0x000000000043191c in _CallCallbacks (pcbl=0x7e29a8, call_data=0x0) at ../../dix/dixutils.c:743
#7 CallCallbacks (pcbl=0x7e29a8, call_data=0x0) at ../../dix/dixutils.c:877
#8 0x000000000045ffd4 in WriteToClient (who=0x41c8270, count=60, __buf=0x3d0b838) at ../../os/io.c:824
#9 0x00007f765395a8d2 in RecordFlushReplyBuffer (pContext=0x3d0b810, data1=0x0, len1=0, data2=<value optimized out>, len2=<value optimized out>)
    at ../../record/record.c:251
#10 0x00007f765395a946 in RecordFlushAllContexts (pcbl=<value optimized out>, nulldata=<value optimized out>, calldata=<value optimized out>)
    at ../../record/record.c:867
#11 0x000000000043191c in _CallCallbacks (pcbl=0x7e29a8, call_data=0x0) at ../../dix/dixutils.c:743
#12 CallCallbacks (pcbl=0x7e29a8, call_data=0x0) at ../../dix/dixutils.c:877
#13 0x000000000045ffd4 in WriteToClient (who=0x41c8270, count=60, __buf=0x3d0b838) at ../../os/io.c:824
#14 0x00007f765395a8d2 in RecordFlushReplyBuffer (pContext=0x3d0b810, data1=0x0, len1=0, data2=<value optimized out>, len2=<value optimized out>)
    at ../../record/record.c:251
[Repeats endlessly...]

ProblemType: Bug
Architecture: i386
Date: Sat Feb 20 17:09:35 2010
DistroRelease: Ubuntu 9.10
MachineType: To Be Filled By O.E.M. To Be Filled By O.E.M.
NonfreeKernelModules: nvidia
Package: xorg 1:7.4+3ubuntu10
ProcCmdLine: auto BOOT_IMAGE=ubuntu root=/dev/mapper/rootvol-ubuntu_root
ProcEnviron:
 LANG=en_CA.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-19.56-generic
RelatedPackageVersions:
 xserver-xorg 1:7.4+3ubuntu10
 libgl1-mesa-glx 7.6.0-1ubuntu4
 libdrm2 2.4.14-1ubuntu1
 xserver-xorg-video-intel 2:2.9.0-1ubuntu2.1
 xserver-xorg-video-ati 1:6.12.99+git20090929.7968e1fb-0ubuntu1
SourcePackage: xorg
Uname: Linux 2.6.31-19-generic i686
dmi.bios.date: 10/23/2003
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: 080009
dmi.board.name: P4P800S
dmi.board.vendor: ASUSTeK Computer Inc.
dmi.board.version: Rev 1.xx
dmi.chassis.asset.tag: Asset-1234567890
dmi.chassis.type: 3
dmi.chassis.vendor: Chassis Manufacture
dmi.chassis.version: Chassis Version
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvr080009:bd10/23/2003:svnToBeFilledByO.E.M.:pnToBeFilledByO.E.M.:pvrToBeFilledByO.E.M.:rvnASUSTeKComputerInc.:rnP4P800S:rvrRev1.xx:cvnChassisManufacture:ct3:cvrChassisVersion:
dmi.product.name: To Be Filled By O.E.M.
dmi.product.version: To Be Filled By O.E.M.
dmi.sys.vendor: To Be Filled By O.E.M.
fglrx: Not loaded
system:
 distro: Ubuntu
 architecture: i686kernel: 2.6.31-19-generic

Related branches

Revision history for this message
Brian J. Murrell (brian-interlinx) wrote :
Bryce Harrington (bryce)
affects: xorg (Ubuntu) → nvidia-graphics-drivers-180 (Ubuntu)
Revision history for this message
Brian J. Murrell (brian-interlinx) wrote :

Really? This is an nvidia specific crash? Can I ask how you came to that conclusion, just for my education, so that I can better diagnose failures in the future?

Bryce Harrington (bryce)
tags: added: karmic
Revision history for this message
Sheng Yang (yasker) wrote :

Can't believe it just affect nvidia card, because I am not using the nvidia card but intel ones.

affects: nvidia-graphics-drivers-180 (Ubuntu) → xorg (Ubuntu)
Revision history for this message
Sheng Yang (yasker) wrote :

I've suffered this since upgrade to 10.10. But I can't find the crash log on Xorg.0.log.old. Can anyone help to indicate where I can find some useful log for this issue?

Revision history for this message
Bryce Harrington (bryce) wrote :

Are you able to reproduce this issue easily? If so, please collect a full backtrace - see http://wiki.ubuntu.com/X/Backtracing for directions. If not, could you describe the conditions under which the crash tends to occur?

If this is an nvidia-specific crash, there may be nothing we can do at the distro level, depending on where exactly in the stack the segfault occurs. If you suspect it to not be nvidia-specific, please reproduce the crash under one of the open drivers (e.g. nouveau or intel) and collect a full backtrace there.

Changed in xorg (Ubuntu):
importance: Undecided → High
status: New → Incomplete
Revision history for this message
Sheng Yang (yasker) wrote :

I am using Intel Q965.

This issue can't be triggered very quickly on my machine. Normal I would work using vnc client connected to x11vnc for a while, then close vnc client. After about 1 minute, X would crash.

I've managed to reproduce it twice with gdb attached, here is log for the second time.

Bryce Harrington (bryce)
affects: xorg (Ubuntu) → xorg-server (Ubuntu)
Changed in xorg-server (Ubuntu):
status: Incomplete → Confirmed
Bryce Harrington (bryce)
Changed in xorg-server (Ubuntu):
status: Confirmed → Triaged
Revision history for this message
Sheng Yang (yasker) wrote :

This bug is still there. And seems I can triggered it through some other way days ago, e.g. open a big picture in the gwenview. But after the recent update, I can only trigger it by x11vnc, after using vnclient for a period of time.

Revision history for this message
Bryce Harrington (bryce) wrote :

Hi Sheng,

Thanks for providing the detailed backtrace. Looks like it's a stack overflow in the client callback code when the client disappeared. The leftover callback resulted in an endless loop.

description: updated
Changed in xorg-server (Ubuntu):
assignee: nobody → Bryce Harrington (bryce)
Revision history for this message
Bryce Harrington (bryce) wrote :

Think the next action here is to attempt reproducing it on natty, and then forward it upstream.

Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (5.5 KiB)

This bug was fixed in the package xorg-server - 2:1.10.0-0ubuntu1

---------------
xorg-server (2:1.10.0-0ubuntu1) natty; urgency=low

  * Update to new upstream final release.
    + Drop 16-construct-paths-in-doxygen.conf.diff; included in new upstream.
  * debian/patches/216_fix_sdksyms_build.diff:
    + Cherry-pick from 1.10 branch, fixing the stale sdksyms.c file picked up
      in the udeb build, causing the udeb build to fail with missing symbols.
  * Merge from unreleased Debian experimental. Remaining Ubuntu changes:
    - rules:
      + Disable SELinux, libaudit-dev is not in main yet. (LP #406226)
      + Enable xcsecurity. (LP #247537)
      + Add --with-extra-module-dir to support GL alternatives.
      + Mention Ubuntu support in builderstring rather than package uploader's
        email address.
    - control:
      + Xvfb depends on xauth, x11-xkb-utils. (LP #500102)
      + Add breaks for incompatible drivers. (LP #614993)
      + Drop libaudit-dev from build-deps.
      + Build-depend on newer mesa to pick up DRI search paths variable.
      + Bump dependency on x11proto-input-dev for Xi 2.1
      + Drop linux-any specifier to make pbuilder less narky.
      + Bump build-depends on mesa-common-dev to pick up dri.pc DRI search
        paths change for 214_glx_dri_searchdirs.patch
    - local/xvfb-run*: Add correct docs about error codes. (LP #328205)
    - debian/patches:
      + 100_rethrow_signals.patch:
        When aborting, re-raise signals for apport
      + 105_nvidia_fglrx_autodetect.patch:
        Load proprietary drivers automatically when installed.
      + 109_fix-swcursor-crash.patch:
        Avoid dereferencing null pointer while reloading cursors during
        resume. (LP #371405)
      + 111_armel-drv-fallbacks.patch:
        Add support for armel driver fallbacks.
      + 121_only_switch_vt_when_active.diff:
        Add a check to prevent the X server from changing the VT when killing
        GDM from the console.
      + 122_xext_fix_card32_overflow_in_xauth.patch:
        Fix server crash when “xauth generate” is called with large timeout.
      + 157_check_null_modes.patch, 162_null_crtc_in_rotation.patch,
        166_nullptr_xinerama_keyrepeat.patch, 167_nullptr_xisbread.patch
        172_cwgetbackingpicture_nullptr_check.patch:
        Fix various segfaults in xserver by checking pointers for NULL
        values before dereferencing them.
      + 165_man_xorg_conf_no_device_ident.patch
        Correct man page
      + 168_glibc_trace_to_stderr.patch:
        Report abort traces to stderr instead of terminal
      + 184_virtual_devices_autodetect.patch:
        Use vesa for qemu device, which is not supported by cirrus
      + 188_default_primary_to_first_busid.patch:
        Pick the first device and carry on (LP #459512)
      + 190_cache-xkbcomp_output_for_fast_start_up.patch:
      + 191-Xorg-add-an-extra-module-path.patch:
        Add support for the alternatives module path.
      + 198_nohwaccess.patch:
        Adds a -nohwaccess argument to make X not access the hardware
        ports directly.
      + 200_randr-null.patch:
        Clarify a pointer initialization.
      + 206_intel_8xx_default_t...

Read more...

Changed in xorg-server (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.