Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Understanding the output of electric fence and gdb

When debugging a program that terminates with a segfault, electric fence, in conjunction with gdb, returns this:

"ElectricFence Exiting: mprotect() failed: Cannot allocate memory [Thread 0xb0bd4b70 (LWP 5363) exited] Program exited with code 0377.

I actually thought electric fence would be more helpful. What does this mean? How can I interpret this piece of information? There doesn't seem to be any stack left that I can look at, or at least bt won't return anything.

Any suggestion would be really appreciated.

Thanks!

like image 919
Ricky Robinson Avatar asked Nov 15 '10 21:11

Ricky Robinson


1 Answers

You have probably run out of memory map areas. The default is known to be low when using debug allocators. This can be adjusted at runtime via

echo 128000 > /proc/sys/vm/max_map_count

or by adding this line to /etc/sysctl.conf and rebooting:

vm.max_map_count = 128000

The max_map_count number defaults to 65530 and can be increased as high as MAX_INT if necessary.

For more information see:

  • max_map_count
  • Side effects when increasing vm.max_map_count
like image 180
Curtis P Avatar answered Oct 07 '22 18:10

Curtis P