werl R14A on windows 7 frequently crashes during file access

Brian Williams <>
Thu Jul 15 18:39:03 CEST 2010


I'm not entirely sure what combination of running software is causing
this. I have a program that opens a list of log files (~100kb to
~200kb), reads one a line at a time, matches the line against some
regexes, prints a report and finishes). Sometimes it works without a
problem. But other times werl will crash one or two lines into reading
the first log file, or when it opens up the report file. I have my
.erl, .beam and final report file in a Dropbox directory, which may be
affecting it. But the log files I'm opening for read are in a normal
directory. None of the files are in use by another running program,
except the .erl is open in my editor.

Win7 gives me a report like this when it crashes:
Problem signature:
  Problem Event Name:	APPCRASH
  Application Name:	werl.exe
  Application Version:	0.0.0.0
  Application Timestamp:	4c17b8f1
  Fault Module Name:	beam.smp.dll
  Fault Module Version:	0.0.0.0
  Fault Module Timestamp:	4c17b83a
  Exception Code:	c0000005
  Exception Offset:	000cc562
  OS Version:	6.1.7600.2.0.0.256.48
  Locale ID:	1033
  Additional Information 1:	0a9e
  Additional Information 2:	0a9e372d3b4ad19135b953a78882e789
  Additional Information 3:	0a9e
  Additional Information 4:	0a9e372d3b4ad19135b953a78882e789

The file open/close/read code is:
%% Iterarate over files and generate report
% initialize report accumulator
report(Files) -> report(Files, []).
report([], Reports) ->
    case file:open("ErrorReport.txt", write) of
        {ok, Dev} ->
            io:format("Opened Report file for writing~n", []),
            map(fun({FileName, Report}) -> print_report(Dev, FileName,
Report) end, lists:reverse(Reports)),
            file:close(Dev);
        {error, Reason} ->
            io:format("Error opening final report file: ~p~n", [Reason]),
            {error, Reason}
    end;
report([FileName | Rest], Acc) ->
    io:format("Attempting to open: ~p~n", [FileName]),
    % read file into memory
    case file:open(FileName, read) of
        {ok, Dev} ->
            % scan the lines for string matches, one line at a time
            {ok, WarningExp} = re:compile("warning", [caseless]),
            {ok, ErrorExp} = re:compile("error", [caseless]),

            Compiled_Tests = [
                {warnings, warning_exps(), WarningExp},
                {errors, error_exps(), ErrorExp}],
            Report = scan_lines(Compiled_Tests, Dev, io:get_line(Dev, '')),
            % close file
            file:close(Dev),
            % recurse
            report(Rest, [{FileName, Report} | Acc]);
        {error, Reason} ->
            report(Rest, [{error, Reason} | Acc])
    end.

Not sure how I can prevent werl from crashing and figure out what's
going on. Has anyone else seen this?

-- 
Brian E. Williams

http://www.techhouse.us/wordpress-mu/brianw

"Never attribute to malice that which can be adequately
explained by stupidity." - Hanlon's Razor


More information about the erlang-questions mailing list