Patchwork Patch committed: Fix crash in libbacktrace if no debug info

login
register
mail settings
Submitter Ian Taylor
Date Sept. 27, 2012, 7:20 p.m.
Message ID <mcr8vbvff1o.fsf@google.com>
Download mbox | patch
Permalink /patch/187452/
State New
Headers show

Comments

Ian Taylor - Sept. 27, 2012, 7:20 p.m.
When changing the libbacktrace interface to avoid using mutexes, I
missed a spot.  This caused libbacktrace to crash on a binary with no
debug info.  This patch fixes the problem.  Bootstrapped and ran
libbacktrace tests.  Committed to mainline.

Ian


2012-09-27  Ian Lance Taylor  <iant@google.com>

	PR other/54726
	* elf.c (backtrace_initialize): Set *fileln_fn, not
	state->fileln_fn.

Patch

Index: elf.c
===================================================================
--- elf.c	(revision 191810)
+++ elf.c	(working copy)
@@ -634,7 +634,7 @@  backtrace_initialize (struct backtrace_s
     {
       if (!backtrace_close (descriptor, error_callback, data))
 	goto fail;
-      state->fileline_fn = elf_nodebug;
+      *fileline_fn = elf_nodebug;
       state->fileline_data = NULL;
       return 1;
     }