Skip to content

bun repl exits with no error message if /tmp is mounted noexec #25825

@190n

Description

@190n

What version of Bun is running?

1.3.5+1e86cebd7

What platform is your computer?

Linux 6.12.15-production+truenas x86_64 unknown

What steps can reproduce the bug?

Run bun repl on a system where /tmp is mounted with noexec (in my case TrueNAS Scale)

What is the expected behavior?

It should work, or at the minimum it should show what went wrong like exec /tmp/bunx-1000-bun-repl@latest/node_modules/.bin/bun-repl: Permission denied

What do you see instead?

$ bun repl
$ echo $?
1

Additional information

output of strace -f -e trace=file bun repl
execve("/mnt/tank/home/ben/.bun/bin/bun", ["bun", "repl"], 0x7ffc8ee8d060 /* 23 vars */) = 0
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=33174, ...}, AT_EMPTY_PATH) = 0
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
newfstatat(3, "", {st_mode=S_IFREG|0755, st_size=1922136, ...}, AT_EMPTY_PATH) = 0
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3
newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=14480, ...}, AT_EMPTY_PATH) = 0
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3
newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=14480, ...}, AT_EMPTY_PATH) = 0
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libm.so.6", O_RDONLY|O_CLOEXEC) = 3
newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=907784, ...}, AT_EMPTY_PATH) = 0
open("/proc/sys/vm/overcommit_memory", O_RDONLY) = 3
access("/sys/devices/system/node/node1", R_OK) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/proc/self/maps", O_RDONLY|O_CLOEXEC) = 3
newfstatat(3, "", {st_mode=S_IFREG|0444, st_size=0, ...}, AT_EMPTY_PATH) = 0
getcwd("/mnt/tank/home/ben/photocheck", 4096) = 30
openat(AT_FDCWD, "/", O_RDONLY|O_CLOEXEC|O_DIRECTORY) = 3
openat(AT_FDCWD, "/mnt/", O_RDONLY|O_CLOEXEC|O_DIRECTORY) = 4
openat(AT_FDCWD, "/mnt/tank/", O_RDONLY|O_CLOEXEC|O_DIRECTORY) = 5
openat(AT_FDCWD, "/mnt/tank/home/", O_RDONLY|O_CLOEXEC|O_DIRECTORY) = 6
openat(AT_FDCWD, "/mnt/tank/home/ben/", O_RDONLY|O_CLOEXEC|O_DIRECTORY) = 7
openat(AT_FDCWD, "/mnt/tank/home/ben/photocheck", O_RDONLY|O_CLOEXEC|O_DIRECTORY) = 8
openat(8, "node_modules/.bin", O_RDONLY|O_CLOEXEC|O_PATH|O_DIRECTORY) = 9
readlink("/proc/self/fd/9", "/mnt/tank/home/ben/photocheck/no"..., 4096) = 47
openat(8, "package.json", O_RDONLY)     = 9
openat(8, "tsconfig.json", O_RDONLY)    = 9
readlink("/proc/self/exe", "/mnt/tank/home/ben/.bun/bin/bun", 4097) = 31
symlink("/mnt/tank/home/ben/.bun/bin/bun", "/tmp/bun-node-1e86cebd7/node") = -1 EEXIST (File exists)
symlink("/mnt/tank/home/ben/.bun/bin/bun", "/tmp/bun-node-1e86cebd7/bun") = -1 EEXIST (File exists)
stat("/tmp/bun-node-1e86cebd7/bun-repl", 0x7ffcecefd830) = -1 ENOENT (No such file or directory)
stat("/mnt/tank/home/ben/photocheck/node_modules/.bin/bun-repl", 0x7ffcecefd830) = -1 ENOENT (No such file or directory)
stat("/mnt/tank/home/ben/photocheck/node_modules/.bin/bun-repl", 0x7ffcecefd830) = -1 ENOENT (No such file or directory)
stat("/mnt/tank/home/ben/node_modules/.bin/bun-repl", 0x7ffcecefd830) = -1 ENOENT (No such file or directory)
stat("/mnt/tank/home/node_modules/.bin/bun-repl", 0x7ffcecefd830) = -1 ENOENT (No such file or directory)
stat("/mnt/tank/node_modules/.bin/bun-repl", 0x7ffcecefd830) = -1 ENOENT (No such file or directory)
stat("/mnt/node_modules/.bin/bun-repl", 0x7ffcecefd830) = -1 ENOENT (No such file or directory)
stat("/node_modules/.bin/bun-repl", 0x7ffcecefd830) = -1 ENOENT (No such file or directory)
stat("/mnt/tank/home/ben/.bun/bin/bun-repl", 0x7ffcecefd830) = -1 ENOENT (No such file or directory)
stat("/usr/local/bin/bun-repl", 0x7ffcecefd830) = -1 ENOENT (No such file or directory)
stat("/usr/bin/bun-repl", 0x7ffcecefd830) = -1 ENOENT (No such file or directory)
stat("/bin/bun-repl", 0x7ffcecefd830)   = -1 ENOENT (No such file or directory)
stat("/usr/local/games/bun-repl", 0x7ffcecefd830) = -1 ENOENT (No such file or directory)
stat("/usr/games/bun-repl", 0x7ffcecefd830) = -1 ENOENT (No such file or directory)
stat("/tmp/bunx-1000-bun-repl@latest/node_modules/.bin/bun-repl", {st_mode=S_IFREG|0777, st_size=2221, ...}) = 0
newfstatat(AT_FDCWD, "/tmp/bunx-1000-bun-repl@latest/node_modules/.bin/bun-repl", {st_mode=S_IFREG|0777, st_size=2221, ...}, 0) = 0
../strace: Process 3369780 attached
[pid 3369780] chdir("/mnt/tank/home/ben/photocheck") = 0
[pid 3369780] execve("/tmp/bunx-1000-bun-repl@latest/node_modules/.bin/bun-repl", ["/tmp/bunx-1000-bun-repl@latest/n"...], 0x5b3686d0440 /* 33 vars */) = -1 EACCES (Permission denied)
[pid 3369780] +++ exited with 127 +++
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=3369780, si_uid=1000, si_status=127, si_utime=0, si_stime=1 /* 0.01 s */} ---
+++ exited with 1 +++

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions