-
Notifications
You must be signed in to change notification settings - Fork 6
Support for newer syscalls #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
To make it work with glibc 2.35 shipped with Ubuntu jammy
|
I tried your changes (plus mine that ported this project to python 3), on a project I wanted to debug the makefiles, and it also failed with a unrecognised symlinkat syscall (decimal 266, hex 0x10A). It has the second argument as an integer as a file handle. I wasn't quite sure what the contents of the function to point at should be yet, do you have an idea? |
|
@echoix I pushed a new commit to support Note that I just tested a simple program, not tested seriously. #include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
int main() {
int fd;
char *path = "test.txt";
char *symlink_path = "test_symlink.txt";
// Create a file
fd = open(path, O_CREAT | O_RDWR, 0644);
if (fd == -1) {
perror("open");
exit(EXIT_FAILURE);
}
close(fd);
// Create a symbolic link
if (symlinkat(path, AT_FDCWD, symlink_path) == -1) {
perror("symlinkat");
exit(EXIT_FAILURE);
}
printf("Symbolic link created successfully.\n");
return 0;
} |
|
I'll check what it looks like this weekend. I don't know if this tool will help me at all yet, but I hope so |
|
It got a bit further :) make[3]: Entering directory '/workspace/mkcheck/grass/include/grass'
/usr/bin/install -c -m 644 version.h /workspace/mkcheck/grass/dist.x86_64-pc-linux-gnu/include/grass/version.h
../../config.status --config | sed "s/'//g" | sed 's/\(.*\)/".\/configure \1"/' > /workspace/mkcheck/grass/dist.x86_64-pc-linux-gnu/include/grass/confparms.h
[Exception] Exception while handling syscall 266 in process 108 (/usr/bin/ln): Cannot read from child memory (errno = 14)and running again without cleaning this time: (cd /workspace/mkcheck/grass/dist.x86_64-pc-linux-gnu/lib; ln -f -s libgrass_datetime.8.4.so /workspace/mkcheck/grass/dist.x86_64-pc-linux-gnu/lib/libgrass_datetime.so)
[Exception] Exception while handling syscall 266 in process 226 (/usr/bin/ln): Cannot read from child memory (errno = 14)The error message is from Lines 40 to 72 in ea826e3
At first my make had multiple jobs ( I'm trying to connect a debugger to see whats going on now |
|
Ok, what's weird is that the first errors I encountered was with the existing sys_symlink syscall. But in the meantime, in my fork, I adapted the project to be able to compile with gcc (at least for gcc 11 and gcc 12). It is simply that the table with the syscall hooks need to be ordered, and without blanks. I filled a lot of them with Unfortunately (but expectedly), it created the same errors. So it's not from the new function sys_symlinkat. When I added a breakpoint just before the throw, the buffer read way past the |
To make it work with glibc 2.35 shipped with Ubuntu jammy