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

window watcher crashes on Chrome Task Manager window #27

Open
nikanar opened this issue Nov 21, 2017 · 5 comments
Open

window watcher crashes on Chrome Task Manager window #27

nikanar opened this issue Nov 21, 2017 · 5 comments

Comments

@nikanar
Copy link
Contributor

nikanar commented Nov 21, 2017

Opening chrome's task manager (shortcut : Shift-Escape), a pop-up appears stating :

Module aw-watcher-window quit unexpectedly [Restart] [Show details] [Cancel]

Details are

2017-11-21 17:12:57 [INFO ]: Running watcher with poll time 1.0 seconds  (aw_watcher_window.main:35)
2017-11-21 17:12:57 [INFO ]: aw-watcher-window has started  (aw_watcher_window.main:44)
2017-11-21 17:12:57 [INFO ]: Connection to aw-server established  (aw_client.client:281)
2017-11-21 18:10:56 [ERROR]: Exception thrown while trying to get active window: [Errno 5] Input/output error  (aw_watcher_window.main:69)

Pressing "restarting" in the notification popup only makes it crash again (with the same details), for so long as the active window is chrome's task manager. If I restart the watcher with an other window being active, it restarts fine and is stable. And crashes right again as soon as the task manager becomes active again (as my mouse goes over
it, as focus follows mouse in my awesome wm).

xprop details
_NET_WM_STATE(ATOM) = 
_NET_WM_DESKTOP(CARDINAL) = 7
_NET_FRAME_EXTENTS(CARDINAL) = 0, 0, 0, 0
WM_STATE(WM_STATE):
		window state: Normal
		icon window: 0x0
_NET_WM_USER_TIME(CARDINAL) = 2417562315
WM_NORMAL_HINTS(WM_SIZE_HINTS):
		program specified location: 1150, 20
		program specified minimum size: 460 by 270
WM_NAME(UTF8_STRING) = "Task Manager - Google Chrome"
_NET_WM_NAME(UTF8_STRING) = "Task Manager - Google Chrome"
XdndAware(ATOM) = BITMAP
_MOTIF_WM_HINTS(_MOTIF_WM_HINTS) = 0x2, 0x0, 0x1, 0x0, 0x0
_NET_WM_ICON(CARDINAL) = 	Icon (64 x 64):
                        <chrome icon in ascii>	                                                                
_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_NORMAL
_NET_WM_PID(CARDINAL) = 24459
WM_LOCALE_NAME(STRING) = "en_US.UTF-8"
WM_CLIENT_MACHINE(STRING) = "ker"
WM_PROTOCOLS(ATOM): protocols  WM_DELETE_WINDOW, _NET_WM_PING
@johan-bjareholt
Copy link
Member

johan-bjareholt commented Nov 22, 2017

Oh, that's not good at all.

I seem to not be able to reproduce though, not sure why.

