Skip to content
This repository has been archived by the owner on Nov 21, 2019. It is now read-only.

crash #10

Closed
mateidavid opened this issue Feb 7, 2013 · 6 comments
Closed

crash #10

mateidavid opened this issue Feb 7, 2013 · 6 comments

Comments

@mateidavid
Copy link

Thanks for the great software, it enables me to use a displayport output on a T420. I haven't booted up Win7 since.

I have a recurring issue though. I'm not sure this is the right forum for it; if not, please let me know where is a better place to ask this. I'm using Mint 13 KDE, with kde 4.8.5 and bumblebee 3.0.1.

I have a recurring issue though. When I come in to the office, I do:
$ optirun true
$ xrandr --output LVDS1 --off --output VIRTUAL --mode 1920x1200 --output VGA1 --auto --primary --right-of VIRTUAL
$ screenclone -d :8 -x 1

Everything works fine. At the end of the day I kill the X server on DISPLAY=:8, then
$ rmmod nvidia
$ echo "OFF" | tee /proc/acpi/bbswitch
$ xrandr --output LVDS1 --mode 1600x900 --primary --output VIRTUAL --off --output VGA1 --off

However, the next day when I get to the office and start again at the top, screenclone crashes after a few minutes of use. I can't pinpoint a cause, sometimes when I switch the desktop, or when I click on a menu entry of some window, but I doubt that's exhaustive. It's not immediate though, I can write a few things in a window that's already open. I get these hints about the crash:

in apport.log:
called for pid 9413, signal 11
executable: /usr/bin/screenclone (command line "screenclone -d :8 -x 1")
gdbus call failed, cannot determine running session: [Errno 2] No such file or directory

(why gdbus? I'm on kde with only dbus running)

in both kern.log and syslog:
[66532.270791] screenclone[9413]: segfault at 4 ip 0000000000404802 sp 00007fff8c5a1a40 error 4 in screenclone[400000+b000]

After I log out and back in, everything works again until the next day. But that's almost like restarting every day... Have you heard of this issue? Thanks!

@liskin
Copy link
Owner

liskin commented Feb 7, 2013

Never heard of it. I'll need a backtrace, though. Reading this should give you an idea how to get one:
http://www.gentoo.org/proj/en/qa/backtraces.xml
Or, if you can afford to run screenclone in a (minimized) terminal, just do "gdc --args screenclone -d :8 -x 1", type "run" and when it crashes, "thread apply all bt".

@mateidavid
Copy link
Author

I tried to generate the crash and succeeded after a sleep/resume cycle. I'm not sure how to keep the formatting. Anyhow, it looks like the SIGSEGV comes from screenclone.cc:341.

$ gdb --args screenclone -d :8 -x 1
GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2.1) 7.4-2012.04
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://bugs.launchpad.net/gdb-linaro/...
Reading symbols from /usr/bin/screenclone...done.
(gdb) run
Starting program: /usr/bin/screenclone -d :8 -x 1
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff4d8b700 (LWP 14680)]

Program received signal SIGSEGV, Segmentation fault.
0x0000000000404802 in mouse_replayer::cursor_changed (this=0x7fffffffd860) at screenclone.cc:341
341 screenclone.cc: No such file or directory.
(gdb) bt
#0 0x0000000000404802 in mouse_replayer::cursor_changed (this=0x7fffffffd860) at screenclone.cc:341
#1 0x0000000000403b1a in main (argc=5, argv=0x7fffffffd9f8) at screenclone.cc:429
(gdb) thread apply all bt

Thread 2 (Thread 0x7ffff4d8b700 (LWP 14680)):
#0 0x00007ffff688b023 in select () at ../sysdeps/unix/syscall-template.S:82
#1 0x0000000000405569 in record_thread<mouse_replayer> (data=..., callback=0x7fffffffd860) at screenclone.cc:137
#2 0x00000000004074b7 in std::_Bind_result<void, void ((display, mouse_replayer))(display, mouse_replayer*)>::__call<void, , 0, 1>(std::tuple<>&&, std::_Index_tuple<0, 1>, std::_Bind_result<void, void ((display, mouse_replayer))(display, mouse_replayer*)>::__enable_if_void::type) (this=0x648c98,
__args=...) at /usr/include/c++/4.6/functional:1287
#3 0x00000000004073f9 in std::_Bind_result<void, void ((display, mouse_replayer))(display, mouse_replayer*)>::operator()<>() (this=0x648c98)
at /usr/include/c++/4.6/functional:1378
#4 0x0000000000407338 in std::thread::_Impl<std::_Bind_result<void, void ((display, mouse_replayer))(display, mouse_replayer*)> >::_M_run() (
this=0x648c80) at /usr/include/c++/4.6/thread:117
#5 0x00007ffff6ddfc78 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#6 0x00007ffff7bc4e9a in start_thread (arg=0x7ffff4d8b700) at pthread_create.c:308
#7 0x00007ffff6891cbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#8 0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7ffff7fc8740 (LWP 14677)):
#0 0x0000000000404802 in mouse_replayer::cursor_changed (this=0x7fffffffd860) at screenclone.cc:341
#1 0x0000000000403b1a in main (argc=5, argv=0x7fffffffd9f8) at screenclone.cc:429
(gdb)

@liskin
Copy link
Owner

liskin commented Feb 8, 2013

Interesting. Seems like XFixesGetCursorImage returns NULL. I pushed a fix, please try if it helps.

@mateidavid
Copy link
Author

I can now replicate the crash, probably until I log out and back in. It seems to occur in specific circumstances:

  • When I select a window on the virtual screen, then switch desktop using a keyboard binding. Still not always though. If relevant, I'm using policy:focus follows mouse, focus steal prevention:low, delay:300ms, click raises active window, active screen follows mouse.
  • When I click on a menu button of firefox running on the virtual screen. Again, not always, which is frustrating. My feeling is that this depends on a stack of actions held somewhere by the window manager.
  • It's always line 341.
    If I do either of the above on the VGA1 monitor, no crash occurs.

I just saw you added a check for the NULL pointer, I'll give it a try later or tomorrow, and let you know. Thanks!

@mateidavid
Copy link
Author

Thanks so much, it seems to be working just fine. I know C but not X, so I don't know what that function does. But the behaviour seems to change at some point. I saw no crashes with the old version before e.g. a sleep/resume cycle (hence no NULLs returned). Should I report this somewhere, and if so, do you know where? Thanks again

@liskin
Copy link
Owner

liskin commented Feb 9, 2013

http://lists.x.org/mailman/listinfo/xorg-devel seems to be the best place to ask. Please let me know if you get any interesting anwers. :-)

@liskin liskin closed this as completed Feb 9, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants