freedreno-zz / xf86-video-freedreno

Other
10 stars 3 forks source link

Segmentation fault at address 0x10 #3

Closed gamax92 closed 8 years ago

gamax92 commented 8 years ago

Whenever I use the precompiled xf86-video-freedreno-1.4.0-1-armv7h.pkg.tar.xz or compile it myself using autogen.sh, the X server can't start up and gives "Segmentation fault at address 0x10"

The device is running an Adreno 225, and this is in native arch linux, not an Android chroot, so /dev/fb0 is the correct address here.

Kernel has this in it's config:

CONFIG_DRM=y
CONFIG_MSM_KGSL=y
CONFIG_MSM_KGSL_2D=y
CONFIG_MSM_KGSL_DRM=y

One thing that stands out from the log is this [ 16.751] [E] unknown device: kgsl (fd_device_new:104)

Xorg.0.log:

[    15.291] 
X.Org X Server 1.18.3
Release Date: 2016-04-04
[    15.292] X Protocol Version 11, Revision 0
[    15.292] Build Operating System: Linux 3.10.96-3-ARCH armv7l 
[    15.292] Current Operating System: Linux alarm 3.4.104-d2lte+ #27 SMP PREEMPT Mon Dec 8 21:54:40 MST 2014 armv7l
[    15.292] Kernel command line: androidboot.hardware=qcom user_debug=31 zcache sec_log=0x80000@0x88600008 sec_dbg=0x40000@0x88690004 sec_debug.reset_reason=0x1a2b3c00 etb_buf=0x4000@0x8fffb9c0 androidboot.debug_level=0x4f4c sec_debug.enable=0 sec_debug.enable_user=0 msm_rtb.enabled=0 androidboot.cp_debug_level=0x55FF sec_debug.enable_cp_debug=0 cordon=52ad295242512a99cfeaa4c408bd1764 sysscope=0xee000000 loglevel=4 samsung.hardware=SGH-I747 androidboot.emmc_checksum=3 androidboot.warranty_bit=1 androidboot.bootloader=I747UCUFNE4 androidboot.nvdata_backup=1 androidboot.boot_recovery=0 androidboot.batt_check_recovery=0 level=0x574f4c44 sec_pvs=0 androidboot.emmc=true androidboot.serialno=d7948767 androidboot.baseband=msm root=/dev/mmcblk0p15 rootsubdir=local/arch rootfstype=ext4 rootwait ro
[    15.292] Build Date: 08 June 2016  01:41:49PM
[    15.292]  
[    15.293] Current version of pixman: 0.34.0
[    15.293]    Before reporting problems, check http://wiki.x.org
    to make sure that you have the latest version.