I am currently on my debian machine though, can try on my arch linux machine later today (you are also

12.08s ago
duration10s
title: Task Manager - Google Chrome
app: unknown
xprop details
_GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED(CARDINAL) = 1
_NET_WM_STATE(ATOM) = 
WM_STATE(WM_STATE):
		window state: Normal
		icon window: 0x0
_NET_WM_DESKTOP(CARDINAL) = 1
_NET_FRAME_EXTENTS(CARDINAL) = 1, 1, 39, 1
_NET_WM_ALLOWED_ACTIONS(ATOM) = _NET_WM_ACTION_MOVE,     NET_WM_ACTION_RESIZE, _NET_WM_ACTION_FULLSCREEN, _NET_WM_ACTION_MINIMIZE,  NET_WM_ACTION_SHADE, _NET_WM_ACTION_MAXIMIZE_HORZ,   NET_WM_ACTION_MAXIMIZE_VERT, _NET_WM_ACTION_CHANGE_DESKTOP,  NET_WM_ACTION_CLOSE, _NET_WM_ACTION_ABOVE, _NET_WM_ACTION_BELOW
_NET_WM_USER_TIME(CARDINAL) = 330412
WM_NORMAL_HINTS(WM_SIZE_HINTS):
		program specified location: 1050, 575
		program specified minimum size: 460 by 316
WM_NAME(UTF8_STRING) = "Task Manager - Google Chrome"
_NET_WM_NAME(UTF8_STRING) = "Task Manager - Google Chrome"
XdndAware(ATOM) = BITMAP
_MOTIF_WM_HINTS(_MOTIF_WM_HINTS) = 0x2, 0x0, 0x1, 0x0, 0x0
_NET_WM_ICON(CARDINAL) = 	Icon (64 x 64): <redacted>
_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_NORMAL
_NET_WM_PID(CARDINAL) = 2693
WM_LOCALE_NAME(STRING) = "en_US.utf8"
WM_CLIENT_MACHINE(STRING) = "lnxjohanbj"
WM_PROTOCOLS(ATOM): protocols  WM_DELETE_WINDOW, _NET_WM_PING
aw-watcher-window.log
2017-11-22 08:07:22 [INFO ]: Running watcher with poll time 1.0 seconds  (aw_watcher_window.main:35)
2017-11-22 08:07:22 [INFO ]: aw-watcher-window has started  (aw_watcher_window.main:44)
2017-11-22 08:07:32 [INFO ]: Connection to aw-server established  (aw_client.client:281)
2017-11-22 08:07:32 [INFO ]: Loaded 11 failed requests from queuefile  (aw_client.client:266)
2017-11-22 08:09:40 [WARNING]: Unable to get window class, got a BadWindow exception.  (aw_watcher_window.xlib:85)
2017-11-22 08:09:40 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 08:09:40 [WARNING]: Unable to get window query_tree().parent, got a BadWindow exception from Xlib  (aw_watcher_window.xlib:95)
2017-11-22 08:09:40 [WARNING]: Unable to get window property NET_WM_NAME, got a BadWindow exception from Xlib  (aw_watcher_window.xlib:54)
2017-11-22 08:09:40 [ERROR]: Exception thrown while trying to get active window: <class 'Xlib.error.BadWindow'>: code = 3, resource_id = <class 'Xlib.xobject.resource.Resource'>(0x02000005), sequence_number = 533, major_opcode = 20, minor_opcode = 0  (aw_watcher_window.main:69)
2017-11-22 08:10:10 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 08:10:10 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 08:10:10 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 08:10:11 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 08:10:11 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 08:10:11 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 08:10:12 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 08:10:12 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 08:10:12 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 08:10:13 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 08:10:13 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 08:10:13 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 08:10:14 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 08:10:14 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 08:10:14 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 08:10:15 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 08:10:15 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 08:10:15 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 08:10:44 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 08:10:44 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 08:10:44 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 08:10:45 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 08:10:45 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 08:10:45 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 08:10:46 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 08:10:46 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 08:10:46 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 08:10:47 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 08:10:47 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 08:10:47 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 08:10:48 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 08:10:48 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 08:10:48 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 08:10:49 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 08:10:49 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 08:10:49 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 08:10:50 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 08:10:50 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 08:10:50 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 08:10:51 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 08:10:51 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 08:10:51 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 08:10:52 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 08:10:52 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 08:10:52 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 08:10:53 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 08:10:53 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 08:10:53 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 08:10:54 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 08:10:54 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 08:10:54 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 16:36:32 [WARNING]: Unable to get window class, got a BadWindow exception.  (aw_watcher_window.xlib:85)
2017-11-22 16:36:32 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 16:36:32 [WARNING]: Unable to get window query_tree().parent, got a BadWindow exception from Xlib  (aw_watcher_window.xlib:95)
2017-11-22 16:36:32 [WARNING]: Unable to get window property NET_WM_NAME, got a BadWindow exception from Xlib  (aw_watcher_window.xlib:54)
2017-11-22 16:36:32 [ERROR]: Exception thrown while trying to get active window: <class 'Xlib.error.BadWindow'>: code = 3, resource_id = <class 'Xlib.xobject.resource.Resource'>(0x02000006), sequence_number = 43284, major_opcode = 20, minor_opcode = 0  (aw_watcher_window.main:69)

It's odd that it crashes though, when looking at the code the exception is supposed to be handled:

try:
    current_window = get_current_window()
    logger.debug(current_window)
except Exception as e:
    logger.error("Exception thrown while trying to get active window: {}".format(e))
    traceback.print_exc()
    current_window = {"appname": "unknown", "title": "unknown"}

In this case "appname" and "title" should just be sent as "unknown" and is not supposed to crash.

Can you reproduce this directly in your terminal without aw-qt and see if there's some more information in stdout/stderr? The traceback.print_exc() line is not printing to the log i believe. And if something goes wrong in the error handling (which is my assumption since it crashes), that traceback should also be visible.

@nikanar
Copy link
Contributor Author

nikanar commented Nov 22, 2017

Nope ! I can reproduce, but not in terminal, lol.

I killed aw-qt, started aw-watcher-window, and went to that window, and it doesn't crash anymore. It does [WARN] like crazy though :

2017-11-22 14:32:24 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 14:32:24 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 14:32:25 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 14:32:25 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 14:32:25 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)

