summary refs log tree commit diff stats
path: root/results/classifier/zero-shot/118/none/1528239
blob: edaf098793d767431a975bac305479f828415102 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
user-level: 0.722
x86: 0.710
semantic: 0.668
architecture: 0.612
arm: 0.564
debug: 0.549
performance: 0.545
ppc: 0.530
PID: 0.514
device: 0.490
mistranslation: 0.478
socket: 0.473
graphic: 0.465
kernel: 0.455
network: 0.443
hypervisor: 0.443
files: 0.440
permissions: 0.429
vnc: 0.425
assembly: 0.420
peripherals: 0.413
risc-v: 0.402
TCG: 0.384
KVM: 0.375
VMM: 0.367
register: 0.356
i386: 0.344
virtual: 0.310
boot: 0.300

Unable to debug PIE binaries with QEMU gdb stub.

The issue occurs on current trunk:

max@max:~/build/qemu$ cat test.c
#include <stdio.h>

int main() {
  printf("Hello, world!\n");
  return 0;
}

max@max:~/build/qemu$ gcc test.c -fPIC -pie -o bad.x
max@max:~/build/qemu$ ./x86_64-linux-user/qemu-x86_64 -g 1234 bad.x 
.............................


max@max:~/build/qemu$ gdb
GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
........................................................................................
(gdb) file bad.x
Reading symbols from bad.x...(no debugging symbols found)...done.
(gdb) b main
Breakpoint 1 at 0x779
(gdb) target remote localhost:1234
Remote debugging using localhost:1234
Reading symbols from /lib64/ld-linux-x86-64.so.2...warning: the debug information found in "/lib64/ld-2.19.so" does not match "/lib64/ld-linux-x86-64.so.2" (CRC mismatch).

Reading symbols from /usr/lib/debug//lib/x86_64-linux-gnu/ld-2.19.so...done.
done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
Error in re-setting breakpoint 1: Cannot access memory at address 0x775
Error in re-setting breakpoint 1: Cannot access memory at address 0x775
0x0000004000a042d0 in _start () from /lib64/ld-linux-x86-64.so.2
(gdb) c
Continuing.
[Inferior 1 (Remote target) exited normally]
(gdb) 


max@max:~/build/qemu$ cat config.log
# Configured with: '/home/max/src/qemu/configure' '--prefix=/home/max/install/qemu' '--target-list=arm-linux-user,aarch64-linux-user,x86_64-linux-user' '--static'


W/O QEMU or -pie flag breakpoint on main works fine.

GDB server itself actually supports PIE binaries.

This patch https://<email address hidden>/ fixes the issue.

Patch has been included in QEMU v4.2:
https://git.qemu.org/?p=qemu.git;a=commitdiff;h=dc12567a53c88d7a91b9