Problems cross compiling: eheap_alloc: Cannot reallocate 3480006320 bytes of memory

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Problems cross compiling: eheap_alloc: Cannot reallocate 3480006320 bytes of memory

Winston Smith-6
Trying to run a cross compiled version of R13B03 on an AVR32-Linux
system (NGW100/buildroot-2.3.0) I get the following:

/home/avr32 # erl

Crash dump was written to: erl_crash.dump
eheap_alloc: Cannot reallocate 3480006320 bytes of memory (of type "heap").
Aborted


I've had this working before (I think with R13B01) but I've since
upgraded my build host from Ubuntu 9.04 to 9.10.  I actually had this
same issue originally, and I somehow solved it, but I can't for the
life of me remember what I did.  I am setting up an xconf file with
the proper values for size_t, off_t, big endian etc; in fact I based
my build script on Brian Zhou's script for building Erlang on NSLU2
Linux:

http://svn.nslu2-linux.org/svnroot/optware/trunk/make/erlang.mk

Any thoughts on where to start debugging/diagnosing this?  (the
embedded gdb doesn't work)  Is the erl_crash.dump useful (and how do I
interpret it!)?

Many thanks in advance!

________________________________________________________________
erlang-questions mailing list. See http://www.erlang.org/faq.html
erlang-questions (at) erlang.org

Reply | Threaded
Open this post in threaded view
|

Re: Problems cross compiling: eheap_alloc: Cannot reallocate 3480006320 bytes of memory

Rickard Green-2
Current cross compiling support has lots of issues. I'd recommend that
you wait for the R13B04 release if you want to cross compile
Erlang/OTP.

The upcoming R13B04 release will have much better support for cross
compiling. I've just committed a bunch of cross fixes in the r13b04
development branch which are available at
<http://github.com/erlang/otp> (ccase/r13b04_dev branch). If you want
to try it out, have a look at the xcomp/README
<http://github.com/erlang/otp/blob/ccase/r13b04_dev/xcomp/README>
since lots of things have changed regarding cross compiling since
R13B03.

If you get it working with r13b04_dev, the configure results from
r13b04_dev may give you a hint about what is wrong with the R13B03
configuration. However, I'd still recommend that you wait for the
R13B04 release.

Regards,
Rickard Green, Erlang/OTP, Ericsson AB.

2010/1/29 Winston Smith <[hidden email]>:

> Trying to run a cross compiled version of R13B03 on an AVR32-Linux
> system (NGW100/buildroot-2.3.0) I get the following:
>
> /home/avr32 # erl
>
> Crash dump was written to: erl_crash.dump
> eheap_alloc: Cannot reallocate 3480006320 bytes of memory (of type "heap").
> Aborted
>
>
> I've had this working before (I think with R13B01) but I've since
> upgraded my build host from Ubuntu 9.04 to 9.10.  I actually had this
> same issue originally, and I somehow solved it, but I can't for the
> life of me remember what I did.  I am setting up an xconf file with
> the proper values for size_t, off_t, big endian etc; in fact I based
> my build script on Brian Zhou's script for building Erlang on NSLU2
> Linux:
>
> http://svn.nslu2-linux.org/svnroot/optware/trunk/make/erlang.mk
>
> Any thoughts on where to start debugging/diagnosing this?  (the
> embedded gdb doesn't work)  Is the erl_crash.dump useful (and how do I
> interpret it!)?
>
> Many thanks in advance!
>
> ________________________________________________________________
> erlang-questions mailing list. See http://www.erlang.org/faq.html
> erlang-questions (at) erlang.org
>
>

