Fix segmentation fault when dumping the crash log with hipe enabled and natively compiled modules
Fix segmentation fault when dumping the crash log with hipe enabled and natively compiled modules

When loading a module, code area is allocated and header fields
code[MI_ATTR_SIZE] as well as code[MI_COMPILE_SIZE] are not
cleared. They are only set later when freeze_code is called, if the
module has attributes and compilation info, which should always be the
case. When loading a native module (as a stub), code is allocated as
well (to contain the stub functions), and code[MI_ATTR_SIZE] as well
as code[MI_COMPILE_SIZE] are not cleared either. Yet, freeze_code will
not be called (since there is no threaded code to freeze for native
modules), and as a result, these header fields are never set. They can
contain any garbage.

Later on, when writing a crash dump, the attributes and compilation
info are dumped, using these particular header fields. If the size is
garbage, the dump attribute function will iterate until it segfaults.

The fix consists in clearing code[MI_ATTR_SIZE] and
code[MI_COMPILE_SIZE] in both cases (threaded code and native
code). Even if non-native modules should contain code and attributes
and therefore the values code[MI_ATTR_SIZE] and code[MI_COMPILE_SIZE]
should be set by freeze_code, it seems cleaner and easier to maintain
to clear the whole the header in the "initialize code area"
section. As a result, crash dump will not segfault. Instead, native
modules will have an empty attributes and compilation info section in
the crash dump.

