This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB 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]

Re: [patch/rfc] The off again, on again, PC == 0 in get_prev_frame



Andrew, I think that this case is completely broken.  The frame chain
isn't properly terminated.  The clone(2) system call that has created
this thread tries to mark frame #3 as the outermost frame by clearing
%rbp.  However, since most amd64 code doesn't use the frame pointer,
this is pointless; GDB doesn't look at it.  The fact that you're
seeing a zero PC here is merely accidental; it just happens to be that
(%rsp) contains zero.  Therefore I don't think we should consider a
zero PC as a marker for the end of the frame chain.

The Linux folks should add proper CFI to the implementation of
close(2) in glibc.  A DW_CFA_def_cfa rule that sets the CFA to %rbp
should do the trick.

clone(2)? How come the trad unwind code doesn't recover?


Thinking about it, the test would stop this backtrace:

	sigsegv_handler
	<signal trampoline>
	"null"
	foo (which called "null")
	main

is this tested anywhere?

Andrew




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