Open step- opened 5 years ago
Something more to ponder. I looked at wmctrl, which can close windows by asking the window manager to do it. It seems to be a more polite way of doing it than xdotool's brute-force XDestroyWindow call. So I modified the above script to use wmctrl and I can't make rox crash anymore on my hardware although once in while I can see an Xorg's message complaining about a bad window id. But like I said no crash so far. However, I'm not too confident that with wmctrl an eventual race can be exercised. xdotool alone is fast in detecting the window and immediately closing it. Using wmctrl we go through a slower pipe: xdotool(detect) > xargs > wmctrl > window-manager(close).
Modified script: make-crash-wmctrl.sh.zip
Hi! thank you for reporting.
Not reproduced though I will check differences between removed dir and normal.
Does it happen with icons view?
It happens with both icons view and list view.
I checked destroy process but there is no clue to solve it. Looks like the removed dir is only have a error string not so special. Hmm, is there any other conditions?
The 'removed folder' requirement is irrelevant. I was also able to reproduce it with:
xdotool search --sync --onlyvisible --all --pid `pidof ROX-Filer` --name "/tmp" getwindowname %@ windowclose %@ & rox -d /tmp
So it have not to be on a removed dir, does rox crash always?
Not always, once in a 20-30 tries. Seems to be harder to reproduce than with removed dir, though.
I came across this old issue, tried the wmctrl [EDIT: sorry, the xdotool one] "crasher" again and it still crashes ROX. However, I looked into src/main.c and found this:
As you can see, if the error is BadWindow
or BadDrawable
, ROX just continues.
But in Step's output there's also RenderBadPicture (invalid Picture parameter)
and I can add BadGC (invalid GC parameter)
to the collection.
So, I just replaced abort();
with return 0;
and can't reproduce the crash anymore.
@step-: can you add this to the recipe:
sed -i -e 's|abort();|return 0;|' ROX-Filer/src/main.c
rebuild ROX and verify?
@step-: can you add this to the recipe:
sed -i -e 's|abort();|return 0;|' ROX-Filer/src/main.c
rebuild ROX and verify?
I will. Give me some time.
Patch tested with this command, which repeats 10 times at random intervals opening and closing 15 windows in /tmp
mi=10 mj=15 rox=`pidof ROX-Filer` dir="/tmp"; foo () { xdotool search $1 --onlyvisible --all --pid $rox --name "$dir" getwindowname %@ windowclose %@ >/dev/null & }; eval 'for i in {1..$mi} ; do foo --sync; for j in {1..$mj}; do rox -d "$dir"; done; t=0.1$RANDOM; echo $t; sleep $t; done'; foo
ROX didn't crash therefore I think @JakeSFR's patch is good and valuable for ROX! Thank you.
As a side comment, when mi=10 mj=15
above I got this warning message (only once):
** (ROX-Filer:1704): WARNING **: 10:18:02.724: Existing ROX-Filer process is not responding! Try with -n
ROX stopped responding for maybe 3-4 seconds (garbage collecting?), then it came back and the test loop could continue and finish without further warnings. For lower values of mj
there were no warnings.
I suspect a memory leak somewhere because htop's RESident size column kept increasing a bit after each run of the above command: ... 30568, 30604, 30640, 30716, 30832, 30956.
Ok, thanks for the confirmation.
I think the message indicates that ROX lost a connection to one of its windows due to X error.
With the abort()
it would have probably crashed instead.
I suspected something like that may happen if we ignore all X errors, but IMHO it's still better than aborting everything (pinboard and all remaining ROX windows).
Fortunately, ROX managed to free itself from that freeze; maybe gtk_main_quit()
here did it:
Btw, I remember the last time ROX crashed for me (it still happens, but only once in a few months), it was right after closing a window, so was most likely caused by X error + that abort()
.
@jun7: I know this is not a real solution and the actual problem might even lie on GTK or X side, but I propose to add this, right after the first g_warning in rox_x_error()
:
/* Continue on any error */
g_warning(_("Trying to continue..."));
return 0;
If a user doesn't experience crashes, it shouldn't make any difference, but for those who do, it will.
Ok, I made a PR: https://github.com/jun7/rox-filer/pull/224
Hi,
Sometimes rox can crash when the window of a removed folder gets closed. It doesn't happen all the times, but we have at least two different users that can reproduce this issue fairly consistently. Below is one line of commands that can trigger the problem. On my system I need to repeat the commands maybe 10-20 times until rox crashes. I'm attaching a script that loops repeating the line of commands automatically.
xdotool search --sync
: wait for a matching window title to appear--onlyvisible --all --pid $(pidof ROX-Filer)
: want a ROX-Filer window--name "^!"
: title starts with "!" - that's the title for windows that are open in removed foldersgetwindowname %@
- print the window title to the consolewindowclose %@
- close the window&
- wait in the background so the next command can run immediatelymkdir /tmp/zzz; rox -d /tmp/zzz; rmdir /tmp/zzz
- make folder, open rox in that folder, remove that folder; this will trigger xdotoolThis is what gets printed in my terminal when the crash occurs
gdb backtrace
Maybe this issue is some sort of a race, somewhere inside rox. xdotool doesn't go though the window manager to close the window. It closes the window by brute-force calling XDestroyWindow. In theory this should cause GDK to be notified, and cause it to raise GDK events, which eventually are translated to GTK events, which eventually are passed to ROX; but somewhere in the chain this may be broken (or some sort of race problems happen in ROX trying to update something in the window before all the events have been propagated completely.
Thank you
Attached: make-crash.sh.zip