theom/otp,cobusc/otp,hairyhum/otp,yangchengjian/otp,lianghaivv/otp,vic/otp,matwey/otp,palas/otp,Teino1978-Corp/otp,beni55/otp,yangchengjian/otp,cnbin/otp,weisslj/otp,kvakvs/otp,vic/otp,lrascao/otp,fenollp/otp,neeraj9/otp,matwey/otp,johanclaesson/otp,mikpe/otp,vic/otp,stolen/otp,gjaldon/otp,potatosalad/otp,ahmedshafeeq/otp,isvilen/otp,electricimp/otp,RaimoNiskanen/otp,g-andrade/otp,jj1bdx/otp,RJ/otp,bernardd/otp,falkevik/otp,klarna/otp,entropiae/otp,RoadRunnr/otp,potatosalad/otp,palas/otp,mujiatong/otp,benoitc/otp-1,uabboli/otp,awetzel/otp,lianghaivv/otp,emacsmirror/erlang,fenollp/otp,schlagert/otp,benoitc/otp-1,aboroska/otp,vinoski/otp,electricimp/otp,VincentHHL/otp,g-andrade/otp,ader1990/otp,bjorng/otp,RGafiyatullin/otp,sdebnath/otp,msantos/otp,RichMorin/otp,lantti/otp,tuncer/otp,mujiatong/otp,psyeugenic/otp,NOMORECOFFEE/otp,bsmr-erlang/otp,schlagert/otp,RaimoNiskanen/otp,rlipscombe/otp,GinjaNinja32/otp,platinumthinker/otp,lrascao/otp,dumbbell/otp,bjorng/otp,paladim/otp,RGafiyatullin/otp,massemanet/otp,falkevik/otp,RoadRunnr/otp,matwey/otp,mujiatong/otp,aboroska/otp,rlipscombe/otp,VincentHHL/otp,massemanet/otp,psyeugenic/otp,gjaldon/otp,RaimoNiskanen/otp,krishnakumar4a4/otp,Teino1978-Corp/erlang-otp,ahmedshafeeq/otp,enikki/otp,sammoth-wazoku/otp,lrascao/otp,sdebnath/otp,kvakvs/otp,Teino1978-Corp/otp,sitexa/otp,vladdu/otp,isvilen/otp,jj1bdx/otp,emacsmirror/erlang,vinoski/otp,c-rack/otp,sitexa/otp,beni55/otp,kvakvs/otp,dumbbell/otp,haguenau/otp,riverrun/otp,stolen/otp,uabboli/otp,paulcager/otp,yangchengjian/otp,bugs-erlang-org/otp,vladdu/otp,potatosalad/otp,ahmedshafeeq/otp,lrascao/otp,ahmedshafeeq/otp,goertzenator/otp,getong/otp,emacsmirror/erlang,stolen/otp,Teino1978-Corp/erlang-otp,c-rack/otp,bjorng/otp,GinjaNinja32/otp,derek121/otp,erlang/otp,erlang/otp,bsmr-erlang/otp,hairyhum/otp,emile/otp,RGafiyatullin/otp,haguenau/otp,uabboli/otp,g-andrade/otp,neeraj9/otp,derek121/otp,dumbbell/otp,lantti/otp,rlipscombe/otp,jemsbhai/otp,schlagert/otp,schlagert/otp,platinumthinker/otp,lantti/otp,potatosalad/otp,palas/otp,dumbbell/otp,sdebnath/otp,awetzel/otp,mujiatong/otp,VincentHHL/otp,sammoth-wazoku/otp,hairyhum/otp,vinoski/otp,vladdu/otp,c-rack/otp,lrascao/otp,dgud/otp,krishnakumar4a4/otp,Teino1978-Corp/erlang-otp,weisslj/otp,enikki/otp,benoitc/otp-1,RoadRunnr/otp,kvakvs/otp,emacsmirror/erlang,bsmr-erlang/otp,theom/otp,lemenkov/otp,sdebnath/otp,g-andrade/otp,weisslj/otp,tuncer/otp,vladdu/otp,cobusc/otp,mujiatong/otp,dgud/otp,krishnakumar4a4/otp,saleyn/otp,lrascao/otp,fenollp/otp,sammoth-wazoku/otp,lightcyphers/otp,derek121/otp,sitexa/otp,massemanet/otp,massemanet/otp,mikpe/otp,isvilen/otp,kvakvs/otp,awetzel/otp,sammoth-wazoku/otp,stolen/otp,marquisthunder/otp,RJ/otp,isvilen/otp,getong/otp,vic/otp,lhslll/otp,paulcager/otp,lhslll/otp,basho/otp,vladdu/otp,dgud/otp,paulcager/otp,neeraj9/otp,psyeugenic/otp,yangchengjian/otp,jj1bdx/otp,RJ/otp,saleyn/otp,jinshana/otp,neeraj9/otp,lantti/otp,ferd/otp,GinjaNinja32/otp,release-project/otp,paladim/otp,lightcyphers/otp,cobusc/otp,legoscia/otp,enikki/otp,bjorng/otp,g-andrade/otp,GinjaNinja32/otp,beni55/otp,RGafiyatullin/otp,entropiae/otp,haguenau/otp,getong/otp,RichMorin/otp,erlang/otp,uabboli/otp,rlipscombe/otp,matwey/otp,dumbbell/otp,sdebnath/otp,rlipscombe/otp,potatosalad/otp,enikki/otp,platinumthinker/otp,Teino1978-Corp/erlang-otp,erlang/otp,cnbin/otp,entropiae/otp,johanclaesson/otp,release-project/otp,lhslll/otp,kvakvs/otp,Teino1978-Corp/otp,isvilen/otp,Teino1978-Corp/otp,legoscia/otp,bsmr-erlang/otp,potatosalad/otp,johanclaesson/otp,dgud/otp,jinshana/otp,benoitc/otp-1,cnbin/otp,lucafavatella/otp,dgud/otp,lucafavatella/otp,jj1bdx/otp,bernardd/otp,lucafavatella/otp,msantos/otp,aboroska/otp,RichMorin/otp,VincentHHL/otp,paulcager/otp,c-rack/otp,derek121/otp,fenollp/otp,bugs-erlang-org/otp,uabboli/otp,RJ/otp,jamesruan/otp,mikpe/otp,GinjaNinja32/otp,c-rack/otp,bjorng/otp,lhslll/otp,uabboli/otp,gjaldon/otp,awetzel/otp,sitexa/otp,tuncer/otp,aboroska/otp,mujiatong/otp,derek121/otp,c-rack/otp,bernardd/otp,tuncer/otp,aboroska/otp,lhslll/otp,paladim/otp,derek121/otp,lhslll/otp,lantti/otp,weisslj/otp,haguenau/otp,getong/otp,ahmedshafeeq/otp,bsmr-erlang/otp,kvakvs/otp,enikki/otp,weisslj/otp,paulcager/otp,neeraj9/otp,bernardd/otp,jj1bdx/otp,bernardd/otp,massemanet/otp,lianghaivv/otp,release-project/otp,kvakvs/otp,lemenkov/otp,saleyn/otp,mikpe/otp,tuncer/otp,ader1990/otp,goertzenator/otp,sammoth-wazoku/otp,dumbbell/otp,vinoski/otp,bugs-erlang-org/otp,RGafiyatullin/otp,electricimp/otp,RoadRunnr/otp,lianghaivv/otp,bjorng/otp,aboroska/otp,palas/otp,emile/otp,lucafavatella/otp,stolen/otp,bernardd/otp,RichMorin/otp,emacsmirror/erlang,legoscia/otp,cobusc/otp,lucafavatella/otp,lantti/otp,RaimoNiskanen/otp,neeraj9/otp,release-project/otp,lightcyphers/otp,basho/otp,yangchengjian/otp,johanclaesson/otp,paladim/otp,awetzel/otp,weisslj/otp,paulcager/otp,cnbin/otp,electricimp/otp,ferd/otp,electricimp/otp,falkevik/otp,legoscia/otp,RJ/otp,RoadRunnr/otp,goertzenator/otp,lianghaivv/otp,RaimoNiskanen/otp,goertzenator/otp,dgud/otp,NOMORECOFFEE/otp,basho/otp,RGafiyatullin/otp,c-rack/otp,lianghaivv/otp,lemenkov/otp,c-rack/otp,g-andrade/otp,ferd/otp,theom/otp,palas/otp,mikpe/otp,vinoski/otp,krishnakumar4a4/otp,sdebnath/otp,beni55/otp,gjaldon/otp,lemenkov/otp,platinumthinker/otp,vladdu/otp,vinoski/otp,marquisthunder/otp,RoadRunnr/otp,jinshana/otp,cobusc/otp,RichMorin/otp,g-andrade/otp,ferd/otp,dgud/otp,emacsmirror/erlang,jamesruan/otp,vic/otp,emacsmirror/erlang,gjaldon/otp,sitexa/otp,platinumthinker/otp,lrascao/otp,ader1990/otp,riverrun/otp,Teino1978-Corp/otp,awetzel/otp,riverrun/otp,isvilen/otp,vic/otp,beni55/otp,uabboli/otp,marquisthunder/otp,lightcyphers/otp,erlang/otp,saleyn/otp,ferd/otp,jemsbhai/otp,vic/otp,bsmr-erlang/otp,Teino1978-Corp/otp,jinshana/otp,mikpe/otp,VincentHHL/otp,derek121/otp,matwey/otp,weisslj/otp,jj1bdx/otp,isvilen/otp,ferd/otp,potatosalad/otp,sdebnath/otp,paulcager/otp,jj1bdx/otp,potatosalad/otp,psyeugenic/otp,fenollp/otp,marquisthunder/otp,entropiae/otp,RGafiyatullin/otp,johanclaesson/otp,uabboli/otp,yangchengjian/otp,klarna/otp,NOMORECOFFEE/otp,vladdu/otp,schlagert/otp,jamesruan/otp,klarna/otp,saleyn/otp,falkevik/otp,rlipscombe/otp,bernardd/otp,saleyn/otp,mikpe/otp,marquisthunder/otp,lianghaivv/otp,hairyhum/otp,lhslll/otp,benoitc/otp-1,enikki/otp,jinshana/otp,lantti/otp,falkevik/otp,entropiae/otp,hairyhum/otp,g-andrade/otp,electricimp/otp,release-project/otp,GinjaNinja32/otp,ahmedshafeeq/otp,schlagert/otp,gjaldon/otp,jamesruan/otp,enikki/otp,paladim/otp,yangchengjian/otp,vinoski/otp,dumbbell/otp,GinjaNinja32/otp,theom/otp,jinshana/otp,Teino1978-Corp/otp,fenollp/otp,dgud/otp,vladdu/otp,legoscia/otp,Teino1978-Corp/otp,RJ/otp,gjaldon/otp,sammoth-wazoku/otp,getong/otp,fenollp/otp,entropiae/otp,paulcager/otp,tuncer/otp,cnbin/otp,RGafiyatullin/otp,ahmedshafeeq/otp,riverrun/otp,lucafavatella/otp,erlang/otp,RoadRunnr/otp,Teino1978-Corp/erlang-otp,emacsmirror/erlang,schlagert/otp,neeraj9/otp,jemsbhai/otp,vic/otp,psyeugenic/otp,release-project/otp,stolen/otp,lrascao/otp,mikpe/otp,lemenkov/otp,NOMORECOFFEE/otp,paladim/otp,psyeugenic/otp,massemanet/otp,lucafavatella/otp,klarna/otp,vinoski/otp,riverrun/otp,saleyn/otp,emile/otp,g-andrade/otp,VincentHHL/otp,legoscia/otp,NOMORECOFFEE/otp,paladim/otp,marquisthunder/otp,klarna/otp,falkevik/otp,lemenkov/otp,goertzenator/otp,RJ/otp,fenollp/otp,matwey/otp,emile/otp,matwey/otp,massemanet/otp,mikpe/otp,matwey/otp,cobusc/otp,stolen/otp,legoscia/otp,uabboli/otp,aboroska/otp,mujiatong/otp,cnbin/otp,vladdu/otp,isvilen/otp,basho/otp,dgud/otp,RaimoNiskanen/otp,platinumthinker/otp,bernardd/otp,goertzenator/otp,emile/otp,matwey/otp,getong/otp,jemsbhai/otp,getong/otp,aboroska/otp,haguenau/otp,emile/otp,platinumthinker/otp,bjorng/otp,ader1990/otp,jemsbhai/otp,VincentHHL/otp,lantti/otp,goertzenator/otp,benoitc/otp-1,johanclaesson/otp,beni55/otp,enikki/otp,basho/otp,ferd/otp,lianghaivv/otp,entropiae/otp,ahmedshafeeq/otp,gjaldon/otp,vinoski/otp,ader1990/otp,ferd/otp,stolen/otp,jj1bdx/otp,rlipscombe/otp,riverrun/otp,saleyn/otp,lhslll/otp,haguenau/otp,GinjaNinja32/otp,RJ/otp,riverrun/otp,klarna/otp,psyeugenic/otp,Teino1978-Corp/erlang-otp,bugs-erlang-org/otp,psyeugenic/otp,emacsmirror/erlang,bjorng/otp,erlang/otp,NOMORECOFFEE/otp,bugs-erlang-org/otp,palas/otp,jemsbhai/otp,lightcyphers/otp,awetzel/otp,cnbin/otp,palas/otp,msantos/otp,isvilen/otp,rlipscombe/otp,tuncer/otp,theom/otp,haguenau/otp,ferd/otp,krishnakumar4a4/otp,RichMorin/otp,krishnakumar4a4/otp,sitexa/otp,aboroska/otp,jemsbhai/otp,lemenkov/otp,g-andrade/otp,jamesruan/otp,riverrun/otp,klarna/otp,benoitc/otp-1,basho/otp,cobusc/otp,cnbin/otp,msantos/otp,legoscia/otp,lemenkov/otp,msantos/otp,beni55/otp,lucafavatella/otp,sitexa/otp,hairyhum/otp,getong/otp,legoscia/otp,emile/otp,sammoth-wazoku/otp,rlipscombe/otp,massemanet/otp,RichMorin/otp,dumbbell/otp,ahmedshafeeq/otp,marquisthunder/otp,RoadRunnr/otp,benoitc/otp-1,msantos/otp,hairyhum/otp,bjorng/otp,basho/otp,jj1bdx/otp,ader1990/otp,jamesruan/otp,basho/otp,NOMORECOFFEE/otp,jinshana/otp,RaimoNiskanen/otp,lightcyphers/otp,tuncer/otp,theom/otp,marquisthunder/otp,falkevik/otp,Teino1978-Corp/erlang-otp,johanclaesson/otp,release-project/otp,awetzel/otp,jj1bdx/otp,dgud/otp,ader1990/otp,massemanet/otp,erlang/otp,RaimoNiskanen/otp,lightcyphers/otp,sdebnath/otp,falkevik/otp,saleyn/otp,yangchengjian/otp,VincentHHL/otp,bjorng/otp,isvilen/otp,jamesruan/otp,getong/otp,lrascao/otp,lightcyphers/otp,jemsbhai/otp,release-project/otp,cobusc/otp,klarna/otp,emile/otp,emile/otp,tuncer/otp,emacsmirror/erlang,krishnakumar4a4/otp,bsmr-erlang/otp,neeraj9/otp,ader1990/otp,fenollp/otp,platinumthinker/otp,sammoth-wazoku/otp,jamesruan/otp,msantos/otp,bsmr-erlang/otp,entropiae/otp,bernardd/otp,sitexa/otp,electricimp/otp,mikpe/otp,msantos/otp,NOMORECOFFEE/otp,getong/otp,theom/otp,weisslj/otp,bsmr-erlang/otp,bugs-erlang-org/otp,goertzenator/otp,RichMorin/otp,Teino1978-Corp/erlang-otp,jinshana/otp,potatosalad/otp,theom/otp,palas/otp,krishnakumar4a4/otp,johanclaesson/otp,dumbbell/otp,electricimp/otp,kvakvs/otp,potatosalad/otp,erlang/otp,schlagert/otp,beni55/otp,dumbbell/otp,mujiatong/otp,goertzenator/otp,electricimp/otp,weisslj/otp,haguenau/otp,rlipscombe/otp,basho/otp,derek121/otp,RaimoNiskanen/otp,bugs-erlang-org/otp,RoadRunnr/otp,falkevik/otp,erlang/otp,bugs-erlang-org/otp,hairyhum/otp,vinoski/otp,paladim/otp,release-project/otp