chjj / compton

A compositor for X11.
Other
2.25k stars 499 forks source link

compton -b segfault #176

Open SergeiAlekseev opened 10 years ago

SergeiAlekseev commented 10 years ago

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 commented 10 years ago
  1. Many drivers don't like how we move GLX context between processes when -b is active. See #161 and #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 commented 10 years ago

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

richardgv commented 10 years ago
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 commented 10 years ago

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

richardgv commented 10 years ago

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

SergeiAlekseev commented 10 years ago

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 commented 10 years ago

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 commented 10 years ago

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 commented 10 years ago

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 commented 10 years ago

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 commented 10 years ago

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

richardgv commented 10 years ago

@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 commented 10 years ago

@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:

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

merenbach commented 10 years ago

@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!