Crashing: gmetad of Ganglia crashing because of Buffer Overflow - flume

I use Ganglia to monitor Hadoop Flume Agents' performance. For almost 1 year now, it had been working very well. Last week gmetad started crashing with buffer overflow. Only thing that has changed in last few days is we started monitoring more instances of flume agent.
> gmond -V
gmond 3.7.2
> gmetad -V
gmetad 3.7.2
Below is the output I get when I run gmetad at command prompt with debug=100.
Please suggest how to overcome the buffer overflow problem.
Writing Summary data for source atl-ganglia, metric flume.SINK.hdfsSink.StartTime
Writing Summary data for source atl-ganglia, metric flume.CHANNEL.fileChannel.ChannelFillPercentage
*** buffer overflow detected ***: /usr/sbin/gmetad terminated
======= Backtrace: =========
/lib64/libc.so.6(__fortify_fail+0x37)[0x7f9899751597]
/lib64/libc.so.6(+0x100480)[0x7f989974f480]
/lib64/libc.so.6(+0xff8d9)[0x7f989974e8d9]
/lib64/libc.so.6(_IO_default_xsputn+0xc9)[0x7f98996c3639]
/lib64/libc.so.6(_IO_vfprintf+0x41c0)[0x7f9899697190]
/lib64/libc.so.6(__vsprintf_chk+0x9d)[0x7f989974e97d]
/lib64/libc.so.6(__sprintf_chk+0x7f)[0x7f989974e8bf]
/usr/sbin/gmetad[0x40a714]
/usr/sbin/gmetad[0x40841f]
/usr/lib64/libganglia.so.0(hash_foreach+0x59)[0x7f989af731f9]
/usr/sbin/gmetad[0x408151]
/lib64/libexpat.so.1(+0xa836)[0x7f9899e16836]
/lib64/libexpat.so.1(+0xbbce)[0x7f9899e17bce]
/lib64/libexpat.so.1(+0xd4fa)[0x7f9899e194fa]
/lib64/libexpat.so.1(+0xde3b)[0x7f9899e19e3b]
/lib64/libexpat.so.1(XML_ParseBuffer+0x6d)[0x7f9899e1288d]
/usr/sbin/gmetad[0x409ddc]
/usr/sbin/gmetad[0x405116]
/lib64/libpthread.so.0(+0x7a51)[0x7f98999eaa51]
/lib64/libc.so.6(clone+0x6d)[0x7f989973796d]
======= Memory map: ========
00400000-00417000 r-xp 00000000 08:02 1077406 /usr/sbin/gmetad
00617000-00619000 rw-p 00017000 08:02 1077406 /usr/sbin/gmetad
00619000-0061a000 rw-p 00000000 00:00 0
0157e000-0159f000 rw-p 00000000 00:00 0 [heap]
7f988c000000-7f988c116000 rw-p 00000000 00:00 0
7f988c116000-7f9890000000 ---p 00000000 00:00 0
7f9890f0f000-7f9890f25000 r-xp 00000000 08:02 1569794 /lib64/libgcc_s-4.4.7-20120601.so.1
7f9890f25000-7f9891124000 ---p 00016000 08:02 1569794 /lib64/libgcc_s-4.4.7-20120601.so.1
.
.
.
7f989817f000-7f989837e000 ---p 00003000 08:02 1569886 /lib64/libgmodule-2.0.so.0.2800.8
7f989837e000-7f989837f000 rw-p 00002000 08:02 1569886 /lib64/libgmodule-2.0.so.0.2800.8/bin/bash: line 1: 19584 Aborted /usr/sbin/gmetad
[FAILED]

Looks like the format of performance numbers sent in XML formatted string by Flume to Ganglia is different when the Flume agent run on Linux vs Windows.
From Linux based Flume agent, the numbers are formatted as Float, whereas from Windows, the float comes further formatted in scientific notation.
This is from CentOs based Flume agent:
<METRIC NAME="flume.CHANNEL.memoryChannel.ChannelFillPercentage" VAL=**"0.018000000000000002"** TYPE="float" UNITS="" TN="39" TMAX="60" DMAX="0" SLOPE="both">
This is from Windows based Flume agent:
<METRIC NAME="flume.CHANNEL.fileChannel.ChannelFillPercentage" VAL=**"1.7976931348623157E308"** TYPE="float" UNITS="" TN="0" TMAX="60" DMAX="0" SLOPE="both">
Seems that the Ganglia daemon gmetad parses the XML string but does try to convert the string to number before storing in rrds. That when the buffer overflow occurs.
I stopped sending data from Windows based flume agents and now Ganglia monitoring is stable. Now need to find how to monitor windows based agents.

