Open andree182 opened 1 month ago
I suppose that this is the same problem as shmctl, we are mixing the kernel syscall with the glibc structure layout. I suppose that we need the kernel structure layout for the raw syscall instead of the glibc layout.
For some reason, semctl09 fails unless compiled with -O0.
It looks like __semctl64 is used for the actual call. With -O0, it seems to return the same structure that is returned in the kernel, with -O1 not, the structure gets mostly zeroed after the call
Most likely semid_ds is not the right thing to put into the call to SEM_STAT_ANY (making it static confirms the issue by segfault).
E.g.
char info[2048];
in do_semctl() fixes the issue.