Bug 674852 - snmp-agent no longer works with Fedora 14
Summary: snmp-agent no longer works with Fedora 14
Alias: None
Product: 389
Classification: Retired
Component: snmp
Version: 1.2.8
Hardware: i686
OS: Linux
Target Milestone: ---
Assignee: Nathan Kinder
QA Contact: Viktor Ashirov
Depends On:
Blocks: 639035 389_1.2.8 679210 681351
TreeView+ depends on / blocked
Reported: 2011-02-03 14:40 UTC by David Yaffe
Modified: 2015-12-07 16:45 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 681351 (view as bug list)
Last Closed: 2015-12-07 16:45:08 UTC

Attachments (Terms of Use)
Simple fix for segfault in ldap-agent-bin (466 bytes, patch)
2011-02-23 19:11 UTC, Andrej Ota
no flags Details | Diff

Description David Yaffe 2011-02-03 14:40:30 UTC
Description of problem:
snmp-agent crashes when lauching.

Version-Release number of selected component (if applicable):

How reproducible:
start dirsrv-snmp

Steps to Reproduce:
1. configure /etc/dirsrv/config/ldap-agent.conf to refer to the proper directory instance
2. start the snmp agent.
Actual results:
using service dirsrv-snmp start, the standard [FAILED] message is displayed.
/var/log/messages contains the following:
Feb  3 08:31:06 daisy kernel: [71624.891859] ldap-agent-bin[29793]: segfault at 0 ip 00abd978 sp bfdf5684 error 6 in libc-2.12.90.so[a44000+18d000]
Feb  3 08:31:06 daisy abrt[29796]: saved core dump of pid 29793 (/usr/sbin/ldap-agent-bin) to /var/spool/abrt/ccpp-1296743466-29793.new/coredump (991232 bytes)
Feb  3 08:31:06 daisy abrtd: Directory 'ccpp-1296743466-29793' creation detected
Feb  3 08:31:06 daisy abrtd: Crash is in database already (dup of /var/spool/abrt/ccpp-1296671123-3787)
Feb  3 08:31:06 daisy abrtd: Deleting crash ccpp-1296743466-29793 (dup of ccpp-1296671123-3787), sending dbus signal

Expected results:
The SNMP agent starts. With version 1.2.7, the SNMP agent started when selinux was disabled.

Additional info:
System is a new installation of Fedora 14, with all patches applied.

manually launching snmp agent results:
[root@daisy ~]# sh -x ldap-agent -D /etc/dirsrv/config/ldap-agent.conf
+ LIB_DIR=:::
+ BIN_DIR=/usr/sbin
+ COMMAND=ldap-agent-bin
+ export MIBS
+ PATH=/usr/sbin
+ export PATH
+ IFS=:
+ for dir in '${PATH}'
+ '[' -x /usr/sbin/ldap-agent-bin ']'
+ IFS='
+ /usr/sbin/ldap-agent-bin -D /etc/dirsrv/config/ldap-agent.conf
/usr/sbin/ldap-agent: line 48: 29813 Segmentation fault      (core dumped) ${dir}/${COMMAND} "$@"
+ exit 139

Comment 1 Nathan Kinder 2011-02-03 17:48:34 UTC
I am unable to reproduce the crash on my fully updated F14 system.  Please install the 389-ds-base-debuginfo package and launch ldap-agent-bin manually from gdb.  You should be able to generate a stack trace so we can see what is going on.

Comment 2 Andrej Ota 2011-02-23 19:11:08 UTC
Created attachment 480557 [details]
Simple fix for segfault in ldap-agent-bin

I have also stumbeled on this bug this morning. The bug is caused by uninitialized buflen variable in ldap/servers/snmp/main.c, function load_config().

It's triggered by a call to ldif_read_record, which checks for buflen and reallocates memory if needed. As buflen isn't properly initialized to 0, this means the method randomly (or in my case not so randomly) segfaults while reading dse.ldif configuration of server instance.

I have attached a patch to fix this bug.

Comment 3 Nathan Kinder 2011-03-01 21:48:26 UTC
Pushed patch contributed by Andrej to master.  Thanks for helping by finding the cause of the crash!

Counting objects: 11, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (6/6), done.
Writing objects: 100% (6/6), 608 bytes, done.
Total 6 (delta 5), reused 0 (delta 0)
To ssh://git.fedorahosted.org/git/389/ds.git
   6d4566e..9b5d9e6  master -> master

Note You need to log in before you can comment on or make changes to this bug.