Repository navigation
Commit 773a2da
rt: open files non-inheritable on Windows; fix libc_sig's doc comment
The intermittent Windows CI failure -- "Permission denied" from inside
the runtime's unit tests, first seen at 4ad0166 -- is now named, by the
panic its fatal error makes in a test: a_field_window_outlives_its_file
closing a file and opening it again.
The C library's handles are inheritable by default on Windows, and the
unit tests that expect a fatal error run in child processes, beside the
file tests. A child started while a file was open for writing kept a
write handle of its own to it, so reopening the file -- which refuses
other writers (_SH_DENYWR, as the assembly runtime's CreateFileA did) --
failed for as long as the child lived. sys::open now adds MSVC's N mode
flag, so the handle stays in the process that opened it. The same would
have bitten a program the compiler runs, had the compiler started a child.
an_open_file_is_not_inherited_by_a_child reproduces it: under Wine it
failed with Permission denied before, and passes now.
Also: LIBC_FUNCTIONS had taken libc_sig's doc comment above its own; each
has its own again (review feedback).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>1 parent 3ea783a commit 773a2da
3 files changed
Lines changed: 45 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1343 | 1343 | | |
1344 | 1344 | | |
1345 | 1345 | | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
1346 | 1371 | | |
1347 | 1372 | | |
1348 | 1373 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
550 | 550 | | |
551 | 551 | | |
552 | 552 | | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
553 | 559 | | |
554 | 560 | | |
555 | 561 | | |
556 | 562 | | |
557 | | - | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
558 | 576 | | |
559 | 577 | | |
560 | 578 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
538 | 538 | | |
539 | 539 | | |
540 | 540 | | |
541 | | - | |
542 | 541 | | |
543 | 542 | | |
544 | 543 | | |
545 | 544 | | |
546 | 545 | | |
547 | 546 | | |
| 547 | + | |
548 | 548 | | |
549 | 549 | | |
550 | 550 | | |
| |||
0 commit comments