I get 3 of these per second so long as said window is active. It stops when I focus other windows.
Then I restarted the whole aw-qt, and it again doesn't crash, only flood warnings.

... then, I close the terminal, open the task manager, and it pops-up (=crash) again.

Related #22

I tried again because this seems crazy but the same happens : while the terminal window is open, the watcher doesn't crash, only shoots warnings when task manager is focused, and when I close the terminal and focus task manager, then the watcher crashes. The "show details" panel gets populated with the unclear branch warnings :

2017-11-22 15:16:48 [INFO ]: Running watcher with poll time 1.0 seconds  (aw_watcher_window.main:35)
2017-11-22 15:16:48 [INFO ]: aw-watcher-window has started  (aw_watcher_window.main:44)
2017-11-22 15:16:52 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:16:52 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:16:52 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:16:53 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:16:53 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:16:53 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:16:54 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:16:54 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:16:54 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:16:55 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:16:55 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:16:55 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:16:56 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:16:56 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:16:56 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:16:58 [INFO ]: Connection to aw-server established  (aw_client.client:281)
2017-11-22 15:16:58 [INFO ]: Loaded 10 failed requests from queuefile  (aw_client.client:266)
2017-11-22 15:16:58 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:16:58 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:16:58 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:16:59 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:16:59 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:16:59 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:00 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:00 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:00 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:01 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:01 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:01 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:03 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:03 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:03 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:04 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:04 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:04 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:12 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:12 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:12 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:13 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:13 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:13 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:14 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:14 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:14 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:15 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:15 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:15 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:16 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:16 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:16 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:17 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:17 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:17 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:18 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:18 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:18 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:19 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:19 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:19 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:20 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:20 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:20 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:21 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:21 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:21 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:22 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:22 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:22 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:23 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:23 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:23 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:24 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:24 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:24 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:28 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:28 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:28 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:29 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:29 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:29 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:30 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:30 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:30 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:31 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:31 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:31 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:32 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:32 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:32 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:33 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:33 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:33 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:34 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:34 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:34 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:35 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:35 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
2017-11-22 15:17:35 [WARNING]: Code made an unclear branch  (aw_watcher_window.xlib:91)
[At this point I close the terminal window]
2017-11-22 15:17:37 [ERROR]: Exception thrown while trying to get active window: [Errno 5] Input/output error  (aw_watcher_window.main:69)

@nikanar
Copy link
Contributor Author

nikanar commented Nov 23, 2017

So it seems this is a known problem, described here and here on SO. Basically the watcher (/aw-qt) tries to print to stdout (I think traceback.print_exc() after the other error is caught) but cannot because the terminal was closed, so the print raises an Error.

I changed the above to

        except Exception as e:
            traceback.print_exc(file = open("/home/will/aw-qt.traceback", "a"))
            logger.error("Exception thrown while trying to get active window: {}".format(e))
            traceback.print_exc()

and got the traceback :

will@ker:~$ cat aw-qt.traceback 
Traceback (most recent call last):
  File "/home/will/15-QS/2-Activitywatch/aw-watcher-window/aw_watcher_window/main.py", line 66, in heartbeat_loop
    current_window = get_current_window()
  File "/home/will/15-QS/2-Activitywatch/aw-watcher-window/aw_watcher_window/lib.py", line 44, in get_current_window
    return get_current_window_linux()
  File "/home/will/15-QS/2-Activitywatch/aw-watcher-window/aw_watcher_window/lib.py", line 13, in get_current_window_linux
    cls = xlib.get_window_class(window)
  File "/home/will/15-QS/2-Activitywatch/aw-watcher-window/aw_watcher_window/xlib.py", line 90, in get_window_class
    print("")
OSError: [Errno 5] Input/output error

Indeed, if I comment out the line traceback.print_exc(), then it doesn't crash anymore.
(by God pip --editable is practical, many thanks for putting it in)

@ym1234
Copy link

ym1234 commented Mar 16, 2021

Any reason this hasn't been fixed?

@johan-bjareholt
Copy link
Member

@ym1234 Personally I can't fix it because I can't reproduce it. Are you experiencing the issue?

vasuemme111 pushed a commit to dholendar-27/aw-watcher-window that referenced this issue Apr 24, 2024
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

3 participants