You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the symlink syscall implementation fromvfscore sets the errno variable to some default values that don't correspond to the man pages in case of an error. This might be a problem when some ported apps explicitly check for a specific errno to continue.
Steps to reproduce
For reproduction, you can use this repository to compare errno results across multiple modes. This repo lets you compile and run the testsuite both as a plain linux source and as an Unikraft app. You can use the run.sh script with the plain argument to compile the source file and run it as a linux executable and qemu-root argument to build and run the testsuite as a Unikraft app. When you will run the plain executable, you will see that the errno is set to ELOOP in the eloop test, while on Unikraft side it will return ENOENT.
Expected behavior
The expectation is that Unikraft will set the errno correctly, as per man pages description.
Which architectures were you using or does this bug affect?
x86_64
Which platforms were you using or does this bug affect?
kvm
Relevant log output
Plain testsuite output:
Preparing ELOOP test.
Symlink call returned -1.
ERRNO: 40. Too many levels of symbolic links.
FINISHING ELOOP test.
--------------------
Preparing EEXIST test.
Symlink call returned -1.
ERRNO: 2. No such file or directory.
FINISHING EEXIST test.
--------------------
Preparing ENOENT test.
Symlink call returned -1.
ERRNO: 2. No such file or directory.
FINISHING ENOENT test.
--------------------
Preparing WRITE_CONTENT test.
Symlink call returned 0
fd=3
FINISHING WRITE_CONTENT test.
--------------------
Unikraft testuite output:
Powered by
o. .o _ _ __ _
Oo Oo ___ (_) | __ __ __ _ ' _) :_oO oO ' _ `|||/ / _)' _` | |_| _)oOo oOO| | | | | (| | | (_) | _) :_ OoOoO ._, ._:_:_,\_._, .__,_:_, \___) Epimetheus 0.12.0~45d00c7d[ 0.174027] Info: [libukboot] <boot.c @ 348> Pre-init table at 0x1e0098 - 0x1e0098[ 0.177254] Info: [libukboot] <boot.c @ 359> Constructor table at 0x1e0098 - 0x1e0098[ 0.180522] Info: [libukboot] <boot.c @ 369> Calling main(2, ['build/test-symlink_kvm-x86_64', 'console=ttyS0'])Preparing ELOOP test.Symlink call returned -1.ERRNO: 2. No such file or directory. FINISHING ELOOP test.--------------------Preparing EEXIST test.Symlink call returned -1.ERRNO: 2. No such file or directory.FINISHING EEXIST test.--------------------Preparing ENOENT test.Symlink call returned -1.ERRNO: 2. No such file or directory.FINISHING ENOENT test.--------------------Preparing WRITE_CONTENT test.Symlink call returned 0fd=3FINISHING WRITE_CONTENT test.--------------------
The text was updated successfully, but these errors were encountered:
The `sys_symlink()` function returns `ENOENT` if the lookup failed,
instead of the actual error code `lookup()` exited with.
This may not always be right, since `lookup()` can return other error
codes (for example `ELOOP`).
Fix that by not setting the error code and just jump to the end of the
function.
Signed-off-by: Stefan Jumarea <stefanjumarea02@gmail.com>
GitHub-Closes: unikraft#849
Hello, @StefanJum ! Yes, the problem is solved with those two PRs. Sadly, I haven't managed to add more tests to check more ERRNO cases. Will work on adding more and see if any differences appear.
Describe the bug
Currently, the symlink syscall implementation from
vfscore
sets theerrno
variable to some default values that don't correspond to the man pages in case of an error. This might be a problem when some ported apps explicitly check for a specificerrno
to continue.Steps to reproduce
For reproduction, you can use this repository to compare errno results across multiple modes. This repo lets you compile and run the testsuite both as a plain linux source and as an Unikraft app. You can use the
run.sh
script with theplain
argument to compile the source file and run it as a linux executable andqemu-root
argument to build and run the testsuite as a Unikraft app. When you will run the plain executable, you will see that the errno is set toELOOP
in the eloop test, while on Unikraft side it will returnENOENT
.Expected behavior
The expectation is that Unikraft will set the errno correctly, as per man pages description.
Which architectures were you using or does this bug affect?
x86_64
Which platforms were you using or does this bug affect?
kvm
Relevant log output
The text was updated successfully, but these errors were encountered: