From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30300 invoked by alias); 20 Jun 2008 22:55:11 -0000 Received: (qmail 30120 invoked by uid 48); 20 Jun 2008 22:54:33 -0000 Date: Fri, 20 Jun 2008 22:55:00 -0000 From: "khoroshilov at linuxtesting dot org" To: glibc-bugs@sources.redhat.com Message-ID: <20080620225433.6684.khoroshilov@linuxtesting.org> Reply-To: sourceware-bugzilla@sourceware.org Subject: [Bug libc/6684] New: Segmentation fault after getcontext() and setcontext() on ppc64 X-Bugzilla-Reason: CC Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org X-SW-Source: 2008-06/txt/msg00055.txt.bz2 #include #include #include typedef struct ReturnValue { int a; } ReturnValue; ReturnValue defaultReturnValue = { 0 }; ucontext_t globalUcp; int outputMessage( char * format, ... ) { int res; va_list arg_list; va_start( arg_list, format ); res = vprintf( format, arg_list ); va_end( arg_list ); return res; } ReturnValue getcontextCall( void ) { outputMessage( "getcontextCall : 1\n" ); getcontext( & globalUcp ); outputMessage( "getcontextCall : 2\n" ); return defaultReturnValue; } ReturnValue setcontextCall( void ) { outputMessage( "setcontextCall : 1\n" ); setcontext( & globalUcp ); outputMessage( "setcontextCall : 2\n" ); return defaultReturnValue; } int main( int argc,const char ** argv ) { getcontextCall(); setcontextCall(); return 0; } The example above leads to segmentation fault in the outputMessage() function after call of the setcontext() on ppc64 platform. The output of the process is as follows: getcontextCall : 1 getcontextCall : 2 setcontextCall : 1 Segmentation fault If someone replace "typedef struct ReturnValue { int a; } ReturnValue;" by "typedef int ReturnValue;" in the example segmentation fault disappears. See also: http://linuxtesting.org/results/report?num=S0688 -- Summary: Segmentation fault after getcontext() and setcontext() on ppc64 Product: glibc Version: 2.4 Status: NEW Severity: normal Priority: P2 Component: libc AssignedTo: drepper at redhat dot com ReportedBy: khoroshilov at linuxtesting dot org CC: glibc-bugs at sources dot redhat dot com http://sourceware.org/bugzilla/show_bug.cgi?id=6684 ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.