Commit c267eed
[48.0.0] Some more backports (#14138)
* Fix panic compiling an empty component with debug info (#14130)
generate_simulated_dwarf unwrapped the first core-module translation to
name its compilation unit, but a component with no core modules has no
translations, so `wasmtime compile -D debug-info=y` panicked on a valid
`(component)` input. Return early instead: with no translations there are
no functions to describe.
* Run linker callback finalizers on invalid names (#14126)
* Shuffle more finalizers in the C API (#14133)
* Shuffle more finalizers in the C API
This implements a similar refactoring to #14126 but for the component
linker as well.
* Clang-format
* fix(wasmtime-cli): generic eio error thrown for wasip2 (#14107)
* Cranelift: unwind last-store state after removing a dead store (#14111)
Alias analysis's dead-store elimination removed the dead store's `mem_values`
entry, but left the region's last-store slot naming the instruction it had just
deleted. Leaving the removed-store meant that when we then reprocess the
overwriting store, we keyed its lookup on a removed instruction, found nothing,
and failed to notice that (for example) the overwriting store became idempotent
and could also be removed.
With this commit, each store now records the memory version it displaced, and
eliminating a dead store rolls that version back, so a chain like
v1 = load.i32 region0 v0
store region0 v2, v0 ;; dead
store region0 v1, v0 ;; idempotent once the dead store is gone
collapses in the single pass we actually make, rather than removing only one
link in the chain and requiring that we do N passes to fully clean up a chain of
N dead/idempotent stores. This code pattern the shape fused sync adapters emit
around the `MAY_LEAVE` flag and the relevant disas tests each lose a store as a
result.
* Alias analysis: do not restore the last-fence into a region slot (#14134)
* Alias analysis: do not restore the last-fence into a region slot
When we eliminate a dead store, we undo the effects that the dead store had on
the `LastStore` state. However, querying the last store for a particular region
falls back to the last fence, and we were incorrectly restoring that last fence
into the region slot, rather than resetting the region slot to `None`. While
technically incorrect, it was generally benign, but it did lead to "observing"
instructions that we didn't mark observed during our initial observation pass,
which ultimately led to debug assertion failures.
Fixes #14131
* untrim whitespace in filetests
* Return is-directory when a directory fd is used as a file (#14135)
* wasip2: return is-directory when a directory fd is used as a file
Descriptor::file() treated a directory as a bad descriptor. POSIX
read/write on a directory is EISDIR, and wasi:filesystem already has
is-directory. Preview1 guests still get EBADF (separate match and
adapter).
Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
* wasip2: map is-directory only on read-via-stream
Descriptor::file() must stay bad-descriptor for directories.
wasi-testsuite filesystem-advise expects that for advise.
Return is-directory from read-via-stream only (p2 result, p3
result future) so a directory read matches POSIX EISDIR.
Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
---------
Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
* Fix test expectations
---------
Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
Co-authored-by: m0g3r <87276771+m0g3r@users.noreply.github.com>
Co-authored-by: grandpig <grandpig@outlook.com>
Co-authored-by: Eduardo de Moura Rodrigues <16357187+eduardomourar@users.noreply.github.com>
Co-authored-by: Nick Fitzgerald <fitzgen@gmail.com>
Co-authored-by: Sebastien Tardif <SebTardif@ncf.ca>1 parent fc78952 commit c267eed
28 files changed
Lines changed: 827 additions & 64 deletions
File tree
- cranelift
- codegen/src
- filetests/filetests/alias
- crates
- c-api
- src
- component
- tests
- component
- cranelift/src/debug/transform
- test-programs/src/bin
- wasi/src
- cli
- p2/host
- p3/filesystem
- tests
- all
- cli_tests
- disas/component-model
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
424 | 424 | | |
425 | 425 | | |
426 | 426 | | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
427 | 464 | | |
428 | 465 | | |
429 | 466 | | |
| |||
527 | 564 | | |
528 | 565 | | |
529 | 566 | | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
530 | 592 | | |
531 | 593 | | |
532 | 594 | | |
| |||
576 | 638 | | |
577 | 639 | | |
578 | 640 | | |
579 | | - | |
580 | | - | |
581 | | - | |
| 641 | + | |
582 | 642 | | |
583 | 643 | | |
584 | 644 | | |
| |||
754 | 814 | | |
755 | 815 | | |
756 | 816 | | |
757 | | - | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
758 | 848 | | |
759 | 849 | | |
760 | 850 | | |
| |||
769 | 859 | | |
770 | 860 | | |
771 | 861 | | |
772 | | - | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
773 | 868 | | |
774 | 869 | | |
775 | 870 | | |
| |||
806 | 901 | | |
807 | 902 | | |
808 | 903 | | |
809 | | - | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
810 | 916 | | |
811 | 917 | | |
812 | 918 | | |
| |||
831 | 937 | | |
832 | 938 | | |
833 | 939 | | |
834 | | - | |
835 | | - | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
836 | 943 | | |
837 | 944 | | |
838 | 945 | | |
| |||
851 | 958 | | |
852 | 959 | | |
853 | 960 | | |
854 | | - | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
855 | 971 | | |
856 | 972 | | |
857 | 973 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | 24 | | |
26 | 25 | | |
27 | 26 | | |
| 27 | + | |
Lines changed: 181 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 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 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
0 commit comments