unikraft / catalog

Unikraft Applications & Examples Catalog
23 stars 29 forks source link

`surreal:1.1`: Rust error when starting application #48

Open razvand opened 5 months ago

razvand commented 5 months ago

Starting SurrealDB 1.1 (PR #47 ) results in a Rust error. Use the following commands to replicate:

wget https://raw.githubusercontent.com/unikraft/catalog-for-maintainers/main/utils/start-buildkit.sh
source start-buildkit.sh
git clone https://github.com/unikraft-upb/catalog
cd catalog
git checkout -b razvand/library/surreal origin/razvand/library/surreal
cd library/surreal/1.1
sed -i -e "s/# CONFIG_LIBSYSCALL_SHIM_STRACE: 'y'/CONFIG_LIBSYSCALL_SHIM_STRACE: 'y'/" -e '/CONFIG_LIBPOSIX_ENVIRON_ENVP2/a\'$'\n''\    CONFIG_LIBPOSIX_ENVIRON_ENVP2: "RUST_BACKTRACE=full"' Kraftfile
kraft build --no-cache --no-update --plat qemu --arch x86_64
kraft rm --all ; kraft run --log-type basic --log-level debug -M 256M -p 8000:8000

This results in an error:

openat(AT_FDCWD, "/proc/self/maps", O_RDONLY|O_CLOEXEC) = No such file or directory (-2)
thread 'write(fd:2, "thread '", 8) = 8  
mainwrite(fd:2, "main", 4) = 4                             
' panicked at write(fd:2, "' panicked at ", 14) = 14                                                                   
/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/stacker-0.1.15/src/lib.rswrite(fd:2, "/root/.cargo/registry/sr"..., 84) = 84
:write(fd:2, ":", 1) = 1                                                                                               
416write(fd:2, "416", 3) = 3            
:write(fd:2, ":", 1) = 1                                                                                               
13write(fd:2, "13", 2) = 2  
:                                           
write(fd:2, ":\x0A", 2) = 2                                
assertion `left == right` failed        
  left: 2                                                  
 right: 0write(fd:2, "assertion `left == right"..., 52) = 52  

write(fd:2, "\x0A", 1) = 1                                                                                             
getcwd(0x356d014f600, 0x200, ...) = 0x2 
[...]

Without system calls, the error is:

2024-01-27T21:21:58.174848Z  INFO surreal::env: Running 1.1.1+20240116.b261047 for linux on x86_64
2024-01-27T21:21:58.176827Z  WARN surreal::dbs: ❌🔒 IMPORTANT: Authentication is disabled. This is not recommended for production use. 🔒❌
2024-01-27T21:21:58.179499Z  INFO surrealdb::kvs::ds: Starting kvs store in memory
2024-01-27T21:21:58.181290Z  INFO surrealdb::kvs::ds: Started kvs store in memory
2024-01-27T21:21:58.183067Z  INFO surrealdb::kvs::ds: Credentials were provided, and no root users were found. The root user 'root' will be created
thread 'main' panicked at /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/stacker-0.1.15/src/lib.rs:416:13:
assertion `left == right` failed
  left: 2
 right: 0
stack backtrace:
   0:       0x1002e3d35c - <unknown>
   1:       0x1002a6bff0 - <unknown>
   2:       0x1002e031a2 - <unknown>
   3:       0x1002e3f18e - <unknown>
   4:       0x1002e3e900 - <unknown>
   5:       0x1002e3fac2 - <unknown>
   6:       0x1002e3f4ec - <unknown>
   7:       0x1002e3f446 - <unknown>
   8:       0x1002e3f431 - <unknown>
   9:       0x1002380ee4 - <unknown>
  10:       0x10023811cb - <unknown>
  11:       0x10023a12e7 - <unknown>
razvand commented 3 months ago

The error is now updated to:

write(fd:2, "\x0A", 1) = 1
openat(AT_FDCWD, "", O_RDONLY|O_CLOEXEC) = fd:9
statx(0x9, 0x10040a0ae4, ...) = Function not implemented (-38)
newfstatat(0x9, 0x10040a0ae4, ...) = 0x0
mmap(NULL, 0, PROT_READ, MAP_PRIVATE, fd:9, 0) = Invalid argument (-22)
close(fd:9) = OK
 write(fd:2, " ", 1) = 1
 write(fd:2, " ", 1) = 1
10write(fd:2, "10", 2) = 2
: write(fd:2, ": ", 2) = 2
 write(fd:2, " ", 1) = 1
 write(fd:2, " ", 1) = 1
 write(fd:2, " ", 1) = 1
 write(fd:2, " ", 1) = 1
 write(fd:2, " ", 1) = 1
 write(fd:2, " ", 1) = 1
0xwrite(fd:2, "0x", 2) = 2
10023811cbwrite(fd:2, "10023811cb", 10) = 10
 - write(fd:2, " - ", 3) = 3
<unknown>write(fd:2, "<unknown>", 9) = 9

write(fd:2, "\x0A", 1) = 1
openat(AT_FDCWD, "", O_RDONLY|O_CLOEXEC) = fd:9
statx(0x9, 0x10040a0ae4, ...) = Function not implemented (-38)
newfstatat(0x9, 0x10040a0ae4, ...) = 0x0
mmap(NULL, 0, PROT_READ, MAP_PRIVATE, fd:9, 0) = Invalid argument (-22)
close(fd:9) = OK
 write(fd:2, " ", 1) = 1
 write(fd:2, " ", 1) = 1
11write(fd:2, "11", 2) = 2
: write(fd:2, ": ", 2) = 2
 write(fd:2, " ", 1) = 1
 write(fd:2, " ", 1) = 1
 write(fd:2, " ", 1) = 1
 write(fd:2, " ", 1) = 1
 write(fd:2, " ", 1) = 1
 write(fd:2, " ", 1) = 1
0xwrite(fd:2, "0x", 2) = 2
10023a12e7write(fd:2, "10023a12e7", 10) = 10
 - write(fd:2, " - ", 3) = 3
<unknown>write(fd:2, "<unknown>", 9) = 9

write(fd:2, "\x0A", 1) = 1
rt_sigprocmask(0x1, 0x41b06bb18, ...) = 0x0
gettid() = pid:1
getpid() = pid:1
tgkill(0x1, 0x1, ...) = Function not implemented (-38)
rt_sigaction(0x6, 0x41b06b9c0, ...) = 0x0
gettid() = pid:1
getpid() = pid:1
tgkill(0x1, 0x1, ...) = Function not implemented (-38)
en1: Set IPv4 address 10.0.2.15 mask 255.255.255.0 gw 10.0.2.2

Without system calls, the error is:

en1: Interface is up
Powered by Unikraft Telesto (0.16.2~2ac0ecaa)

 .d8888b.                                             888 8888888b.  888888b.
d88P  Y88b                                            888 888  'Y88b 888  '88b
Y88b.                                                 888 888    888 888  .88P
 'Y888b.   888  888 888d888 888d888  .d88b.   8888b.  888 888    888 8888888K.
    'Y88b. 888  888 888P'   888P'   d8P  Y8b     '88b 888 888    888 888  'Y88b
      '888 888  888 888     888     88888888 .d888888 888 888    888 888    888
Y88b  d88P Y88b 888 888     888     Y8b.     888  888 888 888  .d88P 888   d88P
 'Y8888P'   'Y88888 888     888      'Y8888  'Y888888 888 8888888P'  8888888P'

2024-03-07T05:53:07.224249Z  INFO surreal::env: Running 1.1.1+20240116.b261047 for linux on x86_64
2024-03-07T05:53:07.227289Z  WARN surreal::dbs: ❌🔒 IMPORTANT: Authentication is disabled. This is not recommended for production use. 🔒❌
2024-03-07T05:53:07.231243Z  INFO surrealdb::kvs::ds: Starting kvs store in memory
2024-03-07T05:53:07.233208Z  INFO surrealdb::kvs::ds: Started kvs store in memory
2024-03-07T05:53:07.235187Z  INFO surrealdb::kvs::ds: Credentials were provided, and no root users were found. The root user 'root' will be created
thread 'main' panicked at /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/stacker-0.1.15/src/lib.rs:416:13:
assertion `left == right` failed
  left: 2
 right: 0
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
en1: Set IPv4 address 10.0.2.15 mask 255.255.255.0 gw 10.0.2.2