http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55536



             Bug #: 55536

           Summary: libbacktrace abort in backtrace_alloc at mmap.c:99

                    running btest

    Classification: Unclassified

           Product: gcc

           Version: 4.8.0

            Status: UNCONFIRMED

          Severity: normal

          Priority: P3

         Component: other

        AssignedTo: unassig...@gcc.gnu.org

        ReportedBy: dang...@gcc.gnu.org

              Host: hppa*-*-hpux*

            Target: hppa*-*-hpux*

             Build: hppa*-*-hpux*





# gdb btest

GNU gdb (GDB) 7.5.50.20121029-cvs

Copyright (C) 2012 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 "hppa64-hp-hpux11.00".

For bug reporting instructions, please see:

<http://www.gnu.org/software/gdb/bugs/>...

Reading symbols from /home/gnu/gcc/objdir/libbacktrace/btest...done.

(gdb) r

Starting program: /home/gnu/gcc/objdir/libbacktrace/btest 

warning: Private mapping of shared library text was not specified

by the executable; setting a breakpoint in a shared library which

is not privately mapped will not work.  See the HP-UX 11i v3 chatr

manpage for methods to privately map shared library text.



Program received signal SIGABRT, Aborted.

0xc0000000001e05fc in kill () from /lib/pa20_64/libc.2

(gdb) bt

#0  0xc0000000001e05fc in kill () from /lib/pa20_64/libc.2

#1  0xc00000000019352c in raise () from /lib/pa20_64/libc.2

#2  0xc0000000001c7684 in abort_C () from /lib/pa20_64/libc.2

#3  0xc0000000001c76e4 in abort () from /lib/pa20_64/libc.2

#4  0x400000000000709c in backtrace_alloc (

    state=state@entry=0x800003ffefff0b68, size=size@entry=72, 

    error_callback=error_callback@entry=0x4000000000004d90

<error_callback_create>, data=data@entry=0x0) at

../../gcc/libbacktrace/mmap.c:99

#5  0x4000000000005f28 in backtrace_create_state (filename=<optimized out>, 

    threaded=threaded@entry=0, 

    error_callback=error_callback@entry=0x4000000000004d90

<error_callback_create>, data=data@entry=0x0) at

../../gcc/libbacktrace/state.c:65

#6  0x400000000001436c in main (argc=<optimized out>, argv=<optimized out>)

    at ../../gcc/libbacktrace/btest.c:617



In internal.h:



#ifndef HAVE_SYNC_FUNCTIONS



/* Define out the sync functions.  These should never be called if

   they are not available.  */



#define __sync_bool_compare_and_swap(A, B, C) (abort(), 1)

#define __sync_lock_test_and_set(A, B) (abort(), 0)



In mmap.c:



  /* If we can acquire the lock, then see if there is space on the

     free list.  If we can't acquire the lock, drop straight into

     using mmap.  __sync_lock_test_and_set returns the old state of

     the lock, so we have acquired it if it returns 0.  */



  if (!__sync_lock_test_and_set (&state->lock_alloc, 1))



Same in backtrace_free.

Reply via email to