BusyBox Bug and Patch Tracking
BusyBox
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000891 [buildroot] Shared Library Support major sometimes 06-01-06 08:45 02-12-07 05:34
Reporter mfuzzey View Status public  
Assigned To buildroot
Priority normal Resolution open  
Status assigned   Product Version 0.9.27
Summary 0000891: Segfault in snmpd apparantly caused by non initialised shared library BSS
Description net-snmpd 5.1.2 built with buildroot sometimes segfaults on startup.
Once this occurs it is 100% reproducable until reboot...

Prelimery investigation points to uClibc shared library support (but I may be wrong...)

Segfault occurs because external_signal_scheduled[] and external_signal_handler[] defined in agents/agent_registry.c and compiled to libnetsnmpagent.so are not initialised but the code assumes they are zero filled on startup.

Additional Information Adding code to start main() in snmpd.c:
    printf("table at %p\n", external_signal_scheduled);
        for (i = 0; i < NUM_EXTERNAL_SIGS; i++) {
        printf("init signal %d scheduled=%d handler=%p\n", i, external_signal_scheduled[i], external_signal_handler[i]);
        }

Output:
table at 0x16ba8
init signal 0 scheduled=0 handler=(nil)
...
init signal 10 scheduled=-1 handler=(nil)
init signal 11 scheduled=67174399 handler=(nil)
...

Manually zeroing the tables in main() "fixes" the problem.

The load address reported above agrees with readelf :
mfuzzey@dhcp78-150:~$ readelf snmpd -a | grep external_signal_scheduled
    96: 00016ba8 128 OBJECT GLOBAL DEFAULT 21 external_signal_scheduled

Which is indeed in BSS:
:~/$ readelf snmpd -S | grep bss
  [21] .bss NOBITS 000167f4 0067f4 00167c 00 WA 0 0 8











Attached Files

- Relationships

- Notes
(0001910)
bernhardf
12-22-06 03:06

Please provide a package/netsnmp/netsnmp-5.2.1-fix-extern-initializers.patch
that corrects this bug in netsnmp.
Make sure to send the patch upstream too.

TIA,
 

- Issue History
Date Modified Username Field Change
06-01-06 08:45 mfuzzey New Issue
06-01-06 08:45 mfuzzey Status new => assigned
06-01-06 08:45 mfuzzey Assigned To  => uClibc
06-01-06 09:06 mfuzzey Issue Monitored: mfuzzey
12-22-06 03:06 bernhardf Note Added: 0001910
12-22-06 03:06 bernhardf Status assigned => feedback
02-12-07 05:34 vapier Status feedback => assigned
02-12-07 05:34 vapier Assigned To uClibc => buildroot


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker