10 | | |
11 | | eax 0x0 0[[BR]] |
12 | | |
13 | | ecx 0xbff5237c -1074453636[[BR]] |
14 | | |
15 | | edx 0x4 4[[BR]] |
16 | | |
17 | | ebx 0xbff5237c -1074453636[[BR]] |
18 | | |
19 | | esp 0xbff52320 0xbff52320[[BR]] |
20 | | |
21 | | ebp 0xbff52320 0xbff52320[[BR]] |
22 | | |
23 | | esi 0x0 0[[BR]] |
24 | | |
25 | | edi 0x4 4[[BR]] |
26 | | |
27 | | eip 0x848397 0x848397 /*** Fault instruction right here !!!! ***/[[BR]] |
28 | | |
29 | | eflags 0x246 582[[BR]] |
30 | | |
31 | | cs 0x73 115[[BR]] |
32 | | |
33 | | ss 0x7b 123[[BR]] |
34 | | |
35 | | ds 0x7b 123[[BR]] |
36 | | |
37 | | es 0x7b 123[[BR]] |
38 | | |
39 | | fs 0x0 0[[BR]] |
40 | | |
41 | | gs 0x33 51[[BR]] |
42 | | |
43 | | |
44 | | |
| 10 | eax 0x0 0 |
| 11 | ecx 0xbff5237c -1074453636 |
| 12 | edx 0x4 4 |
| 13 | ebx 0xbff5237c -1074453636 |
| 14 | esp 0xbff52320 0xbff52320 |
| 15 | ebp 0xbff52320 0xbff52320 |
| 16 | esi 0x0 0 |
| 17 | edi 0x4 4 |
| 18 | eip 0x848397 0x848397 /*** Fault instruction right here !!!! ***/ |
| 19 | eflags 0x246 582 |
| 20 | cs 0x73 115 |
| 21 | ss 0x7b 123 |
| 22 | ds 0x7b 123 |
| 23 | es 0x7b 123 |
| 24 | fs 0x0 0 |
| 25 | gs 0x33 51 |
| 26 | }}} |
46 | | |
47 | | |
48 | | (gdb) disassemble 0xcc2397[[BR]] |
49 | | |
50 | | Dump of assembler code for function __pthread_disable_asynccancel:[[BR]] |
51 | | |
52 | | 0x00cc2390 <__pthread_disable_asynccancel+0>: push %ebp[[BR]] |
53 | | |
54 | | 0x00cc2391 <__pthread_disable_asynccancel+1>: test $0x2,%al[[BR]] |
55 | | |
56 | | 0x00cc2393 <__pthread_disable_asynccancel+3>: mov %esp,%ebp[[BR]] |
57 | | |
58 | | 0x00cc2395 <__pthread_disable_asynccancel+5>: jne 0xcc23b6[[BR]] |
59 | | |
60 | | <__pthread_disable_asynccancel+38>[[BR]] |
61 | | |
62 | | 0x00cc2397 <__pthread_disable_asynccancel+7>: mov %gs:0x58,%edx /*** Same fault instruction ***/[[BR]] |
63 | | |
64 | | 0x00cc239e <__pthread_disable_asynccancel+14>: mov %edx,%ecx[[BR]] |
65 | | |
66 | | 0x00cc23a0 <__pthread_disable_asynccancel+16>: and $0xfffffffd,%ecx[[BR]] |
67 | | |
68 | | 0x00cc23a3 <__pthread_disable_asynccancel+19>: cmp %edx,%ecx[[BR]] |
69 | | |
70 | | 0x00cc23a5 <__pthread_disable_asynccancel+21>: je 0xcc23b6 |
71 | | <__pthread_disable_asynccancel+38>[[BR]] |
72 | | |
73 | | 0x00cc23a7 <__pthread_disable_asynccancel+23>: mov %edx,%eax[[BR]] |
74 | | |
75 | | 0x00cc23a9 <__pthread_disable_asynccancel+25>: lock cmpxchg[[BR]] |
76 | | |
77 | | |
| 28 | {{{ |
| 29 | (gdb) disassemble 0xcc2397 |
| 30 | Dump of assembler code for function __pthread_disable_asynccancel: |
| 31 | 0x00cc2390 <__pthread_disable_asynccancel+0>: push %ebp |
| 32 | 0x00cc2391 <__pthread_disable_asynccancel+1>: test $0x2,%al |
| 33 | 0x00cc2393 <__pthread_disable_asynccancel+3>: mov %esp,%ebp |
| 34 | 0x00cc2395 <__pthread_disable_asynccancel+5>: jne 0xcc23b6 <__pthread_disable_asynccancel+38> |
| 35 | 0x00cc2397 <__pthread_disable_asynccancel+7>: mov %gs:0x58,%edx /*** Same fault instruction ***/ |
| 36 | 0x00cc239e <__pthread_disable_asynccancel+14>: mov %edx,%ecx |
| 37 | 0x00cc23a0 <__pthread_disable_asynccancel+16>: and $0xfffffffd,%ecx |
| 38 | 0x00cc23a3 <__pthread_disable_asynccancel+19>: cmp %edx,%ecx |
| 39 | 0x00cc23a5 <__pthread_disable_asynccancel+21>: je 0xcc23b6 <__pthread_disable_asynccancel+38> |
| 40 | 0x00cc23a7 <__pthread_disable_asynccancel+23>: mov %edx,%eax |
| 41 | 0x00cc23a9 <__pthread_disable_asynccancel+25>: lock cmpxchg |
| 42 | }}} |
82 | | /* Read member of the thread descriptor directly. */[[BR]] |
83 | | |
84 | | # define THREAD_GETMEM(descr, member) \[[BR]] |
85 | | |
86 | | ({ __typeof (descr->member) __value; \[[BR]] |
87 | | |
88 | | if (sizeof (__value) == 1) \[[BR]] |
89 | | |
90 | | asm volatile ("movb %%gs:%P2,%b0" \[[BR]] |
91 | | |
| 49 | # define THREAD_GETMEM(descr, member) \ |
| 50 | ({ __typeof (descr->member) __value; \ |
| 51 | if (sizeof (__value) == 1) \ |
| 52 | asm volatile ("movb %%gs:%P2,%b0" \ |
113 | | asm volatile ("movl %%gs:%P1,%%eax\n " \[[BR]] |
114 | | |
115 | | "movl %%gs:%P2,%%edx" \ /*** instruction that causes fault *****/[[BR]] |
116 | | |
117 | | : "=A" (__value) \[[BR]] |
118 | | |
119 | | : "i" (offsetof (struct pthread, member)), \[[BR]] |
120 | | |
121 | | "i" (offsetof (struct pthread, member) + 4)); \[[BR]] |
122 | | |
123 | | } \[[BR]] |
124 | | |
125 | | __value; })[[BR]] |
126 | | |
127 | | |
| 66 | asm volatile ("movl %%gs:%P1,%%eax\n " \ |
| 67 | "movl %%gs:%P2,%%edx" \ /*** instruction that causes fault *****/ |
| 68 | : "=A" (__value) \ |
| 69 | : "i" (offsetof (struct pthread, member)), \ |
| 70 | "i" (offsetof (struct pthread, member) + 4)); \ |
| 71 | } \ |
| 72 | __value; }) |
| 73 | }}} |