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
My rust application has a C component which calls lua-jit to support lua scripts. These scripts sometimes execute system tools via lua's support for launching external process/shell. When these scripts are heavily used, sometimes the application would simply hang.
I was able to attach gdb to a debug version on one occasion. The stack traces show that most threads are within the lua code, waiting on a low-level lock due to some OS system call. One thread shows that rust's jemalloc (which is the allocator for all code even the C components in this app), is also waiting on a low-level lock.
Because of these tests:
Windows build does not exhibit this behavior (it uses system allocator)
Linux build hangs with jemalloc
Linux build is ok with jemalloc disabled (specifying system allocator in rust code)
I think that rust's version of jemalloc is causing a deadlock. I'm not sure if this would affect pure rust code, rust + C code that doesn't extensively make system calls, etc. or if this is a combination of rust + jemalloc + lua-jit calling lots of system calls (popen, pclose, etc.).
Your compiler version is a year and a half out of date. Rust applications have used the system allocator by default since the 1.32.0 release (13 months ago).
It is worth noting that we do not actively support versions that are so outdated. It would be great if you could try this same code with the current stable compiler with jemalloc enabled and see if it reproduces. Otherwise this issue should be closed.
My rust application has a C component which calls lua-jit to support lua scripts. These scripts sometimes execute system tools via lua's support for launching external process/shell. When these scripts are heavily used, sometimes the application would simply hang.
I was able to attach gdb to a debug version on one occasion. The stack traces show that most threads are within the lua code, waiting on a low-level lock due to some OS system call. One thread shows that rust's jemalloc (which is the allocator for all code even the C components in this app), is also waiting on a low-level lock.
Because of these tests:
I think that rust's version of jemalloc is causing a deadlock. I'm not sure if this would affect pure rust code, rust + C code that doesn't extensively make system calls, etc. or if this is a combination of rust + jemalloc + lua-jit calling lots of system calls (popen, pclose, etc.).
Backtrace below.
This may be related to #31030 or jemalloc/jemalloc/issues/315
Meta
rustc --version --verbose
:Backtrace
The text was updated successfully, but these errors were encountered: