------- Comment #9 from rguenth at gcc dot gnu dot org  2009-07-02 10:05 -------
I can reproduce it, the abort is from the system libunwind:

(gdb) run
Starting program: /tmp/a.out 
Executing test_4_10()

#0  0xa000000000010721 in __kernel_syscall_via_break ()
#1  0x2000000000422940 in *__GI_raise (sig=<value optimized out>)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:67
#2  0x2000000000425210 in *__GI_abort () at abort.c:88
#3  0x2000000000383a40 in _UIia64__sos_alloc (size=736) at mi/mempool.c:61
#4  0x2000000000383c30 in expand (pool=0x20000000003ab990) at mi/mempool.c:137
#5  0x2000000000383e00 in _UIia64__mempool_alloc (pool=0x20000000003ab990)
    at mi/mempool.c:180
#6  0x200000000038a680 in desc_prologue (body=0, rlen=9, mask=12 '\f', 
    grsave=44 ',', sr=0x600ffffffff7b218) at ia64/Gparser.c:52
#7  0x200000000038ce40 in create_state_record_for (c=0x600ffffffff7baf0, 
    sr=0x600ffffffff7b218, ip=<value optimized out>)
    at ia64/unwind_decoder.h:204
#8  0x2000000000394ed0 in uncached_find_save_locs (c=0x600ffffffff7baf0)
    at ia64/Gscript.c:458
#9  0x2000000000396420 in _ULia64_find_save_locs (c=0x600ffffffff7baf0)
    at ia64/Gscript.c:662
#10 0x2000000000397710 in _ULia64_step (cursor=0x600ffffffff7baf0)
    at ia64/Gstep.c:338
#11 0x2000000000385ce0 in _Unwind_RaiseException (
    exception_object=0x2000000000251860) at unwind/unwind-internal.h:78
#12 0x2000000000386400 in _Unwind_Resume_or_Rethrow (
    exception_object=0x2000000000251860) at unwind/Resume_or_Rethrow.c:43
#13 0x20000000001fd510 in __cxa_rethrow () from /usr/lib/libstdc++.so.6
#14 0x4000000000001b50 in NewHandlerBox::new_handler_box () at test.cpp:188
#15 0x20000000001fe2e0 in operator new(unsigned long) ()
   from /usr/lib/libstdc++.so.6
#16 0x4000000000001530 in test_4_10 () at test.cpp:257
#17 0x4000000000001900 in main (argc=4145104, argv=0xc00000000000048c)
    at test.cpp:431

which means libunwind cannot allocate memory.

(gdb) p *pool
$2 = {lock = {__data = {__lock = 0, __count = 0, __owner = 0, __nusers = 0, 
      __kind = 0, __spins = 0, __list = {__prev = 0x0, __next = 0x0}}, 
    __size = '\0' <repeats 39 times>, __align = 0}, obj_size = 736, 
  chunk_size = 65536, reserve = 44, num_free = 16, 
  free_list = 0x20000000003afcc0}

the pool seems to have plenty of space, no idea why it is expanded...

    if (pool->num_free <= pool->reserve)
      expand (pool);

    assert (pool->num_free > 0);

obviously expand here doesn't need to fatally fail here ...

OTOH alloc_memory

static void *
alloc_memory (size_t size)
{
  /* Hopefully, mmap() goes straight through to a system call stub...  */
  void *mem = mmap (0, size, PROT_READ | PROT_WRITE,
                    MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
  if (mem == MAP_FAILED)
    return NULL;

fails with a size of 65536.

This is a libunwind bug on one hand (the unnecessary fatal fail) and an
invalid testcase because you make libunwind fail by setrlimit.

Thus, invalid - not a GCC bug.  You might want to file the libunwind bug
where that is appropriate (http://savannah.nongnu.org/projects/libunwind/).


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|                            |INVALID


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

Reply via email to