[Top][All Lists]

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

Re: [RP] Segfault and faulty focus

From: Axel Svensson
Subject: Re: [RP] Segfault and faulty focus
Date: Tue, 16 Jul 2019 01:58:04 +0200

On Tue, Jul 16, 2019 at 12:24 AM Martin Samuelsson
<address@hidden> wrote:
> Interesting... Would you be able to run that reproducable seg. fault though
> gdb and generate a stack trace of the crash?

Never used gdb before, but I believe I have produced a stack trace
below. 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. This would explain why it segfaults at the first s->
member access. As a newbie I get a little confused by frame #1.
Despite scanwins having one argument and all call sites provide an
argument, gdb does not list any arguments for the frame. If this
simply means that s=null, then I'm not sure exactly why a segfault is
not produced when s->root is accessed when calling XQueryTree or
XGetWindowAttributes. Perhaps you can shed some light on that, or at
least give me a pointer for what information I need to provide next.
Thanks for taking your time!


root@2f988de7c2d8:~/ratpoison# gdb ./src/ratpoison
GNU gdb (Debian 8.2.1-2) 8.2.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
Find the GDB manual and other documentation resources online at:

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./src/ratpoison...done.
(gdb) run
Starting program: /root/ratpoison/src/ratpoison
warning: Error disabling address space randomization: Operation not permitted
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
add_to_window_list (s=0x0, w=4194305) at window.c:181
181       new_window->colormap = DefaultColormap (dpy, s->screen_num);
(gdb) info stack
#0  add_to_window_list (s=0x0, w=4194305) at window.c:181
#1  0x0000561e59326249 in scanwins () at manage.c:452
#2  0x0000561e5931218a in main (argc=1, argv=0x7ffdcb6af288) at main.c:432
(gdb) info frame
Stack level 0, frame at 0x7ffdcb6af070:
 rip = 0x561e5932a0ab in add_to_window_list (window.c:181); saved rip
= 0x561e59326249
 called by frame at 0x7ffdcb6af150
 source language c.
 Arglist at 0x7ffdcb6af028, args: s=0x0, w=4194305
 Locals at 0x7ffdcb6af028, Previous frame's sp is 0x7ffdcb6af070
 Saved registers:
  rbx at 0x7ffdcb6af050, rbp at 0x7ffdcb6af058, r12 at 0x7ffdcb6af060,
rip at 0x7ffdcb6af068
(gdb) info args
s = 0x0
w = 4194305
(gdb) up
#1  0x0000561e59326249 in scanwins () at manage.c:452
452           win = add_to_window_list (screen, wins[i]);
(gdb) info frame
Stack level 1, frame at 0x7ffdcb6af150:
 rip = 0x561e59326249 in scanwins (manage.c:452); saved rip = 0x561e5931218a
 called by frame at 0x7ffdcb6af1b0, caller of frame at 0x7ffdcb6af070
 source language c.
 Arglist at 0x7ffdcb6af068, args:
 Locals at 0x7ffdcb6af068, Previous frame's sp is 0x7ffdcb6af150
 Saved registers:
  rbx at 0x7ffdcb6af128, rbp at 0x7ffdcb6af130, r12 at 0x7ffdcb6af138,
r13 at 0x7ffdcb6af140,
  rip at 0x7ffdcb6af148
(gdb) info args
No arguments.
(gdb) up
#2  0x0000561e5931218a in main (argc=1, argv=0x7ffdcb6af288) at main.c:432
432       scanwins ();
(gdb) info frame
Stack level 2, frame at 0x7ffdcb6af1b0:
 rip = 0x561e5931218a in main (main.c:432); saved rip = 0x7fe58c6dd09b
 caller of frame at 0x7ffdcb6af150
 source language c.
 Arglist at 0x7ffdcb6af148, args: argc=1, argv=0x7ffdcb6af288
 Locals at 0x7ffdcb6af148, Previous frame's sp is 0x7ffdcb6af1b0
 Saved registers:
  rbx at 0x7ffdcb6af178, rbp at 0x7ffdcb6af180, r12 at 0x7ffdcb6af188,
r13 at 0x7ffdcb6af190,
  r14 at 0x7ffdcb6af198, r15 at 0x7ffdcb6af1a0, rip at 0x7ffdcb6af1a8
(gdb) info args
argc = 1
argv = 0x7ffdcb6af288
(gdb) up
Initial frame selected; you cannot go up.

reply via email to

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