Xorg segmentation fault

Hello, I have an application developed in qt4 running on a linux 2.3 image compiled with QT. The hardware is a T20 module. I am using that version of linux (2.3) because it is the one that supported a sudden shutdown by removing the power.

The application is executed at startup through a service, which previously executes

Xorg -nocursor &

The application was running for several days until it suddenly stopped starting because the service was crashing … but actually it was failing to start Xorg as follows:

The Angstrom Distribution colibri-t20 ttyS0

Angstrom v2014.06 - Kernel 

Colibri_T20_LinuxImage-qtV2.3_20200131

colibri-t20 login: root
Password: 
Last login: Mon Feb  8 17:34:42 UTC 2021 on ttyS0
root@colibri-t20:~# Xorg -nocursor &
[1] 297
root@colibri-t20:~# 
X.Org X Server 1.14.7
Release Date: 2014-06-05
X Protocol Version 11, Revision 0
Build Operating System: Linux 4.4.0-142-generic x86_64 
Current Operating System: Linux colibri-t20 3.1.10-ga699c4f #5 SMP PREEMPT Mon Feb 24 22:31:26 -03 2020 armv7l
Kernel command line: vmalloc=128M usb_high_speed=0 ip=off root=/dev/mtdblock0 rw rootfstype=yaffs2 mtdparts=tegra_nand:1023744K@23808K(USR),3072K@0K(BCT),256K@4096K(PT)0
Build Date: 31 January 2020  11:24:31AM
 
Current version of pixman: 0.32.4
        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: Mon Feb  8 17:40:59 2021
(==) Using config file: "/etc/X11/xorg.conf"
(==) Using config directory: "/etc/X11/xorg.conf.d"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
Initializing built-in extension Generic Event Extension
Initializing built-in extension SHAPE
Initializing built-in extension MIT-SHM
Initializing built-in extension XInputExtension
Initializing built-in extension XTEST
Initializing built-in extension BIG-REQUESTS
Initializing built-in extension SYNC
Initializing built-in extension XKEYBOARD
Initializing built-in extension XC-MISC
Initializing built-in extension XFIXES
Initializing built-in extension RENDER
Initializing built-in extension RANDR
Initializing built-in extension COMPOSITE
Initializing built-in extension DAMAGE
Initializing built-in extension MIT-SCREEN-SAVER
Initializing built-in extension DOUBLE-BUFFER
Initializing built-in extension DPMS
Initializing built-in extension X-Resource
Initializing built-in extension XVideo
Initializing built-in extension XVideo-MotionCompensation
Initializing built-in extension XFree86-VidModeExtension
Initializing built-in extension XFree86-DGA
Initializing built-in extension XFree86-DRI
Initializing built-in extension DRI2
Loading extension TEGRA-EGL
(EE) 
(EE) Backtrace:
(EE) 
(EE) Segmentation fault at address 0xfffffffe
(EE) 
Fatal server error:
(EE) Caught signal 11 (Segmentation fault). Server aborting
(EE) 
(EE) 
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) 
[   99.238208] tegradc tegradc.0: switching framebuffer to 640x480
[   99.238259] tegradc tegradc.0: Calculated sync href=0 vref=1
[   99.238310] tegradc tegradc.0: using mode 640x480 pclk=25175000 href=0 vref=1
(EE) Server terminated with error (1). Closing log file.

[1]+  Aborted                 Xorg -nocursor

Any idea please?

Thanks!

Hello @devius ,

Thank you for your message!

This topic has already been discussed in another thread here: Segmentation Fault in Xorg - Technical Support - Toradex Community

Hope this helps.

Thank you and Best regards,
Janani

Hi @saijanani.tx ,

Thanks for your reply!

I’ve been reading that thread but I don’t understand what the solution would be in my case.

In my installation, once Linux starts, a service runs launches Xorg and my Qt application… (I don’t even have lxdm)

This is my init script:

#!/bin/sh

set -e

if [ -f /usr/bin/myApp ]; then
        QTVARIANT="X11"
        QTDEMO="myApp > /var/log/Xsession.log 2>&1"
else
        QTVARIANT=""
        
fi

