Xorg Segmentation fault on Hisilicon D05 board (arm64)

Bug #1691991 reported by Zhanglei Mao on 2017-05-19
This bug affects 1 person
Affects Status Importance Assigned to Milestone
xorg (Ubuntu)

Bug Description

ubuntu@ubuntu:~$ sudo /usr/lib/xorg/Xorg
[sudo] password for ubuntu:

X.Org X Server 1.18.4
Release Date: 2016-07-19
X Protocol Version 11, Revision 0
Build Operating System: Linux 4.4.0-45-generic aarch64 Ubuntu
Current Operating System: Linux ubuntu 4.10.0-20.22-generic #22+pearl.2-Ubuntu SMP Thu Apr 27 20:23:08 UTC 2017 aarch64
Kernel command line: BOOT_IMAGE=/boot/vmlinuz-4.10.0-20.22-generic root=UUID=eee681c5-04ce-4cd0-a004-cae6717961ce ro debug earlycon=pl011,mmio,0x602B0000 console=tty0
Build Date: 02 November 2016 10:05:28PM
xorg-server 2:1.18.4-0ubuntu0.2 (For technical support please see http://www.ubuntu.com/support)
Current version of pixman: 0.33.6
 Before reporting problems, check http://wiki.x.org
 to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
 (++) from command line, (!!) notice, (II) informational,
 (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Fri May 19 18:10:13 2017
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
pci id for fd 10: 19e5:1711, driver (null)
EGL_MESA_drm_image required.
(EE) Backtrace:
(EE) 0: /usr/lib/xorg/Xorg (xorg_backtrace+0x58) [0xaaaad7f1cc48]
(EE) Segmentation fault at address 0xa0
Fatal server error:
(EE) Caught signal 11 (Segmentation fault). Server aborting
Please consult the The X.Org Foundation support
  at http://wiki.x.org
 for help.
(EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
(EE) Server terminated with error (1). Closing log file.
Aborted (core dumped)

Zhanglei Mao (zhanglei-mao) wrote :
Zhanglei Mao (zhanglei-mao) wrote :
Zhanglei Mao (zhanglei-mao) wrote :
Zhanglei Mao (zhanglei-mao) wrote :
Download full text (11.3 KiB)

backtrace by apport-retrace

crash buntu:/var/crash# apport-retrace --stdout /var/crash/_usr_lib_xorg_Xorg.0.c
gpgv: Signature made Tue 01 Nov 2016 04:15:19 PM CST using RSA key ID A88984DC
gpgv: Can't check signature: public key not found
dpkg-source: warning: failed to verify signature on ./xorg-server_1.18.4-0ubuntu0.2.dsc
dpkg-source: info: extracting xorg-server in xorg-server-1.18.4
dpkg-source: info: unpacking xorg-server_1.18.4.orig.tar.gz
dpkg-source: info: applying xorg-server_1.18.4-0ubuntu0.2.diff.gz
dpkg-source: info: upstream files that have been modified:
W: Can't drop privileges for downloading as file 'xorg-server_1.18.4-0ubuntu0.2.dsc' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)
--- stack trace ---
#0 0x0000ffff9220b528 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
        _sys_result = 0
        pd = 0xffff91fa7000
        pid = 7478
        selftid = 7478
#1 0x0000ffff9220c9e0 in __GI_abort () at abort.c:89
        save_stage = 2
        act = {__sigaction_handler = {sa_handler = 0xa6530de400000000, sa_sigaction = 0xa6530de400000000}, sa_mask = {__val = {2676586395008836901, 2676586395008836901, 2594, 6730122966621824347, 32, 2910292295676945778, 18446744073709486080, 0, 18446744073709551360, 0, 4616194021471027200, 1024, 4616194021471028224, 0, 4616194021471028225, 4616194021471028225}}, sa_flags = -1054354032, sa_restorer = 0xaaaac122fa28 <System>}
        sigs = {__val = {32, 0 <repeats 15 times>}}
#2 0x0000aaaac122fa28 in OsAbort () at ../../os/utils.c:1408
No locals.
#3 0x0000aaaac1116364 in ddxGiveUp (error=error@entry=EXIT_ERR_ABORT) at ../../../../hw/xfree86/common/xf86Init.c:1102
        i = <optimized out>
#4 0x0000aaaac111643c in AbortDDX (error=error@entry=EXIT_ERR_ABORT) at ../../../../hw/xfree86/common/xf86Init.c:1146
        i = <optimized out>
#5 0x0000aaaac12358e0 in AbortServer () at ../../os/log.c:874
No locals.
#6 0x0000aaaac1236624 in FatalError (f=f@entry=0xaaaac1266988 "Caught signal %d (%s). Server aborting\n") at ../../os/log.c:1015
        args = {__stack = 0xffffd085b680, __gr_top = 0xffffd085b680, __vr_top = 0xffffd085b640, __gr_offs = -56, __vr_offs = -128}
        args2 = {__stack = 0xffffd085b680, __gr_top = 0xffffd085b680, __vr_top = 0xffffd085b640, __gr_offs = -56, __vr_offs = -128}
        beenhere = 1
#7 0x0000aaaac122d294 in OsSigHandler (signo=11, sip=0xffffd085b6a0, unused=<optimized out>) at ../../os/osinit.c:150

Zhanglei Mao (zhanglei-mao) wrote :
Zhanglei Mao (zhanglei-mao) wrote :

Pual Liu analyse for this bug, he provide a temporarily fix but it seems not works (no output in monitor)
Hi all,

I look deep into the problem and I'm not sure if it is the kernel issue or Xorg issue.
We might need to spend more time on this issue to tracing into the Xorg code.
The problem happens to the modesetting driver in Xorg. So if you remove /usr/lib/xorg/modules/drivers/modesetting_drv.so it will use the fbdev driver and the X will start.

When modesetting is there, we got a SIGSEGV. And it happens to a line that shouldn't have any problem.

RRSetChanged(ScreenPtr pScreen)
   /* set changed bits on the master screen only */
   ScreenPtr master;
   rrScrPrivPtr mastersp;

   if (pScreen->isGPU) {
       master = pScreen->current_master;
       if (!master)
       mastersp = rrGetScrPriv(master);
   else {
       master = pScreen;
       mastersp = pScrPriv;

   mastersp->changed = TRUE; // <---- CRASH here

So we need to figure out why mastersp disappeared.
There might be some race conditions here.

Zhanglei Mao (zhanglei-mao) wrote :

This final goal is "Ubuntu 16.04 support x-Window by modesetting (modesetting_drv.so) driver"

Notes: From xserver source code,it only use modeset. For the display card hardware it is a display controller without GPU,the call paths is xserver->modesetting_drv(userspace)->libdrm(userspace)->drm(kernel).

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers