libunwind-devel
[Top][All Lists]
Advanced

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

[Libunwind-devel] SOS_MEMORY_SIZE too small?


From: Roberto Bagnara
Subject: [Libunwind-devel] SOS_MEMORY_SIZE too small?
Date: Tue, 30 Sep 2008 21:01:07 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050929 Thunderbird/1.0.7 Fedora/1.0.7-1.1.fc4 Mnenhy/0.7.3.0


Hi there,

while porting the Parma Polyhedra Library (http://www.cs.unipr.it/ppl/) to 
Itanium,
we discovered what seems to be a libunwind problem.
The symptoms are that, during the throw of an std::bad_alloc exception, 
libunwind
calls abort() as follows:

$ libtool --mode=execute gdb memory1
./memory1: line 61: Xmemory1: command not found
GNU gdb 6.8-debian
Copyright (C) 2008 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 "ia64-linux-gnu"...
(gdb) r
Starting program: /home/bagnara/ppl/build/tests/Polyhedron/.libs/lt-memory1
Trying dimension 8

Program received signal SIGABRT, Aborted.
0xa000000000010621 in __kernel_syscall_via_break ()
(gdb) info stack
#0  0xa000000000010621 in __kernel_syscall_via_break ()
#1  0x20000000005cd2a0 in raise () from /lib/libc.so.6.1
#2  0x20000000005cfb70 in abort () from /lib/libc.so.6.1
#3  0x200000000052bc30 in _UIia64__sos_alloc (size=752) at mi/mempool.c:61
#4  0x200000000052be20 in expand (pool=0x2000000000559528) at mi/mempool.c:137
#5  0x200000000052c030 in _UIia64__mempool_alloc (pool=0x2000000000559528)
    at mi/mempool.c:180
#6  0x20000000005357b0 in desc_label_state (label=3, sr=0x60000ffffffbd2c8)
    at ia64/Gparser.c:533
#7  0x2000000000538100 in create_state_record_for (c=0x60000ffffffbe180,
    sr=0x60000ffffffbd2c8, ip=<value optimized out>)
    at ia64/unwind_decoder.h:396
#8  0x2000000000540e00 in build_script (c=0x60000ffffffbe180,
    script=0x2000000000575d58) at ia64/Gscript.c:458
#9  0x2000000000542a10 in _ULia64_find_save_locs (c=0x60000ffffffbe180)
    at ia64/Gscript.c:688
#10 0x2000000000542f90 in _ULia64_step (cursor=0x60000ffffffbe180)
    at ia64/Gstep.c:338
#11 0x200000000052ddd0 in _Unwind_RaiseException (
    exception_object=0x2000000000425870) at unwind/RaiseException.c:49
#12 0x20000000003d16d0 in __cxa_throw () from /usr/lib/libstdc++.so.6
#13 0x20000000003d2440 in operator new () from /usr/lib/libstdc++.so.6
#14 0x4000000000006940 in cxx_malloc (size=8)
    at ../../../ppl/tests/Polyhedron/memory1.cc:133
#15 0x20000000002074a0 in __gmpz_init () from /usr/lib/libgmp.so.3
#16 0x200000000016f300 in 
Parma_Polyhedra_Library::Row_Impl_Handler::Impl::expand_within_capacity 
(this=0x6000000000033e60, new_size=10)
    at /usr/include/gmpxx.h:1478
#17 0x20000000000b4700 in Parma_Polyhedra_Library::Linear_System::add_pending_row 
(this=0x60000ffffffbf350, flags=<value optimized out>)
    at ../../ppl/src/Row.inlines.hh:235
#18 0x200000000017f6f0 in Parma_Polyhedra_Library::Polyhedron::conversion (
    address@hidden, start=0, address@hidden,
    address@hidden, num_lines_or_equalities=0)
    at ../../ppl/src/conversion.cc:722
#19 0x2000000000182040 in Parma_Polyhedra_Library::Polyhedron::minimize (
    con_to_gen=true, address@hidden, address@hidden,
    address@hidden) at ../../ppl/src/minimize.cc:137
---Type <return> to continue, or q <return> to quit---
#20 0x20000000000ea250 in 
Parma_Polyhedra_Library::Polyhedron::update_generators 
(this=0x60000ffffffbf310) at ../../ppl/src/Polyhedron_nonpublic.cc:828
#21 0x2000000000107fc0 in Parma_Polyhedra_Library::Polyhedron::generators (
    this=0x60000ffffffbf310) at ../../ppl/src/Polyhedron_public.cc:147
#22 0x40000000000078f0 in compute_open_hypercube_generators (dimension=8)
    at ../../../ppl/tests/Polyhedron/memory1.cc:73
#23 0x40000000000081d0 in guarded_compute_open_hypercube_generators (
    dimension=8, max_memory_in_bytes=3145728)
    at ../../../ppl/tests/Polyhedron/memory1.cc:115
#24 0x4000000000008640 in main ()
    at ../../../ppl/tests/Polyhedron/memory1.cc:163

Apparently, this is due to SOS_MEMORY_SIZE being too small.
The following patch fixes it:

--- libunwind-0.98.6/src/mi/mempool.c   2008-09-29 20:57:19.000000000 +0200
+++ libunwind-0.98.6/src/mi/mempool.c.fixed     2008-09-29 20:16:36.000000000 
+0200
@@ -34,7 +34,7 @@
 #include "mempool.h"

 #define MAX_ALIGN      (sizeof (long double))
-#define SOS_MEMORY_SIZE        16384
+#define SOS_MEMORY_SIZE        32768

 static char sos_memory[SOS_MEMORY_SIZE];
 static char *sos_memp;

You may also want to apply the following patch:

--- libunwind-0.98.6/src/ia64/Gscript.c~        2007-11-15 01:01:19.000000000 
+0100
+++ libunwind-0.98.6/src/ia64/Gscript.c 2008-09-29 20:17:34.000000000 +0200
@@ -113,7 +113,7 @@
   sigprocmask (SIG_SETMASK, &unwi_full_sigmask, saved_sigmaskp);
   if (likely (caching == UNW_CACHE_GLOBAL))
     {
-      Debug (16, "%s: acquiring lock\n");
+      Debug (16, "%s: acquiring lock\n", __FUNCTION__);
       mutex_lock (&cache->lock);
     }
 #endif

All the best,

     Abramo and Roberto Bagnara

--
Prof. Roberto Bagnara
Computer Science Group
Department of Mathematics, University of Parma, Italy
http://www.cs.unipr.it/~bagnara/
mailto:address@hidden





reply via email to

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