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

using xrandr with external monitor - unhandled error #71

Closed
Jehops opened this issue Mar 6, 2014 · 13 comments
Closed

using xrandr with external monitor - unhandled error #71

Jehops opened this issue Mar 6, 2014 · 13 comments
Labels

Comments

@Jehops
Copy link
Contributor

Jehops commented Mar 6, 2014

  1. Use an external monitor:
    xrandr --output VGA1 --auto --above LVDS1 --output LVDS1 --auto
  2. Stop using external monitor:
    xrandr --output VGA1 --off

This results in the unhandled error pasted at the bottom. I recently updated to 0.9.8-14-g61a7cf2 compiled with sbcl 1.1.12,1 on FreeBSD 9-STABLE amd64 running Xorg-server 1.12.4_4,1. I didn't see this error in the past. If there is any other information I can offer, please let me know.

The value NIL is not of type STUMPWM::FRAME.
Backtrace for: #<SB-THREAD:THREAD "main thread" RUNNING {1003E84023}>
0: ((:METHOD STUMPWM::GROUP-CURRENT-WINDOW (STUMPWM::TILE-GROUP)) #<STUMPWM::TILE-GROUP {10054F7773}>) [fast-method]
1: (STUMPWM::HIDE-WINDOW #S(TILE-WINDOW "New Issue · stumpwm/stumpwm - Conkeror" #x1000070))
2: ((:METHOD STUMPWM::GROUP-REMOVE-HEAD (STUMPWM::TILE-GROUP T)) #<STUMPWM::TILE-GROUP {10054F7773}> #S(frame 1 NIL 0 0 1366 768)) [fast-method]
3: (STUMPWM::REMOVE-HEAD #S<screen #<XLIB:SCREEN :0.0 1366x768x24 TRUE-COLOR>> #S(frame 1 NIL 0 0 1366 768))
4: (STUMPWM::SCALE-SCREEN #S<screen #<XLIB:SCREEN :0.0 1366x768x24 TRUE-COLOR>> (#S(frame 0 NIL 0 0 1366 768)))
5: ((LABELS #:G110 :IN "/usr/home/jrm/scm/stumpwm.git/events.lisp") :STACK-MODE NIL :WINDOW #<XLIB:WINDOW :0 A7> :X 0 :Y 0 :WIDTH 1680 :HEIGHT 1818 :BORDER-WIDTH 0 :VALUE-MASK NIL)
6: (STUMPWM::HANDLE-EVENT :DISPLAY #<XLIB:DISPLAY :0 (The X.Org Foundation R11204000)> :EVENT-KEY :CONFIGURE-NOTIFY :EVENT-CODE 22 :SEND-EVENT-P NIL :SEQUENCE 29768 :EVENT-WINDOW #<XLIB:WINDOW :0 A7> :WINDOW #<XLIB:WINDOW :0 A7> :ABOVE-SIBLING NIL :X 0 :Y 0 :WIDTH 1680 :HEIGHT 1818 :BORDER-WIDTH 0 :OVERRIDE-REDIRECT-P NIL)
7: ((FLET SB-THREAD::WITH-RECURSIVE-LOCK-THUNK :IN XLIB:PROCESS-EVENT))
8: ((FLET SB-IMPL::TIMEOUT-BODY :IN XLIB:PROCESS-EVENT))
9: (XLIB:PROCESS-EVENT #<XLIB:DISPLAY :0 (The X.Org Foundation R11204000)> :HANDLER # :TIMEOUT 0 :PEEK-P NIL :DISCARD-P NIL :FORCE-OUTPUT-P T)
10: (STUMPWM::STUMPWM-INTERNAL-LOOP)
11: (STUMPWM::STUMPWM-INTERNAL ":0")
12: (STUMPWM ":0")
13: ((LAMBDA NIL :IN "/usr/home/jrm/scm/stumpwm.git/make-image.lisp"))
14: ((FLET #:WITHOUT-INTERRUPTS-BODY-54 :IN SB-EXT:SAVE-LISP-AND-DIE))
15: ((LABELS SB-IMPL::RESTART-LISP :IN SB-EXT:SAVE-LISP-AND-DIE))

@dmb2
Copy link
Contributor

dmb2 commented Mar 12, 2014

I tried to reproduce this, and I couldn't. It looks like something is nil when it should be defined, but without a way to reproduce it myself I can't handle the nil case properly. Is it possible this is a freebsd thing?

@Jehops
Copy link
Contributor Author

Jehops commented Mar 23, 2014

dbjergaard notifications@github.com writes:

I tried to reproduce this, and I couldn't. It looks like something is
nil when it should be defined, but without a way to reproduce it
myself I can't handle the nil case properly. Is it possible this is a
freebsd thing?

I'm not sure. Do you haven any suggestions for pinning this down? Is
there a way to step through the code while the unhandled error occurs?

Joseph

@dmb2
Copy link
Contributor

dmb2 commented Jun 25, 2014

Please use this issue for further discussion

@theotherjimmy
Copy link

I don't think it is a freebsd issue, as this also has affected my archlinux box for something like 8 months. It showed up first when I started using an external monitor.

@erjoalgo
Copy link
Contributor

I am affected by this on Debian. It seems to only happen when there are frames in the monitor that is turned off by xrandr.

@dmb2
Copy link
Contributor

dmb2 commented Jul 21, 2014

To be clear, if I run the steps to reproduce on an empty desktop, it will work as expected. But if I put windows on the external monitor, then run the xrandr commands, stump will crash?

@dmb2
Copy link
Contributor

dmb2 commented Jul 21, 2014

Put another way:
Can someone post their configuration ( stumpwmrc, xinitrc, Xsession, etc) with instructions on how X11 is configured to run stumpwm, as well as how they start stumpwm (startx, lightdm, etc). In addition, a set of commands that can be typed in the terminal that reproduces this behavior (included what windows are configured where, use xterm as dummy windows)? I can then replicate the configuration on my machine and (hopefully) reproduce the crash.

I know this seems like a lot to ask, but I can't for the life of me reproduce this on my machines.

@Jehops
Copy link
Contributor Author

Jehops commented Jul 21, 2014

David Bjergaard notifications@github.com writes:

Can someone post their configuration ( stumpwmrc, xinitrc, Xsession, etc) with
instructions on how X11 is configured to run stumpwm, as well as how they start
stumpwm (startx, lightdm, etc). In addition, a set of commands that can be
typed in the terminal that reproduces this behavior (included what windows are
configured where, use xterm as dummy windows)? I can then replicate the
configuration on my machine and (hopefully) reproduce the crash.

Hi,

Whether I start X with startx or with xdm and if I move ~/.stumpwmrc out
of the way and start with a default configuration I can reproduce the
bug following these steps.

Connect an external VGA monitor to my laptop. Run

xrandr --output VGA1 --auto --above LVDS1 --output LVDS1 --auto

then run

xrandr --output VGA1 --off

then do a windowlist.

The error I get, which is different from the one I initially reported
(maybe because I now have no windows open) is:

The value NIL is not of type STUMPWM::FRAME.
Backtrace for: #<SB-THREAD:THREAD "main thread" RUNNING {1003EA4023}>
0: (STUMPWM::FRAME-HEAD #<STUMPWM::TILE-GROUP {1004909873}> NIL)
1: (STUMPWM::SETUP-WIN-GRAVITY #S<screen #<XLIB:SCREEN :0.0 1366x768x24 TRUE-COLOR>> #<XLIB:WINDOW :0 C00004> :TOP-RIGHT)
2: (STUMPWM::SETUP-MESSAGE-WINDOW #S<screen #<XLIB:SCREEN :0.0 1366x768x24 TRUE-COLOR>> 3 495)
3: (STUMPWM::ECHO-STRING-LIST #S<screen #<XLIB:SCREEN :0.0 1366x768x24 TRUE-COLOR>> ("^B^1_Error In Command '^bbanish^B': ^nThe value NIL" " is not of type" " STUMPWM::FRAME."))
4: (STUMPWM::MESSAGE-NO-TIMEOUT "~a" "^B^1_Error In Command '^bbanish^B': ^nThe value NIL
is not of type
STUMPWM::FRAME.")
5: ((LABELS #:G336 :IN "/usr/home/jrm/scm/stumpwm.git/events.lisp") :CODE 28 :STATE 4)
6: (STUMPWM::HANDLE-EVENT :DISPLAY #<XLIB:DISPLAY :0 (The X.Org Foundation R11204000)> :EVENT-KEY :KEY-PRESS :EVENT-CODE 2 :SEND-EVENT-P NIL :CODE 28 :SEQUENCE 577 :TIME 12992248 :ROOT #<XLIB:WINDOW :0 A7> :WINDOW #<XLIB:WINDOW :0 C00002> :EVENT-WINDOW #<XLIB:WINDOW :0 C00002> :CHILD NIL :ROOT-X 683 :ROOT-Y 767 :X 683 :Y 767 :STATE 4 :SAME-SCREEN-P T)
7: ((FLET SB-THREAD::WITH-RECURSIVE-LOCK-THUNK :IN XLIB:PROCESS-EVENT))
8: ((FLET SB-IMPL::TIMEOUT-BODY :IN XLIB:PROCESS-EVENT))
9: (XLIB:PROCESS-EVENT #<XLIB:DISPLAY :0 (The X.Org Foundation R11204000)> :HANDLER # :TIMEOUT 0 :PEEK-P NIL :DISCARD-P NIL :FORCE-OUTPUT-P T)
10: (STUMPWM::STUMPWM-INTERNAL-LOOP)
11: (STUMPWM::STUMPWM-INTERNAL ":0")
12: (STUMPWM ":0")
13: ((LAMBDA NIL :IN "/usr/home/jrm/scm/stumpwm.git/make-image.lisp"))
14: ((FLET #:WITHOUT-INTERRUPTS-BODY-54 :IN SB-EXT:SAVE-LISP-AND-DIE))
15: ((LABELS SB-IMPL::RESTART-LISP :IN SB-EXT:SAVE-LISP-AND-DIE))

The package versions I have running on the laptop are
http://slexy.org/view/s2dp0DoQhJ.

I also have two monitors connected to my desktop at work and I just
tried the same test, but there was no error. The desktop is running the
same stumpwm code, FreeBSD i386 with these packages
http://slexy.org/view/s21sstPKHb. These two monitor are identical. I
wonder if the difference in the aspect ratios between the laptop screen
and the external monitor is relevant?

Just let me know if there is anything else I can test.

Joseph

@dmb2
Copy link
Contributor

dmb2 commented Jul 21, 2014

Could you please post your .xinitrc or .xsession, as well as steps from turning the computer on to when the crash happens. I gather that this is what is happening:

  1. Computer boots up
  2. login without graphical login manager
  3. type 'startx'
  4. stumpwm starts
  5. hotplug external monitor
  6. type 'xrandr --output VGA1 --auto --above LVDS1 --output LVDS1 --auto' from an xterm
  7. move a window onto the external screen
  8. type 'xrandr --output VGA1 --off'
  9. type 'C-t ; windowlist RET'
  10. crash.

At this point, I'm much less interested in the stack trace as I am in reproducing the effect myself.

@Jehops
Copy link
Contributor Author

Jehops commented Jul 22, 2014

David Bjergaard notifications@github.com writes:

Could you please post your .xinitrc or .xsession, ...

Here is /.xinitrc (/.xsession is a symbolic link to ~/.xinitrc):
http://slexy.org/view/s213yfbwGo.

as well as steps from turning
the computer on to when the crash happens. I gather that this is what is
happening:

  1. Computer boots up
  2. login without graphical login manager
  3. type 'startx'

I can 1. log in with xdm or 2. without a login manger then type 'startx. It
makes no difference. The crash happens regardless.

  1. stumpwm starts
  2. hotplug external monitor

The external monitor is connected with a vga cable, so it makes no
difference if I have it plugged in before I turn the laptop on or after
Xorg has started. The crash happens regardless.

  1. type 'xrandr --output VGA1 --auto --above LVDS1 --output LVDS1 --auto' from an xterm
  2. move a window onto the external screen

I don't have to open any windows or even switch focus to the external
monitor. In other words, step 7. can be omitted.

  1. type 'xrandr --output VGA1 --off'
  2. type 'C-t ; windowlist RET'
  3. crash.

That's it.

At this point, I'm much less interested in the stack trace as I am in
reproducing the effect myself.

Feel free to ask anything else. I'll do my best to help isolate the
problem.

Joseph

@girzel
Copy link

girzel commented Jul 22, 2014

I get this every time, regardless of how many windows are open and where. I have no desktop environment. .xinitrc looks like this:

xsetroot -cursor_name left_ptr

export GTK_IM_MODULE=fcitx

export XMODIFIERS="@im=fcitx"

export QT_IM_MODULE=fcitx

exec /usr/local/bin/stumpwm

I start out with the external monitor plugged in (though it also happens if I plug it in later). I run "startx", X starts and my desktop is mirrored on the larger, external monitor. I open an xterm, and run the shell script ~/.screenlayout/two.sh, which contains:

#!/bin/sh
xrandr --output LVDS1 --mode 1280x800 --pos 1440x100 --rotate normal --output DP1 --off --output VGA1 --mode 1440x900 --pos 0x0 --rotate normal

Then immediately after I run ~/.screenlayout/one.sh, which contains:

#!/bin/sh
xrandr --output LVDS1 --mode 1280x800 --pos 0x0 --rotate normal --output DP1 --off --output VGA1 --off

And it crashes. I haven't opened any windows or even really issued any StumpWM commands at all, apart from that one xterm window.

@dmb2
Copy link
Contributor

dmb2 commented Jul 22, 2014

OK, I reproduced the issue! I was running unity-settings-daemon which is hijacking some of the XLIB events (it is also causing strange external monitor behavior). That's a separate issue though. For now, I have a procedure to reproduce the bug, and I have the region of the code. Now I just need some time to figure it out. Unless someone else can jump on the hacking wagon. Here's my minimal reproduction steps:

  1. Get latest head of stumpwm (confirmed with sbcl 1.1.14.debian)
  2. Make/build the head
  3. echo "exec /path/to/stumpwm/stumpwm" > ~/.xinitrc #WARNING will remove existing .xinitrc
  4. mv .stumpwmrc{,.bak}
  5. log out, no external monitors attached (just to make sure lightdm doesn't mess with anything in ubuntu 14.04
  6. log in
  7. C-t c to open xterm
  8. xrandr --output HDMI1 --auto --above LVDS1 --output LVDS1 --auto
  9. C-t ; windowlist RET
  10. xrandr --output HDMI1 --off
  11. Enjoy the crash!

@dmb2 dmb2 closed this as completed in 3e9b24b Jul 22, 2014
dmb2 pushed a commit that referenced this issue Jul 22, 2014
Guess removed head by frame number. Fixes #71
@Jehops
Copy link
Contributor Author

Jehops commented Jul 22, 2014

David Bjergaard notifications@github.com writes:

Closed #71 via 3e9b24b.

Confirmed. Thanks!

Joseph

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

No branches or pull requests

5 participants