Opened 12 years ago

Closed 11 years ago

#38993 closed defect (fixed)

xorg-server, xorg-server-devel crash at "damageValidateGC"

Reported by: kurtjaeke@… Owned by: jeremyhu (Jeremy Huddleston Sequoia)
Priority: Normal Milestone:
Component: ports Version: 2.1.3
Keywords: Cc: razzfazz (Daniel Becker), astrofitz (Michael Fitzgerald), lpsinger (Leo Singer), snarkhunter (Steve Langer), cooljeanius (Eric Gallager)
Port: xorg-server xorg-server-devel

Description

With the latest xorg-server, I started experiencing a series of crashes:

Crashed Thread:  2

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000023

VM Regions Near 0x23:
--> 
   __TEXT                 00000001035cf000-00000001037aa000 [ 1900K] r-x/rwx SM=COW  /Applications/MacPorts/X11.app/Contents/MacOS/X11.bin

Application Specific Information:
X.Org X Server 1.14.99.0 Build Date: 20130503

Thread 2 Crashed:
0   X11.bin                       	0x0000000103656777 damageValidateGC + 183
1   X11.bin                       	0x00000001035ea57e RootlessValidateGC + 174
2   X11.bin                       	0x00000001036bac9d ValidateGC + 29
3   X11.bin                       	0x00000001036a8c01 ProcPutImage + 161
4   X11.bin                       	0x00000001036a5f2b Dispatch + 891
5   X11.bin                       	0x00000001035f8271 dix_main + 977
6   X11.bin                       	0x00000001035e1c66 server_thread + 38
7   libsystem_c.dylib             	0x00007fff89b937a2 _pthread_start + 327
8   libsystem_c.dylib             	0x00007fff89b801e1 thread_start + 13

These happen with both xorg-server and xorg-server-devel.

Attachments (3)

xorg-crash.log (41.2 KB) - added by kurtjaeke@… 12 years ago.
Full crash log.
X11-20130624.crash (29.4 KB) - added by astrofitz (Michael Fitzgerald) 11 years ago.
mypatch.diff (515 bytes) - added by astrofitz (Michael Fitzgerald) 11 years ago.

Download all attachments as: .zip

Change History (38)

comment:1 Changed 12 years ago by larryv (Lawrence Velázquez)

Cc: jeremyhu@… removed
Owner: changed from macports-tickets@… to jeremyhu@…
Port: xorg-server, xorg-server-develxorg-server xorg-server-devel
Priority: HighNormal

Thanks. In the future, please do not set the Priority field.

comment:2 Changed 12 years ago by kurtjaeke@…

I intentionally set the priority field, as this bug makes it impossible for me to use X11 applications.

As of now, the crash has happened every time I used X. I should have said so in the initial report.

comment:3 in reply to:  2 ; Changed 12 years ago by larryv (Lawrence Velázquez)

Replying to kurtjaeke@…:

I intentionally set the priority field, as this bug makes it impossible for me to use X11 applications.

The Priority field is reserved for MacPorts team members.

It would probably be helpful if you attached a full crash report.

comment:4 Changed 12 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Port: xorg-server removed

Also, you can certainly use xorg-server instead of xorg-server-devel

comment:5 in reply to:  4 Changed 12 years ago by larryv (Lawrence Velázquez)

Replying to jeremyhu@…:

Also, you can certainly use xorg-server instead of xorg-server-devel

OP mentioned having this problem with both ports.

Changed 12 years ago by kurtjaeke@…

Attachment: xorg-crash.log added

Full crash log.

comment:6 in reply to:  3 Changed 12 years ago by kurtjaeke@…

Replying to larryv@…:

It would probably be helpful if you attached a full crash report.

Here you are!

comment:7 Changed 12 years ago by kurtjaeke@…

I played a little with "git bisect".

Upstream commit 4dc2a76740d921c824a4d8193f39dd373475f02a ("http://cgit.freedesktop.org/xorg/xserver/commit/?id=4dc2a76740d921c824a4d8193f39dd373475f02a") causes the problems I see. Reverting the following part of the first hunk makes this issue go away for me:

diff --git a/miext/damage/damage.c b/miext/damage/damage.c
index 2d2b422..a98c20e 100644
--- a/miext/damage/damage.c
+++ b/miext/damage/damage.c
@@ -436,9 +436,13 @@ damageCreateGC(GCPtr pGC)
static void
damageValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable)
{
DAMAGE_GC_FUNC_PROLOGUE(pGC);
(*pGC->funcs->ValidateGC) (pGC, changes, pDrawable);
- pGCPriv->ops = pGC->ops; /* just so it's not NULL */
+ if (pDamage)
+ pGCPriv->ops = pGC->ops; /* so it's not NULL, so FUNC_EPILOGUE does work */
+ else
+ pGCPriv->ops = NULL;
DAMAGE_GC_FUNC_EPILOGUE(pGC);
}

This is where my investigation stops.

What's next?

comment:8 Changed 11 years ago by razzfazz (Daniel Becker)

Cc: razzfazz@… added

Cc Me!

comment:9 Changed 11 years ago by razzfazz (Daniel Becker)

Seeing the same issue, even after reinstalling MacPorts from scratch. This is on 10.8.3.

comment:10 in reply to:  9 Changed 11 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Replying to razzfazz@…:

Seeing the same issue, even after reinstalling MacPorts from scratch. This is on 10.8.3.

I'm not sure why you seem to think reinstalling MacPorts from scratch would fix a bug … I would certainly expect you to hit this issue until it is fixed.

comment:11 Changed 11 years ago by razzfazz (Daniel Becker)

