[erlang-bugs] [erlang-questions] Crash during compilation

Richard Carlsson <>
Wed Oct 16 11:46:07 CEST 2013


Confirmed. Seems like the function leave_file/2 in epp.erl propagates 
the macro definitions from the include file, but not the 'uses' field of 
the preprocessor state when it leaves the header file.

    /Richard

On 2013-10-16 11:05 , Anthony Ramine wrote:
> Please keep the discussion on the list, thank you.
>
> --
> Anthony Ramine
>
> Le 15 oct. 2013 à 20:40, Maruthavanan Subbarayan
> < <mailto:>> a écrit :
>
>> HI,
>>
>> Since after I removed that the same did not occur, but for sure it
>> occurred when I included that. The circular macro should be defined in
>> a header file.
>>
>> One more note it just declaring the macro would not reproduce this,
>> the declared macro should be used somewhere in the code like below.
>>
>> t.hrl
>> ==================
>> -define(MACRO,[[]++?MACRO]).
>>
>> heap_error.erl
>> ===============
>> -module(heap_error).
>> -compile(export_all).
>>
>> -include("t.hrl").
>>
>> %-define(MACRO,["test",?MACRO]).
>>
>>
>> function_name()->
>>     A=?MACRO,
>>     ok.
>>
>> > Subject: Re: [erlang-questions] Crash during compilation
>> > From:  <mailto:>
>> > Date: Tue, 15 Oct 2013 18:55:19 +0200
>> > CC:  <mailto:>
>> > To:  <mailto:>
>> >
>> > Are you sure of that?
>> >
>> > This should error out with "circular macro 'MACRO'".
>> >
>> > --
>> > Anthony Ramine
>> >
>> > Le 15 oct. 2013 à 10:40, Maruthavanan Subbarayan
>> < <mailto:>> a écrit :
>> >
>> > > Hi,
>> > >
>> > > I think I did an accidental typo that caused because of copy
>> paste. Took almost 6 hours of mine :) Learnt copy paste bad very bad
>> sometimes :)
>> > >
>> > > Just to let community know, I was trying to do something like below.
>> > >
>> > > -define(MACRO, [?MACRO]).
>> > >
>> > > Thanks,
>> > > Marutha
>> > >
>> > > > Subject: Re: [erlang-questions] Crash during compilation
>> > > > From:  <mailto:>
>> > > > Date: Tue, 15 Oct 2013 10:25:02 +0200
>> > > > CC:  <mailto:>
>> > > > To:  <mailto:>
>> > > >
>> > > > Hello,
>> > > >
>> > > > Is your module quite large and uses a lot of binary patterns?
>> > > >
>> > > > Try erlc +time.
>> > > >
>> > > > --
>> > > > Anthony Ramine
>> > > >
>> > > > Le 15 oct. 2013 à 09:27, Maruthavanan Subbarayan
>> < <mailto:>> a écrit :
>> > > >
>> > > > > Hi,
>> > > > >
>> > > > > I am receiving and crash dump during compilation of my code,
>> stating could not allocate memory and takes a lot time. I am able to
>> compile other bigger modules in same environment. I passed and "-v" to
>> put verbose of "erlc" but I could not see any output.
>> > > > >
>> > > > > Slogan: eheap_alloc: Cannot allocate 1098556536 bytes of
>> memory (of type "heap").
>> > > > > System version: Erlang R16B02 (erts-5.10.3) [source] [64-bit]
>> [async-threads:10] [hipe] [kernel-poll:false]
>> > > > >
>> > > > > I tried 'rebar" as well as "erlc" how can I get more
>> information? I am wondering what area of my code causes heap to grow
>> during compilation? Any ideas?
>> > > > >
>> > > > > One more interesting fact is, one of the modules which was not
>> changed is also facing this problem suddenly. I also tried copying the
>> folder to Erlang-R14B04, and this also had same problem now. How
>> should I proceed further?
>> > > > >
>> > > > > Thanks,
>> > > > > Marutha
>> > > > > _______________________________________________
>> > > > > erlang-questions mailing list
>> > > > >  <mailto:>
>> > > > > http://erlang.org/mailman/listinfo/erlang-questions
>> > > >
>> >
>
>
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
>



More information about the erlang-bugs mailing list