Fix INTERNAL_SYSCALL uninitialized resultvar#996
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? |
|
@rishabhBudhouliya @qianxichen233 Do we have a consensus on how to proceed on this? |
|
@Yaxuan-w Wondering if we close this for now? |
|
@vidyalakshmir I didn't find the related discussion decision. I'll close it for now and feel free to open up issues for tracking |
|
@Yaxuan-w What I meant is do we merge this for now and if changes are required later, we could do it. This PR essentially fixes the issue of uninitialized resultvar and the fix here is to return 0. The later discussions mention about refactoring INTERNAL_SYSCALL in all cases where it is invoked. We could do that as a future work. @rishabhBudhouliya With the current changes you have made to this PR, does nginx work? If so, we could merge this. |
End-to-End Test ReportTest Previewgrate harnessGrate Test Report
Cases
static harnessTest ReportDeterministic TestsSummary
Test Results by Category
Fail TestsSummary
wasm harnessTest ReportDeterministic TestsSummary
Test Results by Category
Fail TestsSummary
Test Results by Category
C++ harnessSummary
Cases
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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