[erlang-questions] Scheduling issues with Erlang on RTEMS

Sébastien Merle s.merle@REDACTED
Tue Feb 13 13:03:31 CET 2018


Hi,

We are working on GRiSP (grisp.org) and we are porting the Erlang VM to
PowerPC/RTEMS. Everything works fine with 19.3.6 without threading (
`--disable-threads`). But with PLAIN or SMP build of either Erlang 19.3.6
or 20.2 we found a strange scheduling issue. Any hints and ideas on how to
debug it would be so greatly appreciated!

We have a very simple project to test the issue, it has a single supervisor
starting a `proc_lib` worker that stay in a busy loop after calling
`proc_lib:init_ack` and a second worker that is a normal `gen_server` doing
nothing. The symptom is that the supervisor starts the first worker and
never get to start the second one, we never get to the Erlang console. When
tracing the supervisor module (with `dbg`) we can see it "blocks" on
`supervisor:do_start_child`, and when enabling verbose logging with the
debug build we can see no processes gets started. This appends all the
time, it is 100% reproducible.

What makes us think it is a scheduling issue is that adding `receive after
1 -> ok end` in the busy loop seems to fix the issue and properly start the
second process and get us to the Erlang console.

Our port of the same code to ARM/RTEMS is working fine, we only have this
issue on PowerPC.

We cannot use VM probes because we don't have DTrace on RTEMS, printing
debug in `erl_process.c` is probably not a good idea and there is no clear
place where to start debugging from with a hardware debugger.

Any guidelines, hints or ideas on how to debug this?

Thank you very much.

Regards,
Sebastien Merle.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20180213/c191c7b7/attachment.htm>


More information about the erlang-questions mailing list