[erlang-bugs] system_limit: erlc passing options as atoms to erl

Björn Gustavsson bjorn@REDACTED
Tue Feb 11 07:06:09 CET 2014


On Mon, Feb 10, 2014 at 6:30 PM, Richard Carlsson
<carlsson.richard@REDACTED> wrote:
> The erlc program (erts/etc/common/erlc.c) invokes the erlang compiler as
> "erl ... -s erl_compile compile_cmdline ...", which means that the command
> line options are passed as atoms (due to -s). If an option string gets too
> long, erlc crashes with reason 'system_limit' because atoms cannot be longer
> than 255 characters.
>
> Case in point: the erlc option -MT ... gets passed as
> {makedep_target,"..."}, where the target string is a list of one or more
> filenames, typically generated from a Makefile. If the filenames are long
> (in particular if absolute paths are used), this string can get longer than
> 255 characters.
>
> Suggested solution: rewrite erlc (and other similar executables) to pass
> options using the -run or -eval flag instead of -s.
>

Already fixed in the upcoming Erlang/OTP 17.0 (and included in
17.0-rc1). Except for a few special arguments, erlc now passes the
complete command to erlang use the -extra option, and the command
line is then retrieved by erl_compile using init:get_plain_arguments/0.

The other executables (dialyzer, typer, etc) already use use -extra
and init:get_plain_arguments/0.

/Björn

-- 
Björn Gustavsson, Erlang/OTP, Ericsson AB



More information about the erlang-bugs mailing list