________________________________________________________________
erlang-questions (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:[hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Problems cross compiling: eheap_alloc: Cannot reallocate 3480006320 bytes of memory

Winston Smith-6
This is *exactly* what I did, and with what's in r13b04_dev I got it
working on the avr32-linux platform (NGW100) pretty easily.  I'm just
in the process of preparing a patch that includes a xcomp/.conf file
for avr32-linux for submission to erlang-patches.

The new system works really well, the only thing I had to do was set
the environment variable ac_cv_sizeof_off_t to 4 as configure can't
figure it out and picks 8 (incorrectly).

I noticed in the xcomp/README that you suggest updating otp_build to
include new settings such as this, so I'm adding new settings for
ac_cv_sizeof_off_t and also ac_cv_sizeof_size_t so they can more
easily be customized in the .conf file.

Many thanks and a great job on significantly improving the cross
compilation support for Erlang!


Winston.

On Wed, Feb 3, 2010 at 9:27 PM, Rickard Green <[hidden email]> wrote:

> Current cross compiling support has lots of issues. I'd recommend that
> you wait for the R13B04 release if you want to cross compile
> Erlang/OTP.
>
> The upcoming R13B04 release will have much better support for cross
> compiling. I've just committed a bunch of cross fixes in the r13b04
> development branch which are available at
> <http://github.com/erlang/otp> (ccase/r13b04_dev branch). If you want
> to try it out, have a look at the xcomp/README
> <http://github.com/erlang/otp/blob/ccase/r13b04_dev/xcomp/README>
> since lots of things have changed regarding cross compiling since
> R13B03.
>
> If you get it working with r13b04_dev, the configure results from
> r13b04_dev may give you a hint about what is wrong with the R13B03
> configuration. However, I'd still recommend that you wait for the
> R13B04 release.
>
> Regards,
> Rickard Green, Erlang/OTP, Ericsson AB.
>
> 2010/1/29 Winston Smith <[hidden email]>:
>> Trying to run a cross compiled version of R13B03 on an AVR32-Linux
>> system (NGW100/buildroot-2.3.0) I get the following:
>>
>> /home/avr32 # erl
>>
>> Crash dump was written to: erl_crash.dump
>> eheap_alloc: Cannot reallocate 3480006320 bytes of memory (of type "heap").
>> Aborted
>>
>>
>> I've had this working before (I think with R13B01) but I've since
>> upgraded my build host from Ubuntu 9.04 to 9.10.  I actually had this
>> same issue originally, and I somehow solved it, but I can't for the
>> life of me remember what I did.  I am setting up an xconf file with
>> the proper values for size_t, off_t, big endian etc; in fact I based
>> my build script on Brian Zhou's script for building Erlang on NSLU2
>> Linux:
>>
>> http://svn.nslu2-linux.org/svnroot/optware/trunk/make/erlang.mk
>>
>> Any thoughts on where to start debugging/diagnosing this?  (the
>> embedded gdb doesn't work)  Is the erl_crash.dump useful (and how do I
>> interpret it!)?
>>
>> Many thanks in advance!
>>
>> ________________________________________________________________
>> erlang-questions mailing list. See http://www.erlang.org/faq.html
>> erlang-questions (at) erlang.org
>>
>>
>
> ________________________________________________________________
> erlang-questions (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:[hidden email]
>
>

________________________________________________________________
erlang-questions (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:[hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Problems cross compiling: eheap_alloc: Cannot reallocate 3480006320 bytes of memory

Rickard Green-2
I found a bug that can cause `configure' to detect wrong size of `off_t'
when cross compiling. I'll fix it and inform you when the fix has
appeared in r13b04_dev (probably monday next week).

I'm not to fond of adding ac_cv_sizeof_* to the xcomp-conf files.
`configure' should be able to figure these things out. If `configure'
doesn't, it is a bug that should be fixed (and you can always pass the
value on the command line, or in the environment as a workaround until
the bug has been fixed).

Regards,
Rickard

Winston Smith wrote:

> This is *exactly* what I did, and with what's in r13b04_dev I got it
> working on the avr32-linux platform (NGW100) pretty easily.  I'm just
> in the process of preparing a patch that includes a xcomp/.conf file
> for avr32-linux for submission to erlang-patches.
>
> The new system works really well, the only thing I had to do was set
> the environment variable ac_cv_sizeof_off_t to 4 as configure can't
> figure it out and picks 8 (incorrectly).
>
> I noticed in the xcomp/README that you suggest updating otp_build to
> include new settings such as this, so I'm adding new settings for
> ac_cv_sizeof_off_t and also ac_cv_sizeof_size_t so they can more
> easily be customized in the .conf file.
>
> Many thanks and a great job on significantly improving the cross
> compilation support for Erlang!
>
>
> Winston.
>
> On Wed, Feb 3, 2010 at 9:27 PM, Rickard Green <[hidden email]> wrote:
>> Current cross compiling support has lots of issues. I'd recommend that
>> you wait for the R13B04 release if you want to cross compile
>> Erlang/OTP.
>>
>> The upcoming R13B04 release will have much better support for cross
>> compiling. I've just committed a bunch of cross fixes in the r13b04
>> development branch which are available at
>> <http://github.com/erlang/otp> (ccase/r13b04_dev branch). If you want
>> to try it out, have a look at the xcomp/README
>> <http://github.com/erlang/otp/blob/ccase/r13b04_dev/xcomp/README>
>> since lots of things have changed regarding cross compiling since
>> R13B03.
>>
>> If you get it working with r13b04_dev, the configure results from
>> r13b04_dev may give you a hint about what is wrong with the R13B03
>> configuration. However, I'd still recommend that you wait for the
>> R13B04 release.
>>
>> Regards,
>> Rickard Green, Erlang/OTP, Ericsson AB.
>>
>> 2010/1/29 Winston Smith <[hidden email]>:
>>> Trying to run a cross compiled version of R13B03 on an AVR32-Linux
>>> system (NGW100/buildroot-2.3.0) I get the following:
>>>
>>> /home/avr32 # erl
>>>
>>> Crash dump was written to: erl_crash.dump
>>> eheap_alloc: Cannot reallocate 3480006320 bytes of memory (of type "heap").
>>> Aborted
>>>
>>>
>>> I've had this working before (I think with R13B01) but I've since
>>> upgraded my build host from Ubuntu 9.04 to 9.10.  I actually had this
>>> same issue originally, and I somehow solved it, but I can't for the
>>> life of me remember what I did.  I am setting up an xconf file with
>>> the proper values for size_t, off_t, big endian etc; in fact I based
>>> my build script on Brian Zhou's script for building Erlang on NSLU2
>>> Linux:
>>>
>>> http://svn.nslu2-linux.org/svnroot/optware/trunk/make/erlang.mk
>>>
>>> Any thoughts on where to start debugging/diagnosing this?  (the
>>> embedded gdb doesn't work)  Is the erl_crash.dump useful (and how do I
>>> interpret it!)?
>>>
>>> Many thanks in advance!
>>>
>>> ________________________________________________________________
>>> erlang-questions mailing list. See http://www.erlang.org/faq.html
>>> erlang-questions (at) erlang.org
>>>
>>>
>> ________________________________________________________________
>> erlang-questions (at) erlang.org mailing list.
>> See http://www.erlang.org/faq.html
>> To unsubscribe; mailto:[hidden email]
>>
>>
>


--
Rickard Green, Erlang/OTP, Ericsson AB.

________________________________________________________________
erlang-questions (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:[hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Problems cross compiling: eheap_alloc: Cannot reallocate 3480006320 bytes of memory

Rickard Green-2
The fix is now available in the ccase/r13b04_dev branch at github. If
the fix doesn't solve your problem, please send me the
$ERL_TOP/erts/config.log file and the complete printout (stdout) from
your configure run.

Some changes has been made in xcomp/README, so it might be worth having
a look at the diff. The bug was that configure checked for large file
support using `getconf' for the build machine. This can cause 8 byte
off_t for the target machine when 4 byte off_t should be used. The fix
tries to figure out how to enable large file support using a `getconf'
for the target machine (or by user input). That is, if you get an 8 byte
off_t it isn't necessarily wrong. It then probably succeeded in figuring
out how to enable large file support.

Regards,
Rickard

Rickard Green wrote:

> I found a bug that can cause `configure' to detect wrong size of `off_t'
> when cross compiling. I'll fix it and inform you when the fix has
> appeared in r13b04_dev (probably monday next week).
>
> I'm not to fond of adding ac_cv_sizeof_* to the xcomp-conf files.
> `configure' should be able to figure these things out. If `configure'
> doesn't, it is a bug that should be fixed (and you can always pass the
> value on the command line, or in the environment as a workaround until
> the bug has been fixed).
>
> Regards,
> Rickard
>
> Winston Smith wrote:
>> This is *exactly* what I did, and with what's in r13b04_dev I got it
>> working on the avr32-linux platform (NGW100) pretty easily.  I'm just
>> in the process of preparing a patch that includes a xcomp/.conf file
>> for avr32-linux for submission to erlang-patches.
>>
>> The new system works really well, the only thing I had to do was set
>> the environment variable ac_cv_sizeof_off_t to 4 as configure can't
>> figure it out and picks 8 (incorrectly).
>>
>> I noticed in the xcomp/README that you suggest updating otp_build to
>> include new settings such as this, so I'm adding new settings for
>> ac_cv_sizeof_off_t and also ac_cv_sizeof_size_t so they can more
>> easily be customized in the .conf file.
>>
>> Many thanks and a great job on significantly improving the cross
>> compilation support for Erlang!
>>
>>
>> Winston.
>>
>> On Wed, Feb 3, 2010 at 9:27 PM, Rickard Green <[hidden email]> wrote:
>>> Current cross compiling support has lots of issues. I'd recommend that
>>> you wait for the R13B04 release if you want to cross compile
>>> Erlang/OTP.
>>>
>>> The upcoming R13B04 release will have much better support for cross
>>> compiling. I've just committed a bunch of cross fixes in the r13b04
>>> development branch which are available at
>>> <http://github.com/erlang/otp> (ccase/r13b04_dev branch). If you want
>>> to try it out, have a look at the xcomp/README
>>> <http://github.com/erlang/otp/blob/ccase/r13b04_dev/xcomp/README>
>>> since lots of things have changed regarding cross compiling since
>>> R13B03.
>>>
>>> If you get it working with r13b04_dev, the configure results from
>>> r13b04_dev may give you a hint about what is wrong with the R13B03
>>> configuration. However, I'd still recommend that you wait for the
>>> R13B04 release.
>>>
>>> Regards,
>>> Rickard Green, Erlang/OTP, Ericsson AB.
>>>
>>> 2010/1/29 Winston Smith <[hidden email]>:
>>>> Trying to run a cross compiled version of R13B03 on an AVR32-Linux
>>>> system (NGW100/buildroot-2.3.0) I get the following:
>>>>
>>>> /home/avr32 # erl
>>>>
>>>> Crash dump was written to: erl_crash.dump
>>>> eheap_alloc: Cannot reallocate 3480006320 bytes of memory (of type
>>>> "heap").
>>>> Aborted
>>>>
>>>>
>>>> I've had this working before (I think with R13B01) but I've since
>>>> upgraded my build host from Ubuntu 9.04 to 9.10.  I actually had this
>>>> same issue originally, and I somehow solved it, but I can't for the
>>>> life of me remember what I did.  I am setting up an xconf file with
>>>> the proper values for size_t, off_t, big endian etc; in fact I based
>>>> my build script on Brian Zhou's script for building Erlang on NSLU2
>>>> Linux:
>>>>
>>>> http://svn.nslu2-linux.org/svnroot/optware/trunk/make/erlang.mk
>>>>
>>>> Any thoughts on where to start debugging/diagnosing this?  (the
>>>> embedded gdb doesn't work)  Is the erl_crash.dump useful (and how do I
>>>> interpret it!)?
>>>>
>>>> Many thanks in advance!
>>>>
>>>> ________________________________________________________________
>>>> erlang-questions mailing list. See http://www.erlang.org/faq.html
>>>> erlang-questions (at) erlang.org
>>>>
>>>>
>>> ________________________________________________________________
>>> erlang-questions (at) erlang.org mailing list.
>>> See http://www.erlang.org/faq.html
>>> To unsubscribe; mailto:[hidden email]
>>>
>>>
>>
>
>

--
Rickard Green, Erlang/OTP, Ericsson AB.

________________________________________________________________
erlang-questions (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:[hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Problems cross compiling: eheap_alloc: Cannot reallocate 3480006320 bytes of memory

Winston Smith-6
On Mon, Feb 8, 2010 at 9:55 AM, Rickard Green <[hidden email]> wrote:
> The fix is now available in the ccase/r13b04_dev branch at github. If the
> fix doesn't solve your problem, please send me the $ERL_TOP/erts/config.log
> file and the complete printout (stdout) from your configure run.

It works well now, thank you.  I did see an error about missing
headers (sorry, I don't have the exact message), but that could've
been because I have done previous builds with the old mechanism.  It
did seem to go away after I ran:

    ./otp_build autoconf --xcomp-conf=<my_xcomp_file>

I don't know if this fixed it or not; it's no longer mentioned in the
xcomp/README.  Is there an easy way to reset my git working directory
to remove any previous autoconf/configure junk (aside from doing a
clean clone of the repo)?

> Some changes has been made in xcomp/README, so it might be worth having a
> look at the diff.

I updated my .conf file based on the updated examples you have there,
it looks much more straightforward now.

I did notice a couple of things in the xcomp/README.  Firstly, you now
describe the two ways of building, using configure or using otp_build
-- it wasn't immediately obvious what the differences and why I'd use
one vs the other until I'd read in more detail.  Secondly, you have a
typo on line 225; you say the command line for otp_build configure has
--with-xcomp-conf= when it's really just --xcomp-conf=.  Also, the
script doesn't seem to expand a ~ in the filename, not a big deal
though.

> The bug was that configure checked for large file support
> using `getconf' for the build machine. This can cause 8 byte off_t for the
> target machine when 4 byte off_t should be used. The fix tries to figure out
> how to enable large file support using a `getconf' for the target machine
> (or by user input). That is, if you get an 8 byte off_t it isn't necessarily
> wrong. It then probably succeeded in figuring out how to enable large file
> support.

This is fixed (at least for avr32-linux), it correctly detected the
size of off_t as 4.

Many thanks!

________________________________________________________________
erlang-questions (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:[hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Problems cross compiling: eheap_alloc: Cannot reallocate 3480006320 bytes of memory

Rickard Green-2
Winston Smith wrote:
> On Mon, Feb 8, 2010 at 9:55 AM, Rickard Green <[hidden email]> wrote:
>> The fix is now available in the ccase/r13b04_dev branch at github. If the
>> fix doesn't solve your problem, please send me the $ERL_TOP/erts/config.log
>> file and the complete printout (stdout) from your configure run.
>
> It works well now, thank you.

Great!

>  I did see an error about missing
> headers (sorry, I don't have the exact message), but that could've
> been because I have done previous builds with the old mechanism.  It
> did seem to go away after I ran:
>
>     ./otp_build autoconf --xcomp-conf=<my_xcomp_file>
>
> I don't know if this fixed it or not; it's no longer mentioned in the
> xcomp/README.

I'm a bit surprised by the missing header message, but since it went
away after running `./otp_build autoconf' it was probably due to a
misconfiguration. If it should appear again please send us info about that.

`./otp_build autoconf' (no need for --xcomp-conf here) regenerates all
configure scripts and is needed in git when a configure.in or aclocal.m4
have changed. `./otp_build autoconf' is not mentioned since it is not
needed in the source tar released. However, we probably should mention
it since there are a lot of people building in git.

>  Is there an easy way to reset my git working directory
> to remove any previous autoconf/configure junk (aside from doing a
> clean clone of the repo)?
>

`git clean -dfx' should clean up the whole source tree. Note that I
haven't used it myself (I'm still mostly working in clearcase), so
please read the man page before using it.

>> Some changes has been made in xcomp/README, so it might be worth having a
>> look at the diff.
>
> I updated my .conf file based on the updated examples you have there,
> it looks much more straightforward now.
>
> I did notice a couple of things in the xcomp/README.  Firstly, you now
> describe the two ways of building, using configure or using otp_build
> -- it wasn't immediately obvious what the differences and why I'd use
> one vs the other until I'd read in more detail.   Secondly, you have a
> typo on line 225; you say the command line for otp_build configure has
> --with-xcomp-conf= when it's really just --xcomp-conf=.  Also, the
> script doesn't seem to expand a ~ in the filename, not a big deal
> though.

Thanks, I'll fix the typo, the tilde expansion, and clarify the
difference between otp_build and configure/make a bit.

>
>> The bug was that configure checked for large file support
>> using `getconf' for the build machine. This can cause 8 byte off_t for the
>> target machine when 4 byte off_t should be used. The fix tries to figure out
>> how to enable large file support using a `getconf' for the target machine
>> (or by user input). That is, if you get an 8 byte off_t it isn't necessarily
>> wrong. It then probably succeeded in figuring out how to enable large file
>> support.
>
> This is fixed (at least for avr32-linux), it correctly detected the
> size of off_t as 4.

Great!

>
> Many thanks!
>

Regards,
Rickard
--
Rickard Green, Erlang/OTP, Ericsson AB.

________________________________________________________________
erlang-questions (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:[hidden email]