case "$1" in
  start)
        echo "Starting myApp"
        if [ -f /etc/profile.d/tslib.sh ]; then
                source /etc/profile.d/tslib.sh
        fi
        if [ -e "$TSLIB_TSDEVICE" ]; then
                if [ ! -f /etc/pointercal ]; then
                        /usr/bin/ts_calibrate
                fi
                if [ "$QTVARIANT" == X11 ]; then
                        Xorg &
                        export DISPLAY=:0
                        eval $QTDEMO &
                else       
                        QWS_MOUSE_PROTO=tslib:$TSLIB_TSDEVICE $QTDEMO &
                fi         
        else               
                if [ -e "/usr/bin/xinput_calibrator_once.sh" ]; then
                        xinput_calibrator_once.sh
                fi         
                if [ "$QTVARIANT" == X11 ]; then
                        Xorg -nocursor &
                        export DISPLAY=:0
                fi         
                eval $QTDEMO &
        fi                 
        ;;                 
  stop)                    
        echo "Stopping myApp"
        if [ "$QTVARIANT" == X11 ]; then
                killall Xorg
                killall myApp
        else               
                killall myApp
        fi                 
        ;;                 
  restart)  
        $0 stop            
        $0 start           
        ;;                 
  *)                       
        echo "usage: $0 { start | stop | restart }" >&2
        exit 1              
        ;;                  
esac                        
                            
exit 0

Hello @devius,

This segmentation error occurs when X does not keep running continuously after it’s been started. I think you can also you a similar strategy from the thread above and start X with xinit instead of how you do it.

After that when you still see a Segmentation error, it is more likely something in your application that preempts X

Hope this helps!

Best regards,
Janani

Hello @saijanani.tx , I installed xinit and run

xinit /usr/bin/xrandr -- /usr/bin/X :0

just like the thread above, but the same Segmentation fault happened. And this time without running any application…

This is the Xorg log:

root@colibri-t20:/root# more /var/log/Xorg.0.log
[2193810.438] 
X.Org X Server 1.14.7
Release Date: 2014-06-05
[2193810.443] X Protocol Version 11, Revision 0
[2193810.445] Build Operating System: Linux 4.4.0-142-generic x86_64 
[2193810.448] Current Operating System: Linux colibri-t20 3.1.10-ga699c4f #5 SMP PREEMPT Mon Feb 24 22:31:26 -03 2020 armv7l
[2193810.449] Kernel command line: vmalloc=128M usb_high_speed=0 ip=off root=/dev/mtdblock0 rw rootfstype=yaffs2 mtdparts=tegra_nand:1023744K@23808K(USR),3072K@0K(BCT),256K@4096K(PT),2048K@5376K(EBT),256K@8448K(BMP),2048K@9728K(ENV),8192K@12800K(LNX),256K@22272K(ARG) asix_mac=00:14:2d:26:0e:b5 no_console_suspend=1 vt.global_cursor_default=0 console=ttyS0,115200n8 debug_uartport=lsport,0 mem=372M@0M fbmem=12M@372M nvmem=128M@384M video=tegrafb0:640x480-16@60
[2193810.454] Build Date: 31 January 2020  11:24:31AM
[2193810.454]  
[2193810.455] Current version of pixman: 0.32.4
[2193810.455]   Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
[2193810.456] Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[2193810.462] (==) Log file: "/var/log/Xorg.0.log", Time: Mon Feb  8 17:49:06 2021
[2193810.467] (==) Using config file: "/etc/X11/xorg.conf"
[2193810.468] (==) Using config directory: "/etc/X11/xorg.conf.d"
[2193810.468] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[2193810.473] (**) Option "defaultserverlayout" "Default Layout"
[2193810.474] (**) ServerLayout "Default Layout"
[2193810.474] (**) |-->Screen "Common Screen" (0)
[2193810.474] (**) |   |-->Monitor "LVDS"
[2193810.476] (**) |   |-->Device "Tegra"
[2193810.476] (**) Option "BlankTime" "0"
[2193810.477] (**) Option "StandbyTime" "0"
[2193810.477] (**) Option "SuspendTime" "0"
[2193810.477] (**) Option "OffTime" "0"
[2193810.477] (==) Automatically adding devices
[2193810.477] (==) Automatically enabling devices
[2193810.477] (==) Automatically adding GPU devices
[2193810.478] (WW) The directory "/usr/share/fonts/X11/TTF/" does not exist.
[2193810.478]   Entry deleted from font path.
[2193810.478] (WW) The directory "/usr/share/fonts/X11/OTF/" does not exist.
[2193810.478]   Entry deleted from font path.
[2193810.478] (WW) The directory "/usr/share/fonts/X11/Type1/" does not exist.
[2193810.479]   Entry deleted from font path.
[2193810.479] (==) FontPath set to:
        /usr/share/fonts/X11/misc/,
        /usr/share/fonts/X11/100dpi/,
        /usr/share/fonts/X11/75dpi/
