Segmentation Fault in Xorg

I am trying to bring up Xorg without lxdm desktop. X can be launched after lxdm.service is terminated. But it is failed to launch ‘xrandr’ or ‘xinput_calibrator’, there is segmentation error from Xorg.

root@apalis-imx6:~# systemctl stop lxdm.service
root@apalis-imx6:~# X &
[1] 685
root@apalis-imx6:~# 
X.Org X Server 1.17.2
Release Date: 2015-06-16
X Protocol Version 11, Revision 0
Build Operating System: Linux 3.13.0-101-generic x86_64 
Current Operating System: Linux apalis-imx6 3.14.52-v2.6.1b1+g3894f6d #1 SMP Mon Nov 14 14:51:26 CST 2016 armv7l
Kernel command line: enable_wait_mode=off vmalloc=400M ip=off root=/dev/mmcblk0p2 rw,noatime rootfstype=ext3 rootwait fec_mac=00:
14:2d:4a:30:08 consoleblank=0 no_console_suspend=1 console=tty1 console=ttymxc0,115200n8 mxc_hdmi.only_cea=1 video=mxcfb0:dev=hdm
i,1920x1080M@60,if=RGB24 video=mxcfb1:off video=mxcfb2:off video=mxcfb3:off fbmem=32M
Build Date: 14 November 2016  03:26:52PM
 
Current version of pixman: 0.32.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: Thu Nov 24 09:28:03 2016
([   49.060756] mxc_sdc_fb fb.20: 1920x1080 h_sync,r,l: 44,88,148  v_sync,l,u: 5,4,36 pixclock=148500000 Hz
==) Using config file: "/etc/X11/xorg.conf"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
[   49.125086] mxc_sdc_fb fb.20: 1920x1080 h_sync,r,l: 44,88,148  v_sync,l,u: 5,4,36 pixclock=148500000 Hz
[   49.194083] mxc_sdc_fb fb.20: 1920x1080 h_sync,r,l: 44,88,148  v_sync,l,u: 5,4,36 pixclock=148500000 Hz
[   49.264339] mxc_sdc_fb fb.20: 1920x1080 h_sync,r,l: 44,88,148  v_sync,l,u: 5,4,36 pixclock=148500000 Hz
[   49.642247] mxc_sdc_fb fb.20: 1920x1080 h_sync,r,l: 44,88,148  v_sync,l,u: 5,4,36 pixclock=148500000 Hz

root@apalis-imx6:~# xrandr
Screen 0: minimum 240 x 240, current 1920 x 1080, maximum 8192 x 8192
DISP3 BG connected 1920x1080+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
   D:1920x1080p-60  60.00*+
   V:640x480p-60  60.00  
root@apalis-imx6:~# [   59.620865] mxc_sdc_fb fb.20: 1920x1080 h_sync,r,l: 44,88,148  v_sync,l,u: 5,4,36 pixclock=148500000 Hz
[   59.684183] mxc_sdc_fb fb.20: 1920x1080 h_sync,r,l: 44,88,148  v_sync,l,u: 5,4,36 pixclock=148500000 Hz
[   59.754309] mxc_sdc_fb fb.20: 1920x1080 h_sync,r,l: 44,88,148  v_sync,l,u: 5,4,36 pixclock=148500000 Hz
(EE) 
(EE) Backtrace:
(EE) 
(EE) Segmentation fault at address 0x65627553
(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) 
(EE) Server terminated with error (1). Closing log file.

Is the way wrong to start Xorg ? Thanks!

Hi

Starting X that way is very simple, however it seems that once you started an X client you need to keep an X client running at all time or you are hit by the segmentation fault you’ve seen.

Using the helper xinit might probably be the way to go but we currently have no ready example on how to that.

E.g. if you start X and an instance of lxterminal you can run xrandr without a segmentation fault when xrandr exits.

root@apalis-imx6:~# X &
[1] 776
...
root@apalis-imx6:~# lxterminal &
[2] 779
root@apalis-imx6:~# xrandr
Screen 0: minimum 240 x 240, current 1920 x 1080, maximum 8192 x 8192
DISP3 BG connected 1920x1080+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
   D:1920x1080p-60  60.00*+
   D:1920x1080p-50  50.00  
   D:1280x720p-50  50.00  
   D:1280x720p-60  60.00  
   D:720x576p-50  50.00  
   D:720x480p-59  59.94  
   V:640x480p-60  60.00  
root@apalis-imx6:~#

Max

Thanks very much. You are correct.
xinit can also launch x client successfully.

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

But xinit is not included in default BSP. One can install it online.

opkg update
opkg install xinit