This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

IA64 Crashes in stack unwinding


Hi,

I'm seeing crashes with a 3.3.2 gcc and what will be 2.3.3 glibc on a quad 
Itanium 2 system during backtrace() calls. Can anyone confirm this ?

I tried it with the simple backtrace info page example, slightly modified to 
give me more information for debugging but it crashes during unwinding.
I've attached my version and it's output so you can compile it and test if you 
have access to an Itanium system.

The backtrace in gdb looks like this:
Program received signal SIGSEGV, Segmentation fault.
uw_update_reg_address (context=0x60000fffffff9590, fs=0x60000fffffff9950, 
regno=UNW_REG_PSP) at ../../gcc/config/ia64/unwind-ia64.c:1859
1859    ../../gcc/config/ia64/unwind-ia64.c: No such file or directory.
        in ../../gcc/config/ia64/unwind-ia64.c
(gdb) bt
#0  uw_update_reg_address (context=0x60000fffffff9590, fs=0x60000fffffff9950, 
regno=UNW_REG_PSP)
    at ../../gcc/config/ia64/unwind-ia64.c:1859
#1  0x20000000002d2340 in uw_update_context (context=0x60000fffffff9590, 
fs=0x60000fffffff9950)
    at ../../gcc/config/ia64/unwind-ia64.c:2006
#2  0x20000000002d3ee0 in _Unwind_Backtrace (trace=0x200000000003cfa0 
<local+5416>, trace_argument=0x60000fffffffa060) at unwind.inc:295
#3  0x200000000021a120 in backtrace () from /lib/libc.so.6.1
#4  0x4000000000000d20 in signalhandler ()
#5  <signal handler called>
#6  0x60000f80000000d0 in ?? ()

Any help would be appreciated.

Otto Bruggeman
#include <signal.h>
#include <execinfo.h>

#define SIZE 32

void signalhandler( int someint )
{
	size_t returned_size;
	int i;

	char** symbol_array;

	void* something[SIZE];
 
	printf( "Bah, signal handler called and signal = %d\n\n", someint );

	returned_size = backtrace( something, SIZE );

	printf( "Backtrace worked...(well backtrace returned something)\n" );

	if ( returned_size )
		printf( "returned size=%d\n", returned_size );
	else
		exit(2);
	
	symbol_array = backtrace_symbols( something, returned_size );

	for ( i = 0; i < returned_size; ++i )
	{
		printf( "s_a: %s\n", symbol_array[i] );
	}
	exit( 1 );
};

struct Foo { int a; };

void function2( int b )
{
	struct Foo* f = 0;
	printf( "%d\n", f->a );
}

void function1( int a )
{
	function2( a );
}

int main(void)
{
	signal( SIGSEGV, &signalhandler );
	function1( 1 );
	return 0;
}

Attachment: output.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]