[2193810.479] (==) ModulePath set to "/usr/lib/xorg/modules"
[2193810.479] (II) The server relies on udev to provide the list of input devices.
        If no devices become available, reconfigure udev or disable AutoAddDevices.
[2193810.479] (II) Loader magic: 0x12a148
[2193810.479] (II) Module ABI versions:
[2193810.480]   X.Org ANSI C Emulation: 0.4
[2193810.480]   X.Org Video Driver: 14.1
[2193810.480]   X.Org XInput driver : 19.1
[2193810.480]   X.Org Server Extension : 7.0
[2193810.482] Initializing built-in extension Generic Event Extension
[2193810.482] Initializing built-in extension SHAPE
[2193810.483] Initializing built-in extension MIT-SHM
[2193810.483] Initializing built-in extension XInputExtension
[2193810.484] Initializing built-in extension XTEST
[2193810.484] Initializing built-in extension BIG-REQUESTS
[2193810.485] Initializing built-in extension SYNC
[2193810.485] Initializing built-in extension XKEYBOARD
[2193810.486] Initializing built-in extension XC-MISC
[2193810.486] Initializing built-in extension XFIXES
[2193810.487] Initializing built-in extension RENDER
[2193810.488] Initializing built-in extension RANDR
[2193810.488] Initializing built-in extension COMPOSITE
[2193810.489] Initializing built-in extension DAMAGE
[2193810.490] Initializing built-in extension MIT-SCREEN-SAVER
[2193810.490] Initializing built-in extension DOUBLE-BUFFER
[2193810.490] Initializing built-in extension DPMS
[2193810.491] Initializing built-in extension X-Resource
[2193810.491] Initializing built-in extension XVideo
[2193810.491] Initializing built-in extension XVideo-MotionCompensation
[2193810.492] Initializing built-in extension XFree86-VidModeExtension
[2193810.492] Initializing built-in extension XFree86-DGA
[2193810.492] Initializing built-in extension XFree86-DRI
[2193810.493] Initializing built-in extension DRI2
[2193810.493] (WW) "dri" will not be loaded unless you've specified it to be loaded elsewhere.
[2193810.493] (WW) "dri2" will not be loaded unless you've specified it to be loaded elsewhere.
[2193810.493] (WW) "glx" will not be loaded unless you've specified it to be loaded elsewhere.
[2193810.493] (II) "glx" will be loaded even though the default is to disable it.
[2193810.493] (II) LoadModule: "extmod"
[2193810.495] (II) Module "extmod" already built-in
[2193810.495] (II) LoadModule: "tegra"
[2193810.500] (II) Loading /usr/lib/xorg/modules/drivers/tegra_drv.so
[2193810.517] (II) Module tegra: vendor="X.Org Foundation"
[2193810.517]   compiled for 1.13.99.901, module version = 0.4.0
[2193810.517]   Module class: X.Org Video Driver
[2193810.517]   ABI class: X.Org Video Driver, version 14.1
[2193810.517] (II) NVIDIA driver for Tegra
[2193810.518] (--) using VT number 2
                            
[2193810.550] (WW) Falling back to old probe method for tegra
[2193810.551] (WW) VGA arbiter: cannot open kernel arbiter, no multi-card support
[2193810.568] (II) TEGRA(0): GPU is a T20/T25
[2193810.568] (II) TEGRA(0): Creating default Display subsection in Screen section
        "Common Screen" for depth/fbbpp 16/16
