Bug 6665

Summary: [Beaglebone] Xserver segmentation fault when reboot the system
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Yi Zhao <yi.zhao>
Component: graphicsAssignee: Ross Burton <ross.burton>
Status: VERIFIED FIXED QA Contact: Yi Zhao <yi.zhao>
Severity: normal    
Priority: Medium CC: alexandru.c.georgescu, ke.zou, markus.boos, meta.mr.watcher, meta.watcher, richard.purdie, yi.zhao
Version: 1.7   
Target Milestone: 1.8 M3   
Hardware: BeagleBone   
OS: arm   
Whiteboard:
OS type for building Yocto: --- Type of Regression: Regression (Found by QA test)
Verified: Documentation change: No (bug/feature does not impact docs)
Attachments:
Description Flags
xorg.0.log none

Description Yi Zhao 2014-08-28 07:46:44 UTC
Created attachment 2097 [details]
xorg.0.log

Image location: http://autobuilder.yoctoproject.org/pub/nightly/20140826-2/machines/beaglebone/

Git rev: master/52b788c6df9201764130ab744bf67b770b24b896

When reboot the system in runlevel 5, there is an xserver segfault message in serial port:
###########################
root@beaglebone:~# reboot

Broadcast message from root@beaglebone (ttyO0) (Thu Aug 28 06:46:15 2014):
The system is going down for reboot NOW!
INIT: Sending processes the TERM signal
INIT: Sending processes the KILL signal
Stopping OpenBSD Secure Shell server: sshdstopped /usr/sbin/sshd (pid 540)
.
 * Stopping Avahi mDNS/DNS-SD Daemon: avahi-daemon

[ ok ]rofile-server:593): WARNING **: Avahi error: Daemon connection failed
Stopping system message bus: dbus.
Stopping Distributed Compiler Daemon: distcc/etc/rc6.d/K20distcc: stop failed with error code 1
Stopping OProfileUI server
Stopping syslogd/klogd: stopped syslogd (pid 561)
stopped klogd (pid 564)
done
Stopping tcf-agent: OK
Stopping XServer
xinit: connection to X server lost

waiting for X server to shut down Stopping Connection Manager
Stopping Telephony daemon

Fatal server error:
(EE) xf86CloseConsole: VT_ACTIVATE failed: Input/output error
(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) 
(EE) Backtrace:
(EE) 
(EE) Segmentation fault at address 0x1d7e38
(EE) 
FatalError re-entered, aborting
(EE) Caught signal 11 (Segmentation fault). Server aborting
(EE) 
ALSA: Storing mixer settings...
/usr/sbin/alsactl: save_state:1590: No soundcards found...
Stopping rpcbind daemon...
done.
Stopping Linux NFC daemon
Deconfiguring network interfaces... done.
Sending all processes the TERM signal...
Error VT_WAITACTIVE failed
: Interrupted system call

xinit: unexpected signal 15
Sending all processes the KILL signal...
Unmounting remote filesystems...
Deactivating swap...
Unmounting local filesystems...
################################

There are some error messages in Xorg.0.log:
###########################
[340408.977] (EE) FBDEV(0): FBIOPUTCMAP: Invalid argument
[340408.977] (EE) FBDEV(0): FBIOPUTCMAP: Invalid argument
[340408.977] (EE) FBDEV(0): FBIOPUTCMAP: Invalid argument
[340408.977] (EE) FBDEV(0): FBIOPUTCMAP: Invalid argument
[340408.977] (EE) FBDEV(0): FBIOPUTCMAP: Invalid argument
[340408.977] (EE) FBDEV(0): FBIOPUTCMAP: Invalid argument
[340408.977] (EE) FBDEV(0): FBIOPUTCMAP: Invalid argument
[340408.977] (EE) FBDEV(0): FBIOPUTCMAP: Invalid argument
[340408.978] (EE) FBDEV(0): FBIOPUTCMAP: Invalid argument
[340408.978] (EE) FBDEV(0): FBIOPUTCMAP: Invalid argument
[340408.978] (EE) FBDEV(0): FBIOPUTCMAP: Invalid argument
[340408.978] (EE) FBDEV(0): FBIOPUTCMAP: Invalid argument
[340408.978] (EE) FBDEV(0): FBIOPUTCMAP: Invalid argument
[340408.978] (EE) FBDEV(0): FBIOPUTCMAP: Invalid argument
[340408.978] (EE) FBDEV(0): FBIOPUTCMAP: Invalid argument
[340408.978] (EE) FBDEV(0): FBIOPUTCMAP: Invalid argument
[340408.978] (EE) FBDEV(0): FBIOPUTCMAP: Invalid argument
[340408.978] (EE) FBDEV(0): FBIOPUTCMAP: Invalid argument
[340408.978] (EE) FBDEV(0): FBIOPUTCMAP: Invalid argument
[340408.978] (EE) FBDEV(0): FBIOPUTCMAP: Invalid argument
[340408.978] (EE) FBDEV(0): FBIOPUTCMAP: Invalid argument
######################################


I also found a strange issue, sometimes there is no X display on my LCD display in first boot, but the X process is running. After reboot the system, it works again.
Comment 1 Kevin Hao 2014-09-05 03:07:33 UTC
This is not a BSP issue. The should be an issue in xserver-xorg. It seems that we try to close the connections repetitively. Something like the following would address it. But I am not sure this is the right fix.

diff --git a/os/connection.c b/os/connection.c
index 162e1d93e483..6dff9ad7e2ea 100644
--- a/os/connection.c
+++ b/os/connection.c
@@ -510,9 +510,14 @@ void
 CloseWellKnownConnections(void)
 {
     int i;
+    XtransConnInfo *p = ListenTransConns;
 
-    for (i = 0; i < ListenTransCount; i++)
-        _XSERVTransClose(ListenTransConns[i]);
+    for (i = 0; i < ListenTransCount; i++, p++) {
+       if (*p) {
+            _XSERVTransClose(ListenTransConns[i]);
+           *p = NULL;
+       }
+    }
 }
 
 static void
Comment 2 Ross Burton 2014-09-26 21:57:55 UTC
Kevin - can you file a bug/send a mail to the Xorg developers for their input on this?
Comment 3 Ross Burton 2014-12-18 16:08:13 UTC
Silence on this since September - is this still reproducible?
Comment 4 Yi Zhao 2014-12-22 10:03:36 UTC
(In reply to comment #3)
> Silence on this since September - is this still reproducible?

Yes. It still exists in latest build (git rev: master/8657c2fd57600e0b0eaf2a14692de7453c78e1bb)
Comment 5 Yi Zhao 2015-02-04 07:52:27 UTC
This issue still exists in 1.8 M2 RC2 build
git rev: master/22c38e2d8a058619e3d05534b5e830b750aa4241
Comment 6 Ross Burton 2015-03-09 17:43:40 UTC
Thanks to AlanC of xorg fame, there's a patch on the list for this.
Comment 8 Yi Zhao 2015-03-31 07:46:19 UTC
Verified with 1.8 M4 rc1.

The segfault disappeared. But there are still some error message. I filed a new bug 7543.