[    15.293] Markers: (--) probed, (**) from config file, (==) default setting,
    (++) from command line, (!!) notice, (II) informational,
    (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[    15.293] (==) Log file: "/var/log/Xorg.0.log", Time: Thu Jun 16 19:34:52 2016
[    15.294] (==) Using config directory: "/etc/X11/xorg.conf.d"
[    15.294] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[    15.295] (==) No Layout section.  Using the first Screen section.
[    15.295] (**) |-->Screen "screen0" (0)
[    15.295] (**) |   |-->Monitor "<default monitor>"
[    15.296] (**) |   |-->Device "MSM"
[    15.296] (==) No monitor specified for screen "screen0".
    Using a default monitor configuration.
[    15.296] (==) Automatically adding devices
[    15.296] (==) Automatically enabling devices
[    15.296] (==) Automatically adding GPU devices
[    15.296] (==) Max clients allowed: 256, resource mask: 0x1fffff
[    15.296] (WW) The directory "/usr/share/fonts/Type1/" does not exist.
[    15.296]    Entry deleted from font path.
[    15.296] (==) FontPath set to:
    /usr/share/fonts/misc/,
    /usr/share/fonts/TTF/,
    /usr/share/fonts/OTF/,
    /usr/share/fonts/100dpi/,
    /usr/share/fonts/75dpi/
[    15.296] (==) ModulePath set to "/usr/lib/xorg/modules"
[    15.296] (II) The server relies on udev to provide the list of input devices.
    If no devices become available, reconfigure udev or disable AutoAddDevices.
[    15.296] (II) Loader magic: 0x1e3ed8
[    15.296] (II) Module ABI versions:
[    15.297]    X.Org ANSI C Emulation: 0.4
[    15.297]    X.Org Video Driver: 20.0
[    15.297]    X.Org XInput driver : 22.1
[    15.297]    X.Org Server Extension : 9.0
[    15.300] (++) using VT number 7

[    15.300] (II) systemd-logind: logind integration requires -keeptty and -keeptty was not provided, disabling logind integration
[    15.302] (II) xfree86: Adding drm device (/dev/dri/card0)
[    15.302] (II) no primary bus or device found
[    15.302]    falling back to /sys/devices/platform/kgsl-3d0.0/drm/card0
[    15.302] (II) LoadModule: "glx"
[    15.303] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[    15.318] (II) Module glx: vendor="X.Org Foundation"
[    15.318]    compiled for 1.18.3, module version = 1.0.0
[    15.318]    ABI class: X.Org Server Extension, version 9.0
[    15.318] (==) AIGLX enabled
[    15.318] (II) LoadModule: "freedreno"
[    15.319] (II) Loading /usr/lib/xorg/modules/drivers/freedreno_drv.so
[    15.319] (II) Module freedreno: vendor="X.Org Foundation"
[    15.319]    compiled for 1.18.3, module version = 1.4.0
[    15.319]    ABI class: X.Org Video Driver, version 20.0
[    15.320] (II) freedreno: Video driver for Qualcomm processors
[    16.006] (WW) Falling back to old probe method for freedreno
[    16.405] (II) No msm DRM/KMS, fallback to fbdev/kgsl
[    16.405] (II) Section 0 - looking for /dev/fb0
[    16.405] (WW) VGA arbiter: cannot open kernel arbiter, no multi-card support
[    16.405] (II) freedreno(0): MSMPreInit:183 pre-init
[    16.405] (--) freedreno(0): Depth 0, (--) framebuffer bpp 0
[    16.405] (II) freedreno(0): MSM/Qualcomm processor
[    16.405] drmOpenDevice: node name is /dev/dri/card0
[    16.405] drmOpenDevice: open result is 8, (OK)
[    16.405] drmOpenDevice: node name is /dev/dri/card0
[    16.405] drmOpenDevice: open result is 8, (OK)
[    16.406] drmOpenDevice: node name is /dev/dri/card1
[    16.429] drmOpenDevice: node name is /dev/dri/card2
[    16.451] drmOpenDevice: node name is /dev/dri/card3
[    16.474] drmOpenDevice: node name is /dev/dri/card4
[    16.497] drmOpenDevice: node name is /dev/dri/card5
[    16.520] drmOpenDevice: node name is /dev/dri/card6
[    16.543] drmOpenDevice: node name is /dev/dri/card7
[    16.566] drmOpenDevice: node name is /dev/dri/card8
[    16.589] drmOpenDevice: node name is /dev/dri/card9
[    16.612] drmOpenDevice: node name is /dev/dri/card10
[    16.635] drmOpenDevice: node name is /dev/dri/card11
[    16.658] drmOpenDevice: node name is /dev/dri/card12
[    16.681] drmOpenDevice: node name is /dev/dri/card13
[    16.704] drmOpenDevice: node name is /dev/dri/card14
[    16.727] drmOpenDevice: node name is /dev/dri/card15
[    16.750] drmOpenDevice: node name is /dev/dri/card0
[    16.750] drmOpenDevice: open result is 8, (OK)
[    16.751] drmOpenDevice: node name is /dev/dri/card0
[    16.751] drmOpenDevice: open result is 8, (OK)
[    16.751] drmGetBusid returned ''
[    16.751] [E] unknown device: kgsl (fd_device_new:104)
[    16.751] (WW) freedreno(0): WARNING: Unable to determine the MDP version - assume 3.1
[    16.803] (II) freedreno(0): Creating default Display subsection in Screen section
    "screen0" for depth/fbbpp 24/32
[    16.803] (II) freedreno(0): Output default has no monitor section
[    16.803] (II) freedreno(0): Printing probed modes for output default
[    16.803] (II) freedreno(0): Modeline "720x1280"x60.0   82.56  720 998 1000 1030  1280 1333 1334 1336 (80.2 kHz Pb)
[    16.803] (II) freedreno(0): Output default connected
[    16.803] (II) freedreno(0): Using exact sizes for initial modes
[    16.803] (II) freedreno(0): Output default using initial mode 720x1280 +0+0
[    16.803] (II) freedreno(0): Using default gamma of (1.0, 1.0, 1.0) unless otherwise stated.
[    16.804] (**) freedreno(0): Option "fb" "/dev/fb0"
[    16.804] (**) freedreno(0): Option "SWCursor" "true"
[    16.804] (**) freedreno(0): Option "examask" "0x00"
[    16.804] (**) freedreno(0): Option "SWRefresher" "false"
[    16.804] (II) freedreno(0): Option Summary:
[    16.804] (II) freedreno(0):   NoAccel:     0
[    16.804] (II) freedreno(0):   HWCursor:    0
[    16.804] (II) freedreno(0):   examask:     0
[    16.804] (II) freedreno(0):   fb:          /dev/fb0
[    16.804] (II) freedreno(0):   SWRefresher: 0
[    16.804] (II) freedreno(0):   Debug:       0
[    16.804] (--) freedreno(0): Virtual size is 720x1280 (pitch 736)
[    16.804] (**) freedreno(0):  Built-in mode "720x1280": 82.6 MHz (scaled from 0.0 MHz), 80.2 kHz, 60.0 Hz
[    16.804] (II) freedreno(0): Modeline "720x1280"x0.0   82.56  720 998 1000 1030  1280 1333 1334 1336 (80.2 kHz Pb)
[    16.804] (==) freedreno(0): DPI set to (96, 96)
[    16.805] (==) freedreno(0): RGB weight 888
[    16.805] (==) freedreno(0): Default visual is TrueColor
[    16.805] (II) freedreno(0): MSM Options:
[    16.805] (II) freedreno(0):  HW Cursor: Disabled
[    16.805] (==) Depth 24 pixmap format is 32 bpp
[    16.805] (II) Loading sub module "fb"
[    16.805] (II) LoadModule: "fb"
[    16.806] (II) Loading /usr/lib/xorg/modules/libfb.so
[    16.807] (II) Module fb: vendor="X.Org Foundation"
[    16.807]    compiled for 1.18.3, module version = 1.0.0
[    16.807]    ABI class: X.Org ANSI C Emulation, version 0.4
[    16.808] (==) freedreno(0): Backing store enabled
[    16.808] (II) Loading sub module "exa"
[    16.808] (II) LoadModule: "exa"
[    16.808] (II) Loading /usr/lib/xorg/modules/libexa.so
[    16.809] (II) Module exa: vendor="X.Org Foundation"
[    16.809]    compiled for 1.18.3, module version = 2.6.0
[    16.809]    ABI class: X.Org Video Driver, version 20.0
[    16.809] (EE) 
[    16.809] (EE) Backtrace:
[    16.809] (EE) 
[    16.810] (EE) Segmentation fault at address 0x10
[    16.810] (EE) 
Fatal server error:
[    16.810] (EE) Caught signal 11 (Segmentation fault). Server aborting
[    16.810] (EE) 
[    16.810] (EE) 
Please consult the The X.Org Foundation support 
     at http://wiki.x.org
 for help. 
[    16.810] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
[    16.811] (EE) 
[    16.843] (EE) Server terminated with error (1). Closing log file.

EDIT: Apparently just got this now Segmentation fault at address 0x28, usually it's always been 0x10.

EDIT: Ignore the information about the 0x28 one, that stems from a misconfigured xorg.conf accidentally including a bogus Screen.

gamax92 commented 8 years ago

Apologies about the previous backtrace, it wasn't the one that was relevant to the issue and instead was from a misconfigured Xorg thanks to an extraneous file. Sadly the actual backtrace contains no information:

[    13.990] (EE) Backtrace:
[    13.992] (EE) 0: /usr/lib/xorg-server/Xorg (OsSigHandler+0x30) [0x19bcbc]
[    13.995] (EE) 1: /usr/lib/libc.so.6 (__default_rt_sa_restorer+0x0) [0xb6a37738]
[    13.995] (EE) unw_get_proc_info failed: no unwind info found [-10]
[    13.995] (EE) 
[    13.996] (EE) Segmentation fault at address 0x10

Going to continue looking into compiling things with debugging information to see if that unwind error goes away.

gamax92 commented 8 years ago

Was able to get out an actual backtrace by using gdb:

Program received signal SIGSEGV, Segmentation fault.
fd_pipe_new (dev=0x0, id=id@entry=FD_PIPE_2D) at freedreno_pipe.c:46
46      pipe = dev->funcs->pipe_new(dev, id);
(gdb) bt
#0  fd_pipe_new (dev=0x0, id=id@entry=FD_PIPE_2D) at freedreno_pipe.c:46
#1  0xb6577d5c in MSMAccelInit (pScreen=pScreen@entry=0x2490d0) at msm-accel.c:48
#2  0xb6576e74 in MSMScreenInit (pScreen=pScreen@entry=0x2490d0, argc=argc@entry=4, argv=argv@entry=0xbefffce4) at msm-driver.c:452
#3  0x0003c6b4 in AddScreen (pfnInit=0xb6576c94 <MSMScreenInit>, argc=argc@entry=4, argv=argv@entry=0xbefffce4) at dispatch.c:3864
#4  0x00083e48 in InitOutput (pScreenInfo=pScreenInfo@entry=0x21675c <screenInfo>, argc=argc@entry=4, argv=argv@entry=0xbefffce4) at xf86Init.c:885
#5  0x00040540 in dix_main (argc=4, argv=0xbefffce4, envp=<optimized out>) at main.c:204
#6  0x0002a86c in main (argc=<optimized out>, argv=<optimized out>, envp=<optimized out>) at stubmain.c:34

Seems pMsm->dev is NULL

(The library in the last Xorg backtrace missing unwind info was libdrm)

gamax92 commented 8 years ago

Oh, a change was done to libdrm that now requires --enable-freedreno-kgsl in libdrm for kgsl support. All is running well now.