Figured it might just be some bad dependency issue; reinstalling everything (I really should have said "all ports," not "MacPorts" itself) seemed like an easy way of ruling that out.

comment:12 Changed 11 years ago by razzfazz (Daniel Becker)

Oh, and I'm seeing this with the regular xorg-server port, not xorg-server-devel. Would it make sense to update the "Port" field, seeing as how xorg-server seems a bit more critical? (For the -devel version, issues like this seem a bit more expected.)

comment:13 Changed 11 years ago by larryv (Lawrence Velázquez)

Port: xorg-server added

comment:14 Changed 11 years ago by astrofitz (Michael Fitzgerald)

Cc: astrofitz@… added

Cc Me!

Changed 11 years ago by astrofitz (Michael Fitzgerald)

Attachment: X11-20130624.crash added

comment:15 Changed 11 years ago by astrofitz (Michael Fitzgerald)

I am seeing the same issue on 10.6.8. It always occurs when I am resizing the ds9 application's window after launch. I have attached a crash report.

Version 0, edited 11 years ago by astrofitz (Michael Fitzgerald) (next)

comment:16 Changed 11 years ago by razzfazz (Daniel Becker)

So is this issue specific to MacPorts and/or MacOS, or would this be fixed by importing a more recent upstream version? Is anybody looking into this issue at all?

comment:17 Changed 11 years ago by lpsinger (Leo Singer)

Does it happen every time that you resize the DS9 window immediately after launch? Do you have to have a FITS file open?

I am not experiencing this crash on Mountain Lion.

comment:18 Changed 11 years ago by lpsinger (Leo Singer)

Cc: aronnax@… added

Cc Me!

comment:19 Changed 11 years ago by astrofitz (Michael Fitzgerald)

After running many trials, I can now revise the statement to say that it doesn't always happen when resizing the ds9 window immediately after launch (no FITS file required), but fairly shortly thereafter. The X11.app crash occurs when doing X-type operations on the ds9 window, including window resize, manipulating drop-down menus, and sometimes just receiving mouse focus.

comment:20 Changed 11 years ago by lpsinger (Leo Singer)

I don't know if it's related, but DS9 just crashed on me while I was trying draw an ellipse region. This is the only terminal output it gave me:

XIO:  fatal IO error 35 (Resource temporarily unavailable) on X server "/tmp/launch-zvBHxr/org.macports:0"

comment:21 Changed 11 years ago by snarkhunter (Steve Langer)

Cc: stephen.langer@… added

Cc Me!

comment:22 in reply to:  7 Changed 11 years ago by astrofitz (Michael Fitzgerald)

Replying to kurtjaeke@…:

I reverted the change you found, and it also resolved the issue I was having with xorg-server/ds9. Thanks for the investigation! I am attaching the patch file I used for convenience.

Changed 11 years ago by astrofitz (Michael Fitzgerald)

Attachment: mypatch.diff added

comment:23 Changed 11 years ago by lpsinger (Leo Singer)

This xorg-server patch worked for me to. I am not an expert on X11. Do we know what that patch does? Is this a regression in xorg-server?

comment:24 Changed 11 years ago by lpsinger (Leo Singer)

Looks like the recent update of xorg-server to 1.14.2 has stopped the DS9 crashes. Can anyone else confirm?

comment:25 in reply to:  24 Changed 11 years ago by kurtjaeke@…

Replying to aronnax@…:

Looks like the recent update of xorg-server to 1.14.2 has stopped the DS9 crashes. Can anyone else confirm?

No. The crashes came back. I applied the patch mentioned above, and they went away.

Jeremy, would you be so kind as to file a bug report upstream? Thank you!

comment:26 in reply to:  24 Changed 11 years ago by lpsinger (Leo Singer)

Replying to aronnax@…:

Looks like the recent update of xorg-server to 1.14.2 has stopped the DS9 crashes. Can anyone else confirm?

Oops. The crash does persist with xorg-server 1.14.2. I just had my original patched version of X11 still running the last time that I tried this.

I did contact the DS9 developers and they said that it looked like a bug in Xorg.

comment:27 Changed 11 years ago by kurtjaeke@…

Any news?

comment:28 Changed 11 years ago by jeremyhu (Jeremy Huddleston Sequoia)

I just sent another email about this to xorg-devel with the suggested fix. I'm not quite sure it's the right fix and want someone more familiar with that code to comment before I commit it.

comment:29 Changed 11 years ago by jeremyhu (Jeremy Huddleston Sequoia)

xorg-server fixed in r112834

comment:30 in reply to:  29 ; Changed 11 years ago by lpsinger (Leo Singer)

Replying to jeremyhu@…:

xorg-server fixed in r112834

I don't see the new patches in files/. Did you commit them?

Did this turn out to be an actual bug? Is a patch on its way upstream?

comment:31 Changed 11 years ago by cooljeanius (Eric Gallager)

Cc: egall@… added

Cc Me!

comment:32 in reply to:  30 Changed 11 years ago by lpsinger (Leo Singer)

Replying to aronnax@…:

Replying to jeremyhu@…:

xorg-server fixed in r112834

I don't see the new patches in files/. Did you commit them?

Oops, I misread the patch.

This fixed the ds9 crash. Thank you!

comment:33 in reply to:  30 Changed 11 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Replying to aronnax@…:

Is a patch on its way upstream?

keithp merged it into master for 1.15. I nominated it for 1.14.x.

xorg-server-devel will be a bit behind in getting this fix because of build issues with current xorg-server git.

comment:34 Changed 11 years ago by kurtjaeke@…

xorg-server now works for mee, too. Thank you!

comment:35 Changed 11 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.