Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12748 Discussions

count_binary example -- fatal error couldn't allocate heap?

Altera_Forum
Honored Contributor II
3,545 Views

Hi, 

Did anyone see this error before when you try to build the count_binary example? I have a NEEK and try the count_binary. I'm using the ptf from the NEEK example. Thx 

 

**** Build of configuration Debug for project count_binary_0 **** 

make -s all includes  

3 [main] ? (12828) c:\altera\91\quartus\bin\cygwin\bin\make.exe: *** fatal error - couldn't allocate heap, Win32 error 487, base 0x9B0000, top 0xB10000, reserve_size 1437696, allocsize 1441792, page_const 4096 

2 [main] make 11608 fork: child -1 - died waiting for longjmp before initialization, retry 0, exit code 0x100, errno 11 

make[1]: vfork: Resource temporarily unavailable 

make: *** [system_project] Error 2 

Build completed in 29.728 seconds
0 Kudos
11 Replies
Altera_Forum
Honored Contributor II
2,229 Views

I have uninstall the EDS 9.1 and re-install it. I still get the same error 

 

 

**** Build of configuration Debug for project hello_world_0 **** 

make -s all includes  

3 [main] ? (4820) c:\altera\91\quartus\bin\cygwin\bin\sh.exe: *** fatal error - couldn't allocate heap, Win32 error 487, base 0xA00000, top 0xA10000, reserve_size 61440, allocsize 65536, page_const 4096 

2 [main] sh 3152 fork: child -1 - died waiting for longjmp before initialization, retry 0, exit code 0x100, errno 11 

/bin/sh: fork: Resource temporarily unavailable 

3 [main] ? (4268) c:\altera\91\quartus\bin\cygwin\bin\make.exe: *** fatal error - couldn't allocate heap, Win32 error 487, base 0x9B0000, top 0xAC0000, reserve_size 1110016, allocsize 1114112, page_const 4096 

2 [main] make 1168 fork: child -1 - died waiting for longjmp before initialization, retry 0, exit code 0x100, errno 11 

make[1]: /cygdrive/c/altera/91/nios2eds/components/altera_hal/build/chac_rules.mk:147: fork: Resource temporarily unavailable 

3 [main] ? (2680) c:\altera\91\quartus\bin\cygwin\bin\make.exe: *** fatal error - couldn't allocate heap, Win32 error 487, base 0x9B0000, top 0xB10000, reserve_size 1437696, allocsize 1441792, page_const 4096 

5600080 [main] make 1168 fork: child -1 - died waiting for longjmp before initialization, retry 0, exit code 0x100, errno 11 

make[1]: vfork: Resource temporarily unavailable 

make: *** [system_project] Error 2 

Build completed in 34.529 seconds
0 Kudos
Altera_Forum
Honored Contributor II
2,229 Views

When I use another computer, everything is fine.

0 Kudos
Altera_Forum
Honored Contributor II
2,229 Views

looks like you were out of memory or other resource on the computer you were using.

0 Kudos
Altera_Forum
Honored Contributor II
2,229 Views

Looks like the infamous Logitech conflict with Cygwin. If you're using a Logitech Quickcam or similar driver....don't. It has issues with Cygwin, or Cygwin has issues with it. 

 

- slacker
0 Kudos
Altera_Forum
Honored Contributor II
2,229 Views

There have been reports of intermittent cygwin issues with anti-malware software, such as Windows Defender, and older versions of McAfee. If one of the differences between your two machines is with this software, then your solution might be to upgrade the anti-malware software. 

 

There were problems in earlier versions of the Nios II software when running on Vista 32, but I haven't seen these with Nios II 9.1. Which OS are you using? 

 

There has also been a report of getting this problem when the path to the source is 'long'. In that case, shortening the path to the source made the problem go away. 

 

I also notice that there is chac_rules.mk in your error message. This implies you are using C2H. Are you trying to hardware accelerate something in count_binary? Does it work if you don't do that? Sometimes, when you use C2H in a project and decide you don't want it, you may have a hard time getting rid of C2H in the project. If this is the case, try creating a count_binary project again without C2H and see how that goes. 

