This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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]

Correct unwind info for i686 vfork


The unwind information for vfork is correct before the child forks,
but incorrect after; it says that the return address is still saved
on the stack, but we pop it before returning in the child.  So the
child is likely to overwrite that location.

Obvious fix attached; fixes backtrace if you set an instruction one
past the int $0x80.

-- 
Daniel Jacobowitz
CodeSourcery

2008-02-14  Daniel Jacobowitz  <dan@codesourcery.com>

	* sysdeps/unix/sysv/linux/i386/vfork.S (__vfork): Record return
	PC save.

Index: sysdeps/unix/sysv/linux/i386/vfork.S
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/i386/vfork.S,v
retrieving revision 1.10
diff -u -p -r1.10 vfork.S
--- sysdeps/unix/sysv/linux/i386/vfork.S	4 May 2005 17:43:06 -0000	1.10
+++ sysdeps/unix/sysv/linux/i386/vfork.S	14 Feb 2008 20:49:16 -0000
@@ -34,6 +34,7 @@ ENTRY (__vfork)
 	/* Pop the return PC value into ECX.  */
 	popl	%ecx
 	cfi_adjust_cfa_offset (-4)
+	cfi_register (%eip, %ecx)
 
 #ifdef SAVE_PID
 	SAVE_PID


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