Closed pinealservo closed 10 years ago
Thanks for the report, and thanks for taking the time dig into this!
As you guessed I haven't seen this myself, and I use multiple views on a regular basis. I'll see if I can get a virtual box of Arch up to verify this myself, what version are you using by the way?
The diff seems to be reversed, but from what I understand you've effectively moved the grab_focus call from the Application.new_editor method into the command. Seems like it should be same thing really, unless you have some other changes?
If you don't mind, could you list the minimal set of actions you take to reproduce this. From a newly started instance, do you see the segfault directly when you invoke, say, the view-right-or-create
?
I've managed to reproduce it now, will investigate further.
Fixed in master. Turns out it was a reproducible problem in my own environment as well, once I turned off the VI mode. Verified to work for Ubuntu and Arch (14.03). Again, thanks for the report!
Whoops, yeah, the diff was reversed. I accidentally committed the change to the wrong branch of my local repository, fixed it, and then took the diff from the wrong branch. Guess I hadn't had enough sleep. Glad you were able to figure it out and get it fixed!
My thinking with the change I made was that if I ensured the new editor and view were built before I gave it focus, it would not trigger the assertion failure that I was seeing that was related to keyboard focus. It did seem to work, but I guess it was not the root cause.
Do you have any hints on tracking down this sort of error in luajit ffi programs? I have done some experiments with luajit myself, but it's easy to get the ffi setup wrong and get some very difficult to debug crashes.
Well, it was weird that you saw an effect of moving the grab_focus call out, I can't make heads or tails out of that, that's why I wondered whether you had any additional changes. But I did not get the same backtraces either, so knows, it might just be that it was corruption deep down that manifested in different ways on different machines. I verified that the changes you made had no effect for me fwiw.
I don't have any good hints to offer unfortunately with regards to the FFI - I find it hard and cruel at times, and I've had my share of hard to diagnose crashes. That being said, this particular error would not have been easier to debug with better support, as the actual segfault occurred separately from the problematic call. Git bisect ended up being the saviour in this case.
I'm really impressed with your work on this editor, and I'm definitely going to invest some time in learning to use it. I've already got a basic set of emacs keybindings ported, but as I was looking at the view-splitting commands, I ran into a segfault. I finally got a chance to dig into it, and it seems that there's an assertion that fails before it crashes:
I then ran it like this:
G_DEBUG="fatal_warnings" gdb ./howl
I got a stack trace that looked interesting:I also determined that the crash was happening in
lib/howl/ui/window.moon
in theadd_view
method, specifically in thegobject/show_all!
call.After a bit of searching, it seemed it might be related to the editor widget getting keyboard focus before being displayed. Following the hunch, I made the following changes, which seemed to fix the problem:
I guess this must be due to a different version of gtk or something, because I can't imagine you wouldn't have run across it if it existed on your system. I'm running Arch on this machine, so things tend to be bleeding-edge.