Ethr_mutex.h:657: Fatal error in ethr_mutex_lock(): Invalid argument (22) Aborted (core dumped)

What can I do to avoid seeing this error again? (Answer: Program in Pascal) What can I do to avoid seeing this error and still program in Elixir?

../include/internal/ethr_mutex.h:657: Fatal error in ethr_mutex_lock(): Invalid argument (22)
Aborted (core dumped)

I’m guessing it’s this Erlang file:https://fossies.org/linux/otp/erts/include/internal/ethr_mutex.h

  652 static ETHR_INLINE void
  653 ETHR_INLINE_MTX_FUNC_NAME_(ethr_mutex_lock)(ethr_mutex *mtx)
  654 {
  655     int res = pthread_mutex_lock(&mtx->pt_mtx);
  656     if (res != 0)
  657     ETHR_FATAL_ERROR__(res);
  658 }

And it also looks like error code 22 is EINVAL

   EINVAL The mutex was created with the protocol attribute having
          the value PTHREAD_PRIO_PROTECT and the calling thread's
          priority is higher than the mutex's current priority
          ceiling.

https://man7.org/linux/man-pages/man3/pthread_mutex_lock.3p.html

Elixir/Erlang/OS specs:

elixir --version
Erlang/OTP 25 [erts-13.0.3] [source] [64-bit] [smp:128:128] [ds:128:128:10] [async-threads:1] [jit:ns]
Elixir 1.13.2 (compiled with Erlang/OTP 24)

uname -rmo
Arch Linux: 5.15.61-1-lts

Did I run out of resources? Should I stop doing things like max_connections: (:erlang.system_info(:logical_processors_available) * 4) or running async_stream() when I have LOTS of cores?

I’m not sure if it’s related, but there’s this issue - also a segfault, also around pthreads, also new in OTP25 :thinking:

May want to cross post to Erlang forums too.

Likely not the root cause, but OTP 25 is only officially supported with elixir >=1.13.4