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

compton -b segfault #176

Open
SergeiAlekseev opened this issue Feb 15, 2014 · 14 comments
Open

compton -b segfault #176

SergeiAlekseev opened this issue Feb 15, 2014 · 14 comments

Comments

@SergeiAlekseev
Copy link

Hello.
Segfault when executing compton with -b switch.
"[64201.405495] compton[28824]: segfault at 7fe9be24900c ip 00007fe9bac94c84 sp 00007fff8f305330 error 4 in libnvidia-glcore.so.304.88[7fe9b9944000+19d0000]"
Debian Wheezy amd64, Nvidia driver from stable repo, GF 640GT

@richardgv
Copy link
Collaborator

  1. Many drivers don't like how we move GLX context between processes when -b is active. See Background forking option makes windows disappear #161 and Compton GLX backend does not work on Mesa 10.1 #170.
  2. compton -b works well with nvidia-drivers-334.16 here.
  3. If you are interested in debugging it, please compile a recent version of compton with debugging symbols, acquire a backtrace, and send it to us, together with your configuration file and commandline options.

@SergeiAlekseev
Copy link
Author

How to build compton with debugging symbols?
Please excuse my stupidness)

@richardgv
Copy link
Collaborator

git clone https://github.com/chjj/compton.git
cd compton
CFLAGS=-g make -B
./compton

(Use gmake if you are running BSD.)

Then to acquire a backtrace with gdb, run gdb -ex 'set follow-fork-mode child' --args ./compton -b, wait for it to segfault, and type bt to let gdb print out backtrace.

@SergeiAlekseev
Copy link
Author

http://metafight.ru/files/output.txt
No stack.
There is no segfault in dmesg but compton is not running.

@richardgv
Copy link
Collaborator

Eeeeeh, sorry, I forgot to mention. You must type command run or r in gdb to let it start the program...

@SergeiAlekseev
Copy link
Author

serge@debian:~/compton$ gdb -ex 'set follow-fork-mode child' --args ./compton --backend glx -b
GNU gdb (GDB) 7.4.1-debian
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/...
Reading symbols from /home/serge/compton/compton...done.
(gdb) run
Starting program: /home/serge/compton/compton --backend glx -b
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New process 31898]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff7fbe720 (LWP 31898)]
0x00007ffff4a1dc84 in ?? ()
from /usr/lib/x86_64-linux-gnu/libnvidia-glcore.so.304.88
(gdb) bt
#0 0x00007ffff4a1dc84 in ?? ()
from /usr/lib/x86_64-linux-gnu/libnvidia-glcore.so.304.88
#1 0x00007ffff49ae9fc in ?? ()
from /usr/lib/x86_64-linux-gnu/libnvidia-glcore.so.304.88
#2 0x00007ffff49af777 in ?? ()
from /usr/lib/x86_64-linux-gnu/libnvidia-glcore.so.304.88
#3 0x00007ffff49ac5b2 in ?? ()
from /usr/lib/x86_64-linux-gnu/libnvidia-glcore.so.304.88
#4 0x00007ffff7b3a4be in ?? () from /usr/lib/x86_64-linux-gnu/libGL.so.1
#5 0x00007ffff7b3ac1b in ?? () from /usr/lib/x86_64-linux-gnu/libGL.so.1
#6 0x00007ffff7b42060 in ?? () from /usr/lib/x86_64-linux-gnu/libGL.so.1
#7 0x00000000004144e9 in fork_after (ps=0x6388c0) at src/compton.c:4693
#8 0x000000000041998b in session_init (ps_old=0x0, argc=4,
argv=0x7fffffffe3d8) at src/compton.c:7100
#9 0x000000000041a52f in main (argc=4, argv=0x7fffffffe3d8)
at src/compton.c:7399
(gdb)

@richardgv
Copy link
Collaborator