[2193810.568] (**) TEGRA(0): Depth 16, (--) framebuffer bpp 16
[2193810.568] (==) TEGRA(0): RGB weight 565
[2193810.568] (==) TEGRA(0): Default visual is TrueColor
[2193810.569] (==) TEGRA(0): Using gamma correction (1.0, 1.0, 1.0)
[2193810.569] (**) TEGRA(0): Option "ARGBHWCursor" "false"
[2193810.570] (II) TEGRA(0): Output LVDS-1 using monitor section LVDS
[2193810.570] (**) TEGRA(0): Option "Ignore" "false"
[2193810.571] (II) TEGRA(0): Output HDMI-1 using monitor section HDMI
[2193810.571] (**) TEGRA(0): Option "Ignore" "false"
[2193810.572] (WW) TEGRA(0): LVDS-1: Error querying display modes: No such device.
[2193810.572] (II) TEGRA(0): EDID for output LVDS-1
[2193810.573] (II) TEGRA(0): Printing probed modes for output LVDS-1
[2193810.573] (II) TEGRA(0): Modeline "640x480"x61.0   25.18  640 688 784 800  480 513 515 516 (31.5 kHz eP)
[2193810.573] (II) TEGRA(0): EDID for output HDMI-1
[2193810.573] (II) TEGRA(0): Output LVDS-1 connected
[2193810.573] (II) TEGRA(0): Output HDMI-1 disconnected
[2193810.573] (II) TEGRA(0): Using exact sizes for initial modes
[2193810.574] (II) TEGRA(0): Output LVDS-1 using initial mode 640x480
[2193810.574] (II) TEGRA(0): Using default gamma of (1.0, 1.0, 1.0) unless otherwise stated.
[2193810.574] (--) TEGRA(0): VideoRAM: 32768 kByte
[2193810.574] (--) TEGRA(0): Virtual size is 640x480 (pitch 0)
[2193810.574] (**) TEGRA(0):  Driver mode "640x480": 25.2 MHz, 31.5 kHz, 61.0 Hz
[2193810.575] (II) TEGRA(0): Modeline "640x480"x61.0   25.18  640 688 784 800  480 513 515 516 (31.5 kHz eP)
[2193810.575] (==) TEGRA(0): DPI set to (96, 96)
[2193810.575] (II) Loading sub module "fb"
[2193810.575] (II) LoadModule: "fb"
[2193810.580] (II) Loading /usr/lib/xorg/modules/libfb.so
[2193810.584] (II) Module fb: vendor="X.Org Foundation"
[2193810.584]   compiled for 1.14.7, module version = 1.0.0
[2193810.584]   ABI class: X.Org ANSI C Emulation, version 0.4
[2193810.584] (II) Loading sub module "ramdac"
[2193810.584] (II) LoadModule: "ramdac"
[2193810.584] (II) Module "ramdac" already built-in
[2193810.589] (==) TEGRA(0): Backing store disabled
[2193810.590] (==) TEGRA(0): Silken mouse enabled
[2193810.591] (II) TEGRA(0): RandR 1.2 enabled, ignore the following RandR disabled message.
[2193810.603] Loading extension TEGRA-EGL
[2193810.604] (WW) TEGRA(0): Option "Ignore" is not used
[2193810.604] (--) RandR disabled
[2193810.745] (II) TEGRA(0): Setting screen physical size to 169 x 127
[2193810.749] (EE)          
[2193810.751] (EE) Backtrace:
[2193810.755] (EE)          
[2193810.759] (EE) Segmentation fault at address 0xfffffffe
[2193810.760] (EE)          
Fatal server error:         
[2193810.760] (EE) Caught signal 11 (Segmentation fault). Server aborting
[2193810.761] (EE)          
[2193810.762] (EE)          
Please consult the The X.Org Foundation support 
         at http://wiki.x.org
 for help.                  
[2193810.763] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
[2193810.763] (EE)          
[2193810.892] (EE) Server terminated with error (1). Closing log file.

Look at the log just before the segmentation fault that says:

Loading extension TEGRA-EGL

As if the failure was trying to load a driver?

Hello @devius ,

Thank you for your detailed log. After confirming within the BSP team, I can confirm that there are no known issues from the BSP side. And because this BSP you are using super old and because we our demo image work fine, I would start from there. We think it is more likely something in the application.

Best Regards,
Janani.