Tag Archives: gdb

GDB backtrace For chromium hangup

(gdb) bt
#0  pthread_cond_timedwait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:238
#1  0x00007fb512be9443 in ?? ()
#2  0x00007fb512bc9d0d in ?? ()
#3  0x00007fb512bacb0f in ?? ()
#4  0x00007fb512bbc7d1 in ?? ()
#5  0x00007fb512baa03a in ?? ()
#6  0x00007fb51537aea8 in ?? ()
#7  0x00007fb512b7d045 in ?? ()
#8  0x00007fb512b7de1e in ?? ()
#9  0x00007fb512b7cc30 in ?? ()
#10 0x00007fb512569698 in ChromeMain ()
#11 0x00007fb50a541b45 in __libc_start_main (main=0x7fb512569650 <_start+308>, argc=4, argv=0x7fffb310c918, 
    init=, fini=, rtld_fini=, stack_end=0x7fffb310c908) at libc-start.c:287
#12 0x00007fb512569545 in _start ()

GNU grep Debug

commandline session

$gdb grep
GNU gdb (GDB) 7.4.1-debian
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
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".
For bug reporting instructions, please see:
...
Reading symbols from /home/jeffrin/GNUgrep/grep-2.0/grep...done.
(gdb) break 1
Breakpoint 1 at 0x401595: file grep.c, line 1.
(gdb) r errno  grep.c
Starting program: /home/jeffrin/GNUgrep/grep-2.0/grep errno  grep.c
warning: no loadable sections found in added symbol-file system-supplied DSO at 0x7ffff7ffa000
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
#include 
#ifndef errno
extern int errno;
		  strerror(errno));
    error("writing output", errno);
	  error(filename, errno);
	  fatal(optarg, errno);
	      error(argv[optind], errno);
[Inferior 1 (process 29324) exited normally]
(gdb) start
Temporary breakpoint 2 at 0x401f99: file grep.c, line 600.
Starting program: /home/jeffrin/GNUgrep/grep-2.0/grep errno  grep.c
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?

Temporary breakpoint 2, main (argc=3, argv=0x7fffffffe8d8) at grep.c:600
600	{
(gdb) bt
#0  main (argc=3, argv=0x7fffffffe8d8) at grep.c:600
(gdb) break 1
Note: breakpoint 1 also set at pc 0x401595.
Breakpoint 3 at 0x401595: file grep.c, line 1.
(gdb) start
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Temporary breakpoint 4 at 0x401f99: file grep.c, line 600.
Starting program: /home/jeffrin/GNUgrep/grep-2.0/grep errno  grep.c
warning: no loadable sections found in added symbol-file system-supplied DSO at 0x7ffff7ffa000
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?

Temporary breakpoint 4, main (argc=3, argv=0x7fffffffe8d8) at grep.c:600
600	{
(gdb) l
595
596	int
597	main(argc, argv)
598	     int argc;
599	     char *argv[];
600	{
601	  char *keys;
602	  size_t keycc, oldcc, keyalloc;
603	  int keyfound, count_matches, no_filenames, list_files, suppress_errors;
604	  int opt, cc, desc, count, status;
(gdb) call memchar
No symbol "memchar" in current context.
(gdb) next
609	  prog = argv[0];
(gdb) l
604	  int opt, cc, desc, count, status;
605	  FILE *fp;
606	  extern char *optarg;
607	  extern int optind;
608
609	  prog = argv[0];
610	  if (prog && strrchr(prog, '/'))
611	    prog = strrchr(prog, '/') + 1;
612
613	  keys = NULL;
(gdb) bt
#0  main (argc=3, argv=0x7fffffffe8d8) at grep.c:609
(gdb) break 82
Note: breakpoints 1 and 3 also set at pc 0x401595.
Breakpoint 5 at 0x401595: file grep.c, line 82.
(gdb) continue
Continuing.
#include 
#ifndef errno
extern int errno;
		  strerror(errno));
    error("writing output", errno);
	  error(filename, errno);
	  fatal(optarg, errno);
	      error(argv[optind], errno);
[Inferior 1 (process 30092) exited normally]
(gdb)