Bug 27768 - [bisected] X fails on 64-bits OS
Summary: [bisected] X fails on 64-bits OS
Status: VERIFIED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Input/evdev (show other bugs)
Version: unspecified
Hardware: All Linux (All)
: high major
Assignee: Peter Hutterer
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-21 01:19 UTC by fangxun
Modified: 2010-04-22 14:54 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Reverts suspected commit (1.00 KB, patch)
2010-04-21 07:43 UTC, Gaetan Nadon
no flags Details | Splinter Review

Description fangxun 2010-04-21 01:19:06 UTC
System Environment:
--------------------------
Platform:        G45
Libdrm:         (master)c7650003c52ee29b7fa5ebf20dd134079f0b8488
Mesa:           (7.8)88be2171e7336201e5ee97ade36ba3de4fe939bf
Xserver:           (master)b3ab978df861c08298f57529e3db980489055c35
Xf86_video_intel:     (master)72fd7d191c33c8d0b75b06ab0717d7ca0d4e019a
Kernel: (master)01bf0b64579ead8a82e7cfc32ae44bc667e7ad0f

Bug detailed description:
-------------------------
X fails to start with error message:
Backtrace:
0: X (xorg_backtrace+0x28) [0x4532e8]
1: X (0x400000+0x581b9) [0x4581b9]
2: /lib64/libc.so.6 (0x30de200000+0x33370) [0x30de233370]
3: /opt/X11R7/lib/xorg/modules/input/evdev_drv.so (0x7f30b3f9e000+0x5284) [0x7f30b3fa3284]
4: /opt/X11R7/lib/xorg/modules/input/evdev_drv.so (0x7f30b3f9e000+0x4be2) [0x7f30b3fa2be2]
5: X (0x400000+0x6a217) [0x46a217]
6: X (NewInputDeviceRequest+0x3c9) [0x46a819]
7: X (0x400000+0x110b46) [0x510b46]
8: X (0x400000+0x111144) [0x511144]
9: X (0x400000+0x111262) [0x511262]
10: X (0x400000+0x110005) [0x510005]
11: X (0x400000+0x52748) [0x452748]
12: X (WaitForSomething+0x4b3) [0x452ce3]
13: X (0x400000+0x47e72) [0x447e72]
14: X (0x400000+0x2180a) [0x42180a]
15: /lib64/libc.so.6 (__libc_start_main+0xfd) [0x30de21ea2d]
16: X (0x400000+0x213b9) [0x4213b9]
Segmentation fault at address 0x230
Fatal server error:
Caught signal 11 (Segmentation fault). Server aborting

This issue happens on 64-bits OS. It works well on 32-bits OS. With bisect and find xf86-input-evdev component causes the problem. 

9dbace89bee55a001e794ccf3ff36e3afeda4715 is first bad commit.
commit 9dbace89bee55a001e794ccf3ff36e3afeda4715
Author: Gaetan Nadon <memsize@videotron.ca>
Date:   Thu Apr 15 13:09:05 2010 -0400

    config: remove AH_TOP autoheader statement

    The generated config.h does not need to include xorg-server.h
    for the content it provides.
    Add #include <xorg-server.h> in .[hc] files as needed.

    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>


Reproduce steps:
----------------
1.xinit&
Comment 1 Gaetan Nadon 2010-04-21 07:43:30 UTC
Created attachment 35207 [details] [review]
Reverts suspected commit

The patch will revert the suspected commit. Development was done on AMD64. Perhaps the patch changed the order of include in a an suspected way.
To speed up things, would you mind testing it?
I don't have a test environment right now.

Here is the diff:

diff --git a/configure.ac b/configure.ac
index da46c68..35c9ce8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -33,6 +33,7 @@ AC_CONFIG_AUX_DIR(.)
 # Initialize Automake
 AM_INIT_AUTOMAKE([foreign dist-bzip2])
 AM_MAINTAINER_MODE