The segfault is on the glXMakeCurrent() call in new process. Thanks for the info, but I haven't find any reports about such a segfault. I guess the best solution is to stay away from -b. You could also update nvidia-drivers (to 334.16+?), provide us your configuration file and commandline switches to try to reproduce the issue, or check for clues in Xorg.*.log and kernel messages.

@SergeiAlekseev
Copy link
Author

Okay, i can live without -b )
I don't think i can update nv drivers. I have another debian desktop and after installing latest nv drivers, debian just doesn't boot, xorg log stopped at 'initializing glx extensions'.
Command line is 'compton --backend glx -cC'. Configuration file is all defaults, i need just vsync, shadows and terminal background transparency. There is no errors/warnings in xorg/kern logs.
And, some questions: 1/ is it normal - some errors when compton is running:
http://metafight.ru/files/compton-output.txt
2/ when capturing screen and compton is running, xfce panel is flickering:
http://youtu.be/e5mAQx0C_LQ
How to fix it?

@richardgv
Copy link
Collaborator

And, some questions: 1/ is it normal - some errors when compton is running:
http://metafight.ru/files/compton-output.txt

I don't quite understand why there are so many BadRegion popping up, but... It should be alright if you don't see artifacts. See #52.

2/ when capturing screen and compton is running, xfce panel is flickering:
http://youtu.be/e5mAQx0C_LQ
How to fix it?

See #166 (and #129). compton doesn't play too well with video capture. I have no idea why it would occur and what is the correct way to resolve it, and I cannot reproduce it on my own box. Changing backend, messing up with --vsync and optimization options, using --paint-on-overlay, changing screen capture program, etc., that's I've suggested in #166, may bring some changes. And, does anything change if you increase the FPS of screen capture?

@merenbach
Copy link

I had what looked to me like the same issue: with the GLX backend, compton -b (or compton --daemon) on Debian Wheezy 7.6 could be run any number of times with a pgrep compton turning up nothing. When running in non-daemon mode, everything seemed to work. When using the Xrender backend, everything would work. Changing the vsync field from "none" to "opengl" did nothing.

I tried tweaking compile flags and what solved the issue for me was turning on the NO_LIBCONFIG flag, like so:

env NO_LIBCONFIG=1 make && make docs && make install

@merenbach
Copy link

Ah, sorry, followup... I guess that disabled the reading of the config file. Jumped the gun there!

@richardgv
Copy link
Collaborator

@merenbach:

Sorry for the late reply. I was busy with things I don't enjoy but must handle...

Thanks for helping with the problem, still!

Are you able to confirm it's the very bug with the gdb method mentioned in my previous reply?

@merenbach
Copy link

@richardgv You're welcome and no worries. Compton is awesome.

I tried the above directions and maybe did something wrong, as I managed to freeze up X entirely in the process. I can try again when I have a chance. Some stuff I should mention:

  • I use the same setup at two locations--Debian Wheezy, nVidia graphics, and Xfce desktop
  • Xrender works fine at both locations
  • Running with the -b flag and GLX yields a crash at only one location, while everything works fine at the other
  • I had FreeBSD 10 installed at both locations previously. At the location that's currently experiencing issues with the GLX backend, running with GLX before caused all X windows to become white under both i3wm and Xfce. I am afraid I can't recall whether the other location had this issue or not.
  • Although I don't have the graphics card model numbers handy, I'm wondering if somehow the card itself is related; the driver, totally irrelevant to my issue

Please let me know if I may pursue any additional troubleshooting paths.

@merenbach
Copy link

@richardgv A followup. I've returned to FreeBSD on the machine that was having issues and I'm able now to run compton -b with the GLX backend, no problem. I'm more confused now--maybe a newer version of the driver now?

Academically: I'm also using the package management system (pkg) for most things now, where before I compiled from source. It may be that an option I was using before to compile, WITH_NEW_XORG=YES, triggered the original issue for me. If I understand correctly, this option is going to be enabled by default in the upcoming version of FreeBSD (10.1). I may find out then!

tryone144 pushed a commit to tryone144/compton that referenced this issue Dec 20, 2019
Fixes chjj#176

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants