From owner-freebsd-stable@FreeBSD.ORG Sun Aug 31 07:00:57 2014 Return-Path: Delivered-To: stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3766D4B9; Sun, 31 Aug 2014 07:00:57 +0000 (UTC) Received: from mailout09.t-online.de (mailout09.t-online.de [194.25.134.84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mailout00.t-online.de", Issuer "TeleSec ServerPass DE-1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D89F81075; Sun, 31 Aug 2014 07:00:56 +0000 (UTC) Received: from fwd01.aul.t-online.de (fwd01.aul.t-online.de [172.20.27.147]) by mailout09.t-online.de (Postfix) with SMTP id 043CD628F85; Sun, 31 Aug 2014 08:54:04 +0200 (CEST) Received: from [192.168.119.33] (EkzFaEZHYhsxiLhBL8+PrfwZEhUkU3iRSA0Z4q0Cdmhw0AYCLSTjWRylnCVBJGOQ9d@[84.154.101.219]) by fwd01.t-online.de with (TLSv1.2:ECDHE-RSA-AES256-SHA encrypted) esmtp id 1XNz1S-0ROq9I0; Sun, 31 Aug 2014 08:53:58 +0200 Message-ID: <5402C685.1030507@freebsd.org> Date: Sun, 31 Aug 2014 08:53:57 +0200 From: Stefan Esser User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: Filippo Moretti , x11@freebsd.org Subject: [Analyzed] Re: Problem with xorg References: <1409238190.56909.YahooMailNeo@web140904.mail.bf1.yahoo.com> <53FF6A32.6020509@freebsd.org> In-Reply-To: <53FF6A32.6020509@freebsd.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-ID: EkzFaEZHYhsxiLhBL8+PrfwZEhUkU3iRSA0Z4q0Cdmhw0AYCLSTjWRylnCVBJGOQ9d X-TOI-MSGID: 76a9b127-6fc2-4e6c-97b1-bbf063109170 Cc: "stable@freebsd.org" , Ports FreeBSD X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Aug 2014 07:00:57 -0000 The problem is caused by Unicode code points in keymap files, which were made possible (and have to be used) for many locales after the introduction of Unicode support with vt(4). Am 28.08.2014 um 19:43 schrieb Stefan Esser: > Am 28.08.2014 um 17:03 schrieb Filippo Moretti via freebsd-stable: >> I have problem with xorg with my custom kernel both with and without VT supports. >> I can still reboot with generic and have xorg work.My system:FreeBSD sting 10.0-STABLE FreeBSD 10.0-STABLE #0 r269789: Mon Aug 11 02:47:02 UTC 2014 root@grind.freebsd.org:/usr/obj/usr/src/sys/GENERIC i386 >> With my kernel-vt I get a sementation fault,while with SC I got a complete crash > [...] >> [ 3434.354] (**) Option "Protocol" "standard" >> [ 3434.354] (WW) Option "Device" requires an string value >> [ 3434.354] (**) Option "XkbRules" "base" >> [ 3434.354] (**) Option "XkbModel" "pc105" >> [ 3434.354] (**) Option "XkbLayout" "us" >> [ 3434.354] (**) Option "config_info" "hal:/org/freedesktop/Hal/devices/usb_device_46d_c517_noserial_if0" >> [ 3434.354] (II) XINPUT: Adding extended input device "USB Receiver" (type: KEYBOARD, id 7) >> [ 3434.354] Segmentation fault at address 0x2a3da760 >> [ 3434.354] >> Fatal server error: >> [ 3434.354] Caught signal 11 (Segmentation fault). Server aborting >> [ 3434.354] >> [ 3434.355] >> Please consult the The X.Org Foundation support >> at http://wiki.x.org >> for help. >> [ 3434.355] Please also check the log file at "/var/log/Xorg.0.log" for additional information. > > Just a me-to, but on -CURRENT: > > [ 357.752] (**) Keyboard0: always reports core events > [ 357.752] (**) Option "Protocol" "standard" > [ 357.752] (**) Option "XkbRules" "xorg" > [ 357.752] (**) Option "XkbModel" "pc105" > [ 357.752] (**) Option "XkbLayout" "de" > [ 357.752] (**) Option "XkbVariant" "nodeadkeys" > [ 357.752] (II) XINPUT: Adding extended input device "Keyboard0" > (type: KEYBOARD, id 7) > [ 357.752] Segmentation fault at address 0x80500ae80 > [ 357.752] > Fatal server error: > [ 357.752] Caught signal 11 (Segmentation fault). Server aborting Further information: I used ktrace to identify the failing operation. It is in x11-drivers/xf86-input-keyboard line 1265 of bsd_KeyMap.c: #define KD_GET_ENTRY(i,n) \ eascii_to_x[((keymap.key[i].spcl << (n+1)) & 0x100) + keymap.key[i].map[n]] [...] void KbdGetMapping (InputInfoPtr pInfo, KeySymsPtr pKeySyms, CARD8 *pModMap) { KbdDevPtr pKbd = (KbdDevPtr) pInfo->private; KeySym *k; int i; #ifndef __bsdi__ switch (pKbd->consType) { /* * XXX wscons has no GIO_KEYMAP */ #if (defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)) && defined(GIO_KEYMAP) case SYSCONS: case PCVT: { keymap_t keymap; if (ioctl(pInfo->fd, GIO_KEYMAP, &keymap) != -1) { for (i = 0; i < keymap.n_keys && i < NUM_KEYCODES; i++) if (remap[i]) { k = map + (remap[i] << 2); k[0] = KD_GET_ENTRY(i,0); /* non-shifed */ k[1] = KD_GET_ENTRY(i,1); /* shifted */ k[2] = KD_GET_ENTRY(i,4); /* alt */ k[3] = KD_GET_ENTRY(i,5); /* alt - shifted */ if (k[3] == k[2]) k[3] = NoSymbol; if (k[2] == k[1]) k[2] = NoSymbol; if (k[1] == k[0]) k[1] = NoSymbol; if (k[0] == k[2] && k[1] == k[3]) k[2] = k[3] = NoSymbol; } } } break; #endif /* SYSCONS || PCVT */ The keymap returned by ioctl(GIO_KEYMAP) used to contain characters in the selected locale, which meant it was limited to 8 bit values, effectively. Now with Unicode support, larger values (>=0x100) can be found in keymap files. In my case, the Euro symbol (0x20ac) was the cause of an out-of-bounds access to the keymap array in line 1265 of bsd_KbdMap.c (assignment to k[2] for Alt "E"). I did not have time to investigate, how this problem can be resolved, though. But I'll create a ports PR with this information, since it must be resolved before 10.1, or users of keyboard layouts that generate characters beyond u+ff will reliably crash the X server ... Regards, STefan PS: PR ports/193192