log_mf_h and rb do not handle terms over 65k
Garret Smith
garret.smith@REDACTED
Mon May 17 20:15:52 CEST 2010
I was logging a couple very large terms using
error_logger:info_report and log_mf_h during application start,
and was always unable to read most of the first log file
generated. This was mystifying me for a while until I finally
traced the source.
log_mf_h and rb use a 2-byte length indicator for the term they
are about to read/write, therefore they cannot handle terms
over 65,536 bytes in length. See handle_event/2 in log_mf_h
and read_report/1 in rb
Increasing the length field would break backwards compatibility,
but maybe it would be prudent to truncate the term to the max
length or replace it with a "term to big" message so that the rest
of the log file is not corrupted? When this happens in my
application, the rest of the log file is unreadable.
Has anyone else experienced this or know of a workaround
(other than the obvious of checking the term size in my
application code)?
Thanks,
Garret Smith
More information about the erlang-questions
mailing list