+AH_TOP([#include "xorg-server.h"])
 
 # Initialize libtool
 AC_DISABLE_STATIC
diff --git a/src/evdev.c b/src/evdev.c
index 0678edf..ccea90d 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -30,7 +30,6 @@
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
-#include <xorg-server.h>
 
 #include <X11/keysym.h>
 #include <X11/extensions/XI.h>
Comment 2 Peter Hutterer 2010-04-21 17:59:55 UTC
On Wed, Apr 21, 2010 at 07:43:31AM -0700, bugzilla-daemon@freedesktop.org wrote:
> https://bugs.freedesktop.org/show_bug.cgi?id=27768
> 
> --- Comment #1 from Gaetan Nadon <memsize@videotron.ca> 2010-04-21 07:43:30 PDT ---
> Created an attachment (id=35207)
>  View: https://bugs.freedesktop.org/attachment.cgi?id=35207
>  Review: https://bugs.freedesktop.org/review?bug=27768&attachment=35207
> 
> Reverts suspected commit

applied locally, thanks. 

Gaetan - please use "git revert" to revert patches, it provides some sort of
standardised commit message. I've done this for this patch, just keep it in
mind for next time.

fangxun - can you please confirm that the patch fixes the issue for you?
Comment 3 fangxun 2010-04-21 18:40:06 UTC
I confirm that the patch fixes this issue.
Comment 4 Peter Hutterer 2010-04-21 18:49:19 UTC
reverted, thanks for testing.


commit 539d67505cdb36018bd0e5ef01bd78939eafaadb
Author: Gaetan Nadon <memsize@videotron.ca>
Date:   Thu Apr 22 10:50:55 2010 +1000

    Revert "config: remove AH_TOP autoheader statement"
Comment 5 Gaetan Nadon 2010-04-22 05:49:58 UTC
(In reply to comment #2)
> applied locally, thanks. 
> 
> Gaetan - please use "git revert" to revert patches, it provides some sort of
> standardised commit message. I've done this for this patch, just keep it in
> mind for next time.
It did not work for me. 
$~/xorg/src/driver/xf86-input-evdev$ git revert 9dbace89bee55a001e794ccf3ff36e3afeda4715
Auto-merged configure.ac
CONFLICT (content): Merge conflict in configure.ac
Auto-merged src/evdev.c
Automatic revert failed.  After resolving the conflicts,
mark the corrected paths with 'git add <paths>' or 'git rm <paths>' and commit the result.

> 
> fangxun - can you please confirm that the patch fixes the issue for you?

I checked no symbols from xorg-server.h were used in evdev (save for the version symbol needed by #include <xorgVersion.h>). I noticed for each c file that includes xorg-server.h, the library size increases by 192 bytes. That's probably not desirable. 

fangxun replied while I was writing this comment. Now that means including xorg-server.h in each c file is required even if no symbol is used. That's easy to do, blindly add it above every include config.h. But I would like to understand why.
Comment 6 Michel Dänzer 2010-04-22 06:12:04 UTC
(In reply to comment #5)
> $~/xorg/src/driver/xf86-input-evdev$ git revert
> 9dbace89bee55a001e794ccf3ff36e3afeda4715
> Auto-merged configure.ac
> CONFLICT (content): Merge conflict in configure.ac
> Auto-merged src/evdev.c
> Automatic revert failed.  After resolving the conflicts,
> mark the corrected paths with 'git add <paths>' or 'git rm <paths>' and commit
> the result.

Just fix up the conflict? :)


> I checked no symbols from xorg-server.h were used in evdev (save for the
> version symbol needed by #include <xorgVersion.h>). I noticed for each c file
> that includes xorg-server.h, the library size increases by 192 bytes. That's
> probably not desirable. 

It's probably unavoidable though:

> fangxun replied while I was writing this comment. Now that means including
> xorg-server.h in each c file is required even if no symbol is used. That's easy
> to do, blindly add it above every include config.h. But I would like to
> understand why.

It's probably due to the _XSERVER64 define, which affects the layout of various structs.
Comment 7 Julien Cristau 2010-04-22 07:15:19 UTC
> --- Comment #5 from Gaetan Nadon <memsize@videotron.ca> 2010-04-22 05:49:58 PDT ---
> I checked no symbols from xorg-server.h were used in evdev (save for the
> version symbol needed by #include <xorgVersion.h>). I noticed for each c file
> that includes xorg-server.h, the library size increases by 192 bytes. That's
> probably not desirable. 
> 
did you strip the driver before checking that?
Comment 8 Gaetan Nadon 2010-04-22 10:01:31 UTC
(In reply to comment #7)
> did you strip the driver before checking that?
No. Just an observation, not related to the issue.
Comment 9 Peter Hutterer 2010-04-22 14:54:56 UTC
On Thu, Apr 22, 2010 at 06:12:04AM -0700, bugzilla-daemon@freedesktop.org wrote:
> https://bugs.freedesktop.org/show_bug.cgi?id=27768
> 
> --- Comment #6 from Michel Dänzer <michel@daenzer.net> 2010-04-22 06:12:04 PDT ---
> (In reply to comment #5)
> > $~/xorg/src/driver/xf86-input-evdev$ git revert
> > 9dbace89bee55a001e794ccf3ff36e3afeda4715
> > Auto-merged configure.ac
> > CONFLICT (content): Merge conflict in configure.ac
> > Auto-merged src/evdev.c
> > Automatic revert failed.  After resolving the conflicts,
> > mark the corrected paths with 'git add <paths>' or 'git rm <paths>' and commit
> > the result.
> 
> Just fix up the conflict? :)

yep, that's pretty much it. just edit the file, search for "<<<<<<" and fix
up the conflict. Then git add configure.ac && git commit will give you the
right commit message. it's not different to a rebasing or merging conflict.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.