Related

postgresql segmentation fault during db creation rails [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 3 days ago.
Improve this question
`
Blockquote
``
'7fd50d583000-7fd50d67c000 r--p 002bd000 103:03 11700471 /home/sofiia/.rvm/rubies/ruby-2.7.2/lib/libruby.so.2.7.27fd50d67c000-7fd50d682000 r--p 003b5000 103:03 11700471 /home/sofiia/.rvm/rubies/ruby-2.7.2/lib/libruby.so.2.7.27fd50d682000-7fd50d685000 rw-p 003bb000 103:03 11700471 /home/sofiia/.rvm/rubies/ruby-2.7.2/lib/libruby.so.2.7.27fd50d685000-7fd50d6a2000 rw-p 00000000 00:00 07fd50d6a2000-7fd50d6a4000 r--p 00000000 103:03 25040902 /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.27fd50d6a4000-7fd50d6ce000 r-xp 00002000 103:03 25040902 /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.27fd50d6ce000-7fd50d6d9000 r--p 0002c000 103:03 25040902 /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.27fd50d6d9000-7fd50d6da000 r-xp 00000000 00:00 07fd50d6da000-7fd50d6dc000 r--p 00037000 103:03 25040902 /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.27fd50d6dc000-7fd50d6de000 rw-p 00039000 103:03 25040902 /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.27ffcb3fcd000-7ffcb47cc000 rw-p 00000000 00:00 0 [stack]7ffcb47cf000-7ffcb47d3000 r--p 00000000 00:00 0 [vvar]7ffcb47d3000-7ffcb47d5000 r-xp 00000000 00:00 0 [vdso]ffffffffff600000-ffffffffff601000 --xp 00000000 00:00 0 [vsyscall]
Aborted (core dumped)
i have it answer when write create db
'

Satellite Tracker on ESP8266 issue

I've been trying to make the satellite tracker from the link below but when I run my code, I constantly get an error on the serial monitor.
https://github.com/CactusProjects/SatelliteTracker
I've tried to run the code on a Wemos D1 mini and NodeMCU V1.0 12-F, code uploaded with Arduino EDI 1.8.15
I've got all the libraries and the code compiles normally and uploads normally.
When running I get the following error in the serial monitor
Entering Setup
Entering Setup
No LSM303 (compass) detected.
Assuming Elevation is set to 20°
No Compass Present, Heading set to 0°
Compass Heading: 0.00°
Attempting to connect to WiFi
WiFi Connecting. . . 0
WiFi Connecting. . . 1
WiFi Connecting. . . 2
WiFi Connecting. . . 3
WiFi Connecting. . . 4
WiFi Connecting. . . 5
WiFi Connecting. . . 6
WiFi Connecting. . . 7
WiFi connected, IP address: 192.168.0.159
Today: 4
timeNow (unix timestamp): 1621490563
HTTP Request #0 is for ISS
Requesting URL: http://www.celestrak.com/satcat/tle.php?CATNR=25544
[HTTP] GET... code: 200
Recieved HTTP Payload for: ISS (ZARYA)
1 25544U 98067A 21140.04032925 .00001407 00000-0 33666-4 0 9993
2 25544 51.6437 121.9403 0003181 20.5176 89.9422 15.49024471284232
Back from getting TLE for: ISS
1 25544U 98067A 21140.04032925 .00001407 00000-0 33666-4 0 9993
2 25544 51.6437 121.9403 0003181 20.5176 89.9422 15.49024471284232
--------------- CUT HERE FOR EXCEPTION DECODER ---------------
Exception (0):
epc1=0x40205742 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000
>>>stack>>>
ctx: cont
sp: 3ffffc60 end: 3fffffc0 offset: 0190
3ffffdf0: 3ffef0c8 3ffef0c8 00000000 40205742
3ffffe00: 4826f70a 40a58085 00000000 40201391
3ffffe10: 29694578 419c857d 53b4fc98 4188ba74
3ffffe20: 9e64e6bd 4142c36d 9f2847e7 4142c36d
3ffffe30: 9ec6536c 4142c36d 00000000 7ff80000
3ffffe40: 64c2e190 40243cd7 00000000 00000000
3ffffe50: 00000000 7ff80000 025b1a9d 40677d2c
3ffffe60: fd85cd34 4060ed36 e7c75dd0 4054b214
3ffffe70: 00000000 7ff80000 00000000 00000000
3ffffe80: 00000000 00000000 00000000 00000000
3ffffe90: 3ffef0c8 40768000 00000000 4020e35c
3ffffea0: 57b405d0 3fbf58d2 aa3f2101 3ffef4c8
3ffffeb0: 00000000 40768000 3ffef0c8 402051bf
3ffffec0: d2f1a9fc 3fb0624d 603dd1bb 4142c36d
3ffffed0: 3ffef100 00000005 3ffe8eec 40216020
3ffffee0: bd54dafd 40b819a8 6d8730c4 c0890ac4
3ffffef0: 8344ba4d c0a58087 b9e54e92 bfdace28
3fffff00: 4e957678 bfc08860 c6bf9100 407ac733
3fffff10: 603dd1bb 4142c36d 3ffef6d8 3ffef836
3fffff20: 3ffe85cc 00000045 3ffefbc8 3ffe85cc
3fffff30: 3ffef0c8 3ffef6ac 3ffef0c8 00000000
3fffff40: 3ffef0c8 3ffef6ac 3ffefbc8 402028a4
3fffff50: 00000000 40500000 feefeffe feefeffe
3fffff60: 00000000 0024002f 00000000 00000000
3fffff70: 0024002f 00000000 feefeffe feefeffe
3fffff80: 40496eb3 80000000 40160103 20000000
3fffff90: feefeffe feefeffe feefeffe 3ffefc58
3fffffa0: 3fffdad0 00000000 3ffefc44 40214730
3fffffb0: feefeffe feefeffe 3ffe87f8 40100e39
<<<stack<<<
--------------- CUT HERE FOR EXCEPTION DECODER ---------------
After looking at the error in Arduino EDI "ESP Exception Decoder" I get the following error message but I am stuck at this point.
Exception 0: Illegal instruction
PC: 0x40205742
EXCVADDR: 0x00000000
Decoding stack results
0x40201391: Predict(int) at D:\Arduino Projects\tracker_main/tracker_main.ino line 408
0x4020e35c: Sgp4::visible() at D:\Arduino Projects\libraries\Sgp4-Library-master\src\visible.cpp line 197
0x402051bf: Sgp4::findsat(double) at D:\Arduino Projects\libraries\Sgp4-Library-master\src\sgp4pred.cpp line 87
0x40216020: uart_write(uart_t*, char const*, size_t) at C:\Users\Peter\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.0\cores\esp8266\uart.cpp line 546
0x402028a4: setup() at D:\Arduino Projects\tracker_main/tracker_main.ino line 157
0x40214730: loop_wrapper() at C:\Users\Peter\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.0\cores\esp8266\core_esp8266_main.cpp line 198
At the moment there is no hardware (sensors, stepper motor) connected to the NodeMCU, I only uploaded the code at first to see if I got this working.
I hope to find some help here.

Unknown Ruby error when running rake db:create I am on raspberry pi running the latest version of it's os

So I've been following this blog to get my ruby on rails server setup. Everything has been great except for a few bugs here or there. However, when I run rake db:create I get this odd bug
ea000-76feb000 rw-p 00021000 b3:02 352 /lib/arm-linux-gnueabihf/ld-2.28.so
7e6a6000-7eea5000 rw-p 00000000 00:00 0 [stack]
7ef7a000-7ef7b000 r-xp 00000000 00:00 0 [sigpage]
7ef7b000-7ef7c000 r--p 00000000 00:00 0 [vvar]
7ef7c000-7ef7d000 r-xp 00000000 00:00 0 [vdso]
ffff0000-ffff1000 r-xp 00000000 00:00 0 [vectors]
[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html
ABORTED
I'm not quite sure what the bug is or why I can't see what the exact error is. The cli looks like the first 4 lines just repreated with various different foloders and no explanation

ESP32 GPIO commands

I just flashed a ESP32 with new custom build for lua files, designed from:
https://nodemcu-build.com/ with dev-esp32<>BETA
And it seems to be working, I can connect with ESPlorer and the firmware is installed as viewed in the startup code.
Im trying to toggle the BUILTIN_LED, but I get error using the GPIO commands.
It worked out of the box with simple arduino code, did I mess something up or why is this not working?
Here is the log with error response from GPIO.mode command
Communication with MCU..Got answer! Communication with MCU established.
AutoDetect firmware...
Can't autodetect firmware, because proper answer not received (may be unknown firmware).
Please, reset module or continue.
ts Jun 8 2016 00:22:57
rst:0x1 (POWERON_RESET),boot:0x12 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:6716
load:0x40078000,len:11116
ho 0 tail 12 room 4
load:0x40080400,len:5940
entry 0x40080700
[0;32mI (69) boot: Chip Revision: 1[0m
[0;32mI (69) boot_comm: chip revision: 1, min. bootloader chip revision: 0[0m
[0;32mI (41) boot: ESP-IDF v3.3.1 2nd stage bootloader[0m
[0;32mI (41) boot: compile time 17:08:58[0m
[0;32mI (41) boot: Enabling RNG early entropy source...[0m
[0;32mI (46) boot: SPI Speed : 40MHz[0m
[0;32mI (50) boot: SPI Mode : DIO[0m
[0;32mI (54) boot: SPI Flash Size : 4MB[0m
[0;32mI (58) boot: Partition Table:[0m
[0;32mI (61) boot: ## Label Usage Type ST Offset Length[0m
[0;32mI (69) boot: 0 nvs WiFi data 01 02 00009000 00006000[0m
[0;32mI (76) boot: 1 phy_init RF data 01 01 0000f000 00001000[0m
[0;32mI (84) boot: 2 factory factory app 00 00 00010000 00180000[0m
[0;32mI (91) boot: 3 lfs unknown c2 01 00190000 00010000[0m
[0;32mI (99) boot: 4 nodemcuspiffs unknown c2 00 001a0000 00070000[0m
[0;32mI (106) boot: End of partition table[0m
[0;32mI (110) boot_comm: chip revision: 1, min. application chip revision: 0[0m
[0;32mI (118) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x1bdf4 (114164) map[0m
[0;32mI (165) esp_image: segment 1: paddr=0x0002be1c vaddr=0x3ffb0000 size=0x02fcc ( 12236) load[0m
[0;32mI (170) esp_image: segment 2: paddr=0x0002edf0 vaddr=0x40080000 size=0x00400 ( 1024) load[0m
[0;32mI (172) esp_image: segment 3: paddr=0x0002f1f8 vaddr=0x40080400 size=0x00e18 ( 3608) load[0m
[0;32mI (182) esp_image: segment 4: paddr=0x00030018 vaddr=0x400d0018 size=0x84a0c (543244) map[0m
[0;32mI (373) esp_image: segment 5: paddr=0x000b4a2c vaddr=0x40081218 size=0x0f074 ( 61556) load[0m
[0;32mI (398) esp_image: segment 6: paddr=0x000c3aa8 vaddr=0x400c0000 size=0x00064 ( 100) load[0m
[0;32mI (408) boot: Loaded app from partition at offset 0x10000[0m
[0;32mI (408) boot: Disabling RNG early entropy source...[0m
[0;32mI (409) cpu_start: Pro cpu up.[0m
[0;32mI (413) cpu_start: Application information:[0m
[0;32mI (418) cpu_start: Project name: NodeMCU[0m
[0;32mI (423) cpu_start: App version: a8b46af-dirty[0m
[0;32mI (428) cpu_start: Compile time: Apr 15 2020 17:09:01[0m
[0;32mI (434) cpu_start: ELF file SHA256: af54a39e6c0fb11d...[0m
[0;32mI (440) cpu_start: ESP-IDF: v3.3.1[0m
[0;32mI (445) cpu_start: Starting app cpu, entry point is 0x40081244[0m
[0;32mI (0) cpu_start: App cpu up.[0m
[0;32mI (456) heap_init: Initializing. RAM available for dynamic allocation:[0m
[0;32mI (462) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM[0m
[0;32mI (469) heap_init: At 3FFB9260 len 00026DA0 (155 KiB): DRAM[0m
[0;32mI (475) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM[0m
[0;32mI (481) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM[0m
[0;32mI (488) heap_init: At 4009028C len 0000FD74 (63 KiB): IRAM[0m
[0;32mI (494) cpu_start: Pro cpu start user code[0m
[0;32mI (176) cpu_start: Starting scheduler on PRO CPU.[0m
[0;32mI (0) cpu_start: Starting scheduler on APP CPU.[0m
Mounting flash filesystem...
No LFS image loaded
I (337) wifi: wifi driver task: 3ffc26a8, prio:23, stack:3584, core=0
[0;32mI (337) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE[0m
[0;32mI (337) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE[0m
I (367) wifi: wifi firmware version: ac331d7
I (367) wifi: config NVS flash: enabled
I (367) wifi: config nano formating: disabled
I (367) wifi: Init dynamic tx buffer num: 32
I (377) wifi: Init data frame dynamic rx buffer num: 32
I (377) wifi: Init management frame dynamic rx buffer num: 32
I (387) wifi: Init management short buffer num: 32
I (387) wifi: Init static rx buffer size: 1600
I (397) wifi: Init static rx buffer num: 10
I (397) wifi: Init dynamic rx buffer num: 32
NodeMCU ESP32 built on nodemcu-build.com provided by frightanic.com
branch: dev-esp32
commit: a8b46af905b759506e9fd5eabdadbd8beb83e7c2
SSL: false
modules: file,gpio,net,node,tmr,wifi
build 2020-04-15-17-07-08 powered by Lua 5.1.4 on ESP-IDF v3.3.1 on SDK IDF
lua: cannot open init.lua
>
gpio.write(2, LOW)
gpio.write(2, LOW)
stdin:1: bad argument #2 to 'write' (number expected, got nil)
stack traceback:
[C]: in function 'write'
stdin:1: in main chunk
>
As per https://nodemcu.readthedocs.io/en/dev-esp32/modules/gpio/#gpiowrite (and the error message) the second parameter has to be an int; 1 or 0.
Your code
gpio.write(2, LOW)
appears to send nil. Your LOW is not initialized anywhere, is it? What should definitely work fine is this:
LOW = 0
gpio.write(2, LOW)
(or gpio.write(2, 0) of course)
bad argument #2 to 'write' (number expected, got nil)
This tells what the problem is: The second argument to write is nil, i.e. LOW is nil. You can confirm that by typing print(LOW) and it should print nil
The reason is simple: LOW isn't defined anywhere;
as you can read in the documentation, NodeMCU defines gpio.LOW and gpio.HIGH (which, behind the scenes, are just 0 and 1)
As Marcel Stör pointed out, gpio.LOW and gpio.HIGH are only defined for the ESP8266 version of the firmware. For ESP32 you need to use plain numerical 0 and 1 instead (or define your own variables)

Error in binutils make for cross compilation

I am trying to compile binutils to set up GNU toolchain for cross compiling for ARM on linux x86 architecture.
For this, I downloaded the GNU toolchain from :
http://lejosrt.org/tuto/install-gnu-arm-toolchain-under-linux
This requires a script to be run to install and compile everything.
However, on running the script, following error occurs:
make[2]: Entering directory /home/GNU_Toolchain/src/binutils-2.20.51.0.1/libiberty'
rm -f ./libiberty.a pic/./libiberty.a
ar rc ./libiberty.a \
./regex.o ./cplus-dem.o ./cp-demangle.o ./md5.o ./sha1.o ./alloca.o ./argv.o ./choose-temp.o ./concat.o ./cp-demint.o ./crc32.o ./dyn-string.o ./fdmatch.o ./fibheap.o ./filename_cmp.o ./floatformat.o ./fnmatch.o ./fopen_unlocked.o ./getopt.o ./getopt1.o ./getpwd.o ./getruntime.o ./hashtab.o ./hex.o ./lbasename.o ./lrealpath.o ./make-relative-prefix.o ./make-temp-file.o ./objalloc.o ./obstack.o ./partition.o ./pexecute.o ./physmem.o ./pex-common.o ./pex-one.o ./pex-unix.o ./safe-ctype.o ./sort.o ./spaces.o ./splay-tree.o ./strerror.o ./strsignal.o ./unlink-if-ordinary.o ./xatexit.o ./xexit.o ./xmalloc.o ./xmemdup.o ./xstrdup.o ./xstrerror.o ./xstrndup.o
*** buffer overflow detected ***: ar terminated
======= Backtrace: =========
/lib/i386-linux-gnu/libc.so.6(__fortify_fail+0x50)[0x40117df0]
/lib/i386-linux-gnu/libc.so.6(+0xe4cca)[0x40116cca]
/lib/i386-linux-gnu/libc.so.6(+0xe43c8)[0x401163c8]
/lib/i386-linux-gnu/libc.so.6(_IO_default_xsputn+0x95)[0x4009b7e5]
/lib/i386-linux-gnu/libc.so.6(_IO_padn+0xc8)[0x4008f598]
/lib/i386-linux-gnu/libc.so.6(_IO_vfprintf+0x1cd5)[0x40070e35]
/lib/i386-linux-gnu/libc.so.6(__vsprintf_chk+0xad)[0x4011647d]
/lib/i386-linux-gnu/libc.so.6(__sprintf_chk+0x2d)[0x401163bd]
ar[0x804ec04]
ar[0x8050d38]
ar[0x80585c2]
ar[0x804b452]
ar[0x804c3fd]
/lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xe7)[0x40048e37]
ar[0x80494c1]
======= Memory map: ========
08048000-080b5000 r-xp 00000000 08:01 3940915 /usr/local/bin/ar
080b5000-080b6000 r--p 0006c000 08:01 3940915 /usr/local/bin/ar
080b6000-080b7000 rw-p 0006d000 08:01 3940915 /usr/local/bin/ar
080b7000-080bb000 rw-p 00000000 00:00 0
08efe000-08f9d000 rw-p 00000000 00:00 0 [heap]
40000000-4001c000 r-xp 00000000 08:01 3670837 /lib/i386-linux-gnu/ld-2.13.so
4001c000-4001d000 r--p 0001b000 08:01 3670837 /lib/i386-linux-gnu/ld-2.13.so
4001d000-4001e000 rw-p 0001c000 08:01 3670837 /lib/i386-linux-gnu/ld-2.13.so
4001e000-4001f000 r-xp 00000000 00:00 0 [vdso]
4001f000-40021000 rw-p 00000000 00:00 0
40021000-40022000 r--p 0065c000 08:01 3544340 /usr/lib/locale/locale-archive
40032000-4018c000 r-xp 00000000 08:01 3670850 /lib/i386-linux-gnu/libc-2.13.so
4018c000-4018d000 ---p 0015a000 08:01 3670850 /lib/i386-linux-gnu/libc-2.13.so
4018d000-4018f000 r--p 0015a000 08:01 3670850 /lib/i386-linux-gnu/libc-2.13.so
4018f000-40190000 rw-p 0015c000 08:01 3670850 /lib/i386-linux-gnu/libc-2.13.so
40190000-40195000 rw-p 00000000 00:00 0
40195000-40395000 r--p 00000000 08:01 3544340 /usr/lib/locale/locale-archive
403a6000-403c0000 r-xp 00000000 08:01 3670878 /lib/i386-linux-gnu/libgcc_s.so.1
403c0000-403c1000 r--p 00019000 08:01 3670878 /lib/i386-linux-gnu/libgcc_s.so.1
403c1000-403c2000 rw-p 0001a000 08:01 3670878 /lib/i386-linux-gnu/libgcc_s.so.1
bff19000-bff3b000 rw-p 00000000 00:00 0 [stack]
make[2]: *** [libiberty.a] Aborted
make[2]: *** Deleting filelibiberty.a'
make[2]: Leaving directory /home/GNU_Toolchain/src/binutils-2.20.51.0.1/libiberty'
make[1]: *** [all-libiberty] Error 2
make[1]: Leaving directory/home/GNU_Toolchain/src/binutils-2.20.51.0.1'
make: * [all] Error 2
I tried upgrading binutils package but in vain.
Any ideas?
Thanks in advance.
If you want to just build it and ignore potential problems, put -D_FORTIFY_SOURCE=1 in with your CFLAGS. Since you're using make, it would look something like:
make CFLAGS="«other CFLAGS» -D_FORTIFY_SOURCE=1" «...»
Depending on your project, you could even supply this as a flag to the configure script.
When you build, you'll get a bunch of warnings about redefining this macro, but that's expected.
So what does this flag do? I'm no expert, but it's basically a new feature in recent versions of gcc/glibc that attempts to detect buffer overflows. The default level is "2" (AFAIK), which actually imposes some extra limits above and beyond what the standards dictate. Level "1" is a little less strict.
If you're pedantic, you might like to investigate exactly why your compiler is detecting a buffer overflow. It might be, for example, a call to snprintf where someone's forgotten about the NUL termination behaviour.
(Although: before you go to the trouble, it's quite likely that it's been patched by someone in the upstream project and the fix hasn't trickled through to whatever project you're obtaining this from, so I'd ask the project maintainers about it first.)
For more information, see this RedHat binutils mailing list post.

Resources