ratpoison-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RP] Segfault and faulty focus


From: Martin Samuelsson
Subject: Re: [RP] Segfault and faulty focus
Date: Fri, 19 Jul 2019 13:09:46 +0200
User-agent: NeoMutt/20170113 (1.7.2)

Axel Svensson @ 2019-07-16 (Tuesday), 01:58 (+0200)

Never used gdb before, but I believe I have produced a stack trace
below.

I kind of assumed it was new for you, and must say you did great considering that level of experience!

Sorry it took me a couple of days to get back to looking at your answer.

I might be reading this wrong, but it seems like add_to_window_list (frame #0) is called with the rp_screen *s argument set to null.

My understanding is the same as yours, and furthermore I can see that there seem to be an intact call stack. We are also lucky that the seg. fault happens early without seeming to require any ratpoison specific state.

Despite scanwins having one argument and all call sites provide an
argument, gdb does not list any arguments for the frame.

The compiler might have optimized away the values. I'm not completely sure that's what happened here, but generally one wants to rebuild the source code without optimizations when debugging a more complex issue (with the risk of losing reproduceability). With this bug though, my guess is that it'll be easy enough to grasp what happens without recompiling.

Perhaps you can shed some light on that, or at least give me a pointer for what information I need to provide next.

Setting a breakpoint at scanwins() is likely the next thing to do. I.e. execute "break scanwins" prior to executing "run". Once scanwins() is reached the prompt should come back and it'll be possible to execute each line of code interactively with "step" (or "s") and investigate what the variables contain at using e.g. "print attr". There clearly are more commands available, and even other interfaces on top of gdb which makes debugging more convenient. Which might be useful for more tricky problems than this one.

The general idea is of course to figure out if find_screen_by_attr(), list_first() and XGetWindowAttributes() seem to be called with and return reasonable values.

Thanks for taking your time!

Thank you!
--
/Martin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]