Bug 24483 - PIE breaks tracing
Summary: PIE breaks tracing
Status: NEW
Alias: None
Product: gdb
Classification: Unclassified
Component: backtrace (show other bugs)
Version: HEAD
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-04-25 09:36 UTC by Alan Hayward
Modified: 2019-04-25 09:40 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alan Hayward 2019-04-25 09:36:08 UTC
Many of the tracing tests fail when PIE is enabled in the compiler.

Note that commit ba22ff8694e366fe5f27824566aae65fc6626841 ensures that PIE is disabled when running the tracing tests (due to Ubuntu/Debian defaulting GCC to PIE enabled).

To reproduce the errors, on any system, do "s/nopie/pie/g" on .exp files for the following tests:

	* gdb.trace/backtrace.exp:
	* gdb.trace/circ.exp:
	* gdb.trace/collection.exp:
	* gdb.trace/ftrace.exp:
	* gdb.trace/mi-trace-unavailable.exp:
	* gdb.trace/mi-traceframe-changed.exp:
	* gdb.trace/qtro.exp:
	* gdb.trace/read-memory.exp:
	* gdb.trace/report.exp:
	* gdb.trace/tfile.exp:
	* gdb.trace/tfind.exp:
	* gdb.trace/unavailable.exp:

Tests will fail due to being unable to find arguments on the stack frame.

For example, variables are listed as "unavailable" here:

(gdb) backtrace^M
#0  gdb_recursion_test (depth=<unavailable>, q1=<unavailable>, q2=<unavailable>, q3=<unavailable>, q4=<unavailable>, q5=<unavailable>, q6=<unavailable>) at /work/alahay01/gdb-HEAD/build-aarch64/gdb/testsuite/../../../src/binutils-gdb/gdb/testsuite/gdb.trace/actions.c:69^M
#1  0x0000aaaaaaaaad40 in gdb_c_test (parm=<unavailable>) at /work/alahay01/gdb-HEAD/build-aarch64/gdb/testsuite/../../../src/binutils-gdb/gdb/testsuite/gdb.trace/actions.c:113^M
Backtrace stopped: previous frame identical to this frame (corrupt stack?)^M
(gdb) FAIL: gdb.trace/backtrace.exp: 8.6: Backtrace, depth == 1, collect args and locals
Comment 1 Alan Hayward 2019-04-25 09:40:45 UTC
Possible that this is just a consequence of enabling PIE, but we should figure out why. Equally might just be something missing in the trace code.