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
{{ message }}
Repository navigation
BEAM runtime errors with a non-string reason print as Internal error: ~p, with no source position #750
When a compiled program dies with an Erlang reason that is not a string (function_clause, badarith, badmatch, {case_clause, …}), the runner prints it with ~p under "Internal error":
$ kex clause.kex # area/1 called with a constructor it has no clause for
Internal error: function_clause
The format is in runBuiltProgram (src/driver/compile.cxx):
So a fault in user code reads like a compiler crash and carries no file:line:col, which Kex's own runtime errors do (app.kex:8:26: runtime error: …).
Suggestion: translate the common BEAM reasons into a Kex runtime error naming the function and position (the stack trace has module and function; lowering already passes positions to the kex_intrinsic_* calls), and keep "Internal error" for reasons that really are internal.
Related: #704 (runtime faults should be rescuable; BEAM reasons inconsistent).
Seen on 0.4.0-rc.4 (0292db50), macOS arm64, OTP 29.
Activity