Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash during dragging #1

Closed
redfield opened this issue Jan 12, 2012 · 12 comments
Closed

Crash during dragging #1

redfield opened this issue Jan 12, 2012 · 12 comments

Comments

@redfield
Copy link

Compton crashes during dragging smth (chromium tab, file/folder in PCManFM and so on) with following errors:

error 3 (Unknown) request 20 minor 0 serial 5388
error 3 (Unknown) request 15 minor 0 serial 5389
Segmentation fault

With -S option crash does not observe.

Archlinux, Openbox 3.5, xf86-video-intel 2.17

@chjj
Copy link
Owner

chjj commented Jan 12, 2012

Hmmm, I thought I had fixed all the segfaults from chrome tabs. It can't seem to reproduce it with ob 3.5.

What options did you have set? Can you avoid the segfault by not using certain options? If you can work your way around gdb, or just enable the DEBUG_EVENTS def, recompile, and start compton from a terminal, what is the last event and serial before you get the segfault? It would help out a lot.

@redfield
Copy link
Author

After recompiling with enabled DEBUG_EVENTS:

event Event 16 serial 0x00003972 window 0x00000000
error 3 (Unknown) request 20 minor 0 serial 14709
error 3 (Unknown) request 15 minor 0 serial 14710
Segmentation fault

Crashes stably observed with whatever (or without) options except -S.

@chjj
Copy link
Owner

chjj commented Jan 14, 2012

Hmm, you'll have to help me again. I need to rule something out here, and I can't reproduce this myself no matter what I do.

Could you uncomment line 2501, build, and try dragging a chromium tab?

@redfield
Copy link
Author

Ok, it completly prevents crashes, but chromium tab becomes invisible while dragging =)
I run compton with -cC options.

@chjj
Copy link
Owner

chjj commented Jan 14, 2012

Okay, now I have a lead. I'll see what I can do. Thanks for the help.

@chjj
Copy link
Owner

chjj commented Jan 14, 2012

a6afff2
01e978a

That should fix the segfault and errors. Let me know if it works.

@redfield
Copy link
Author

Sad, but it didn't help. This is a log from the moment when i moved mouse to chromium tab, clicked and started dragging:

$ compton -cC
event Event 16 serial 0x00000944 window 0x00000000
event Event 22 serial 0x00000947 window 0x00000000
event Map serial 0x00000945 window 0x0140e2f2
event Event 10 serial 0x00000a16 window 0x00000000
event Event 9 serial 0x00000a15 window 0x00000000
event Event 22 serial 0x00000a4d window 0x00000000
event Event 28 serial 0x00000a52 window 0x00000000
event Unmap serial 0x00000aa5 window 0x0140e2f2
event Unmap serial 0x00000aaa window 0x0140e2f2
event Event 28 serial 0x00000af2 window 0x00000000
event Event 28 serial 0x00000bb6 window 0x00000000
event Event 17 serial 0x00000c48 window 0x00000000
event Event 16 serial 0x00000c94 window 0x00000000
event Event 16 serial 0x00000c96 window 0x00000000
event Event 22 serial 0x00000c9b window 0x00000000
event Map serial 0x00000c95 window 0x0140e340
event Event 22 serial 0x00000cfc window 0x00000000
event Event 22 serial 0x00000d58 window 0x00000000
event Event 22 serial 0x00000db4 window 0x00000000
event Event 22 serial 0x00000e89 window 0x00000000
event Event 16 serial 0x00000ee5 window 0x00000000
Segmentation fault

Same actions but with folder in pcmanfm:

$ compton -cC
event Event 10 serial 0x00000884 window 0x00000000
event Event 9 serial 0x00000883 window 0x00000000
event Event 22 serial 0x000008b5 window 0x00000000
event Event 28 serial 0x000008ba window 0x00000000
event Event 28 serial 0x00000907 window 0x00000000
event Event 28 serial 0x00000969 window 0x00000000
event Event 16 serial 0x00000a2d window 0x00000000
Segmentation fault

@chjj
Copy link
Owner

chjj commented Jan 15, 2012

71d7352

I'm thinking that commit fixed it. If not, would you mind firing up gdb so I can get a stack trace?

@redfield
Copy link
Author

You did it =). There are no more segfaults and errors. Now compton is the perfect compositor for me. Thanks.

@chjj
Copy link
Owner

chjj commented Jan 15, 2012

Good to hear. Hmm, that bug must exist in the original xcompmgr as well.

It was happening because the original authors of xcompmgr cast -1 to wintype which is an enum. It only returns -1 if the window type can't be determined, which it can't be for popup windows (windows that have override_redirect), e.g. chromium tabs while they're being moved. Since enums are treated as unsigned, the cast turns -1 into 4294967295. It ultimately ended up trying to access win_type_fade[4294967295], when there are only about 9 different window types. This happened in another spot before, but I caught it. I missed this one unfortunately.

@redfield
Copy link
Author

Original xcompmgr (from arch repos) doesn't crash with segfault but prints this:

$ xcompmgr -cC

error 9: BadDrawable (invalid Pixmap or Window parameter) request 153 minor 1 serial 4690
error 3: BadWindow (invalid Window parameter) request 20 minor 0 serial 4691
error 3: BadWindow (invalid Window parameter) request 15 minor 0 serial 4692
error 3: BadWindow (invalid Window parameter) request 2 minor 0 serial 4693
error 3: BadWindow (invalid Window parameter) request 20 minor 0 serial 4694
error 3: BadWindow (invalid Window parameter) request 2 minor 0 serial 4695
error 3: BadWindow (invalid Window parameter) request 20 minor 0 serial 4696

And even don't try to draw shadow around the chromium tab during dragging.

@chjj
Copy link
Owner

chjj commented Jan 15, 2012

Oh, I see what happened. Someone who forked it in between its transit away from the freedesktop repo added this array system for checking fades, shadows, and opacity, but they didn't take into account the fact that determine_wintype returns a -1 cast into an enum. So it ended with random segfaults everywhere, that didn't always happen. I'll be improving this system a little bit instead of patching it to make it work.

edit: 51e2eec

Anyway, thank you for all your help in tracking down this bug. This was something that really had to be dealt with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants