| ... | ... | @@ -1130,6 +1130,10 @@ const LinuxThreadImpl = struct { |
| 1130 | 1130 | [len] "r" (self.mapped.len), |
| 1131 | 1131 | : "memory" |
| 1132 | 1132 | ), |
| 1133 | // We set `sp` to the address of the current function as a workaround for a Linux |
| 1134 | // kernel bug that caused syscalls to return EFAULT if the stack pointer is invalid. |
| 1135 | // The bug was introduced in 46e12c07b3b9603c60fc1d421ff18618241cb081 and fixed in |
| 1136 | // 7928eb0370d1133d0d8cd2f5ddfca19c309079d5. |
| 1133 | 1137 | .mips, .mipsel => asm volatile ( |
| 1134 | 1138 | \\ move $sp, $25 |
| 1135 | 1139 | \\ li $2, 4091 # SYS_munmap |