Commit 1d133cd
committed
runtime: don't crash if vsyscall and vdso are disabled on x86_64
If vdso is disabled, the goruntime calls gettimeofday from vsyscall.
But if vsyscall is disabled too, all golang binaries crash:
SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0xffffffffff600000} ---
killed by SIGSEGV (core dumped) ++
vsyscall doesn't work as it was designed for a long time due to security
reasons and now vsyscall is a little more expensive than real syscalls:
torvalds/linux@5cec93c216db
This patch reworks the code to call syscalls if the vdso library isn't
available.
Signed-off-by: Andrei Vagin <avagin@google.com>1 parent 1f4d035 commit 1d133cd
File tree
3 files changed
+22
-24
lines changed- src
- runtime
- syscall
3 files changed
+22
-24
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| |||
241 | 242 | | |
242 | 243 | | |
243 | 244 | | |
| 245 | + | |
| 246 | + | |
244 | 247 | | |
245 | 248 | | |
246 | 249 | | |
247 | | - | |
248 | | - | |
249 | 250 | | |
| 251 | + | |
250 | 252 | | |
251 | 253 | | |
252 | | - | |
253 | 254 | | |
254 | 255 | | |
255 | 256 | | |
| |||
264 | 265 | | |
265 | 266 | | |
266 | 267 | | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
| 268 | + | |
| 269 | + | |
274 | 270 | | |
275 | 271 | | |
276 | 272 | | |
| |||
306 | 302 | | |
307 | 303 | | |
308 | 304 | | |
| 305 | + | |
| 306 | + | |
309 | 307 | | |
310 | 308 | | |
311 | 309 | | |
312 | | - | |
313 | | - | |
314 | 310 | | |
| 311 | + | |
315 | 312 | | |
316 | 313 | | |
317 | | - | |
318 | 314 | | |
319 | 315 | | |
320 | 316 | | |
| |||
332 | 328 | | |
333 | 329 | | |
334 | 330 | | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
| 331 | + | |
| 332 | + | |
342 | 333 | | |
343 | 334 | | |
344 | 335 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | 20 | | |
22 | | - | |
23 | | - | |
| 21 | + | |
| 22 | + | |
24 | 23 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| |||
144 | 146 | | |
145 | 147 | | |
146 | 148 | | |
| 149 | + | |
| 150 | + | |
147 | 151 | | |
148 | | - | |
| 152 | + | |
149 | 153 | | |
150 | 154 | | |
151 | 155 | | |
152 | 156 | | |
153 | 157 | | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
154 | 162 | | |
155 | 163 | | |
156 | 164 | | |
0 commit comments