-edj
0 Kudos
Altera_Forum
Honored Contributor II
2,229 Views

Mmm... I'm using Vista 32. 

NIOSII IDE 9.1 

I have 18G free space in my C drive, so I guess it's not the disk full problem. 

It's true that I have McAfee in my computer. 

It's the sample code from Altera, I don't think there is C2H.
0 Kudos
Altera_Forum
Honored Contributor II
2,229 Views

Based on your reply. Here are some questions: 

1) Is the other computer where it works a Vista 32 machine? 

2) Are you using the old IDE? Are you able to use the new Software Build Tools for Eclipse? 

 

Suggestions: 

1) If you really are using Nios II IDE, try the Software Build Tools for Eclipse instead. 

2) Quit the GUI, remove the workspace, and re-create the count_binary project. 

3) Try hello_world to see if it works. 

4) If you are comfortable with the idea, try temporarily disabling your McAfee. The account I have says that McAfee version ~8.0 was present when the problem happened. The solution was to upgrade to McAfee version ~8.5. This report was a while ago, so I suspect you are long past version 8.0 by now. 

-edj
0 Kudos
Altera_Forum
Honored Contributor II
2,229 Views

Mmm... 

I have deleted the McAfee, but I still got the same error. 

Another computer has Vista 32 running on MAC, it's fine. 

My IDE is 9.1 

I have un-installed and re-install the IDE. Create a new workspace and stuff. 

Hello_world has the same error.
0 Kudos
Altera_Forum
Honored Contributor II
2,229 Views

The only thing I can tell you for certain is that the problem is something with Cygwin. ACDS uses, of course, a lot of cygwin-based tools, like sh.exe and make.exe and that is the source of the errors. 

 

Try launching the SBTGUI like this: 

a) Load your hardware design in Quartus II 

b) From Quartus II, launch SOPC Builder 

c) From SOPC Builder, launch the Nios II Software Build Tools GUI 

d) Try creating/building helloworld from there 

 

If that still doesn't work, here are some other more drastic things to try. 

0) Quit all ACDS tools. 

1) Make sure you don't have another install of cygwin on your computer that may be getting mixed up with the one Altera ships with ACDS. 

2) Go into regedit and remove the HKEY_CURRENT_USER\Software\Cygnus Solutions key name, if there is one. 

3) Look in your PATH environment variable and verify that there is no path entry with cygwin in it. If you see one, remove it. 

4) Try the ACDS tools again. 

 

Altera ships two GUI environments in 9.1. Are you using the one called "Nios II Software Build Tools for eclipse"? or the one called "Nios II IDE"? The former is the one you should be using for all new projects. We refer to the older one as "The IDE". The newer one is sometimes shortened "SBT GUI" (for Software Build Tools GUI). 

-edj
0 Kudos
Altera_Forum
Honored Contributor II
2,229 Views

Try the recommendation given at the following link: 

 

http://www.cygwin.com/cygwin-ug-net/setup-maxmem.html 

 

In particular, try compiling and running the application given at the end of the recommendation. Here are the results that I see on my WinXP-64 machine with 8GB of RAM...compiled and ran from within a Nios II Command Shell. 

$ cat ./max_mem.c main() { unsigned int bit=0x40000000, sum=0; char *x; while (bit > 4096) { x = malloc(bit); if (x) sum += bit; bit >>= 1; } printf("%08x bytes (%.1fMb)\n", sum, sum/1024.0/1024.0); return 0; } /cygdrive/c/Downloads $ gcc max_mem.c -o max_mem.exe /cygdrive/c/Downloads $ ./max_mem.exe 5fffe000 bytes (1536.0Mb)Also, if you have a Logitech Quickcam, disable the driver for it and see if that makes a difference. My impression is that this is a Cygwin/Logitech issue, not an Altera/IDE/EDS issue. 

 

Cheers, 

 

- slacker
0 Kudos
Altera_Forum
Honored Contributor II
2,229 Views

Thanks, edj. I solved the same problem using your method. 

 

Regards, 

feng
0 Kudos
Reply