Fix INTERNAL_SYSCALL uninitialized resultvar#996
Fix INTERNAL_SYSCALL uninitialized resultvar#996rishabhBudhouliya wants to merge 1 commit intomainfrom
Conversation
End-to-End Test ReportTest PreviewUnified Test Report grate harness
Cases
wasm harnessTest ReportDeterministic TestsSummary
Test Results by Category
Fail TestsSummary
Test Results by Category
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
As I was reading more about how we handle no-op syscalls in modified glibc, it would be more coherent and clean using the |
|
Need a bit more context with comments |
|
@rennergade As per my understanding, we use lind-wasm/src/glibc/sysdeps/unix/sysdep.h Line 228 in 4e2fb7e However, for setgid(), we were using lind-wasm/src/glibc/sysdeps/unix/sysv/linux/setgid.c Lines 26 to 29 in 4e2fb7e which returns a garbage value instead of a 0. This PR attempts to fix the root cause of that garbage value and effectively starts returning 0 even from |
|
how's |
|
@qianxichen233 lind-wasm/src/glibc/sysdeps/unix/sysv/linux/i386/sysdep.h Lines 320 to 329 in 1bed551 that has an uninitialized variable called |
|
I looked into this a little bit, the correct call path is Though the call path isn't really matter. The actual issue behind it is that In its original glibc design, This is basically the same issue as #709, all the For this PR, I think first we shouldn't still redirect to setgid to The fix for |
|
@rishabhBudhouliya Could you please address Qianxi's comments? |
Purpose
As reported in Lind-Project/lind-wasm-apps#161, nginx fails when
setgidreturns a non-zero value.Upon investigation, nginx calls setgid which goes through this trace
lind-wasm/src/glibc/sysdeps/unix/sysv/linux/setgid.c
Lines 23 to 29 in ebbe66c
lind-wasm/src/glibc/sysdeps/unix/sysv/linux/i386/sysdep.h
Lines 320 to 329 in ebbe66c
The
register unsigned int resultvar;is uninitialized which returns a garbage value back to nginx.Fix
Initialize resultvar as 0 solved the problem
Test