#1230 FC Dev, Segmentation fault

linux
closed
Robert Story
agent (1104)
7
2012-11-08
2004-10-22
Ted Kaczmarek
No

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -158677312 (LWP 27951)]
0xf6ec8685 in init_interfaces () from
/usr/lib/libnetsnmpmibs.so.5
(gdb) bt
#0 0xf6ec8685 in init_interfaces () from
/usr/lib/libnetsnmpmibs.so.5
#1 0xf6e460db in free_config () from
/usr/lib/libnetsnmp.so.5
#2 0xf6e47ef4 in read_config_files () from
/usr/lib/libnetsnmp.so.5
#3 0xf6e4802e in read_premib_configs () from
/usr/lib/libnetsnmp.so.5
#4 0xf6e25d07 in init_snmp () from
/usr/lib/libnetsnmp.so.5
#5 0xf6ffd1ce in main () from /usr/sbin/snmpd

Fedora dev box, 2.6.9-1.640, net-snmp-5.1.2-11

Discussion

  • Robert Story
    Robert Story
    2004-10-22

    Logged In: YES
    user_id=76148

    any chance you could run under the debugger, and give us a
    line number where it is crasing? Try:

    $gdb `which snmpd`

    run -f
    where

     
  • Ted Kaczmarek
    Ted Kaczmarek
    2004-10-23

    Logged In: YES
    user_id=409473

    Sorry, I keep forgetting to install the debuginfo rpms :-)

    [Switching to Thread -158677312 (LWP 18559)]
    free_interface_config () at mibII/interfaces.c:392
    392 free(if_ptr->name);
    (gdb) where
    #0 free_interface_config () at mibII/interfaces.c:392
    #1 0xf6e460db in free_config () at read_config.c:759
    #2 0xf6e47ef4 in read_config_files (when=1) at
    read_config.c:998
    #3 0xf6e4802e in read_premib_configs () at read_config.c:818
    #4 0xf6e25d07 in init_snmp (type=0xf6fff528 "snmpd") at
    snmp_api.c:806
    #5 0xf6ffd1ce in main (argc=2, argv=0xfefe2a54) at snmpd.c:867
    (gdb)

     
  • Robert Story
    Robert Story
    2004-10-28

    Logged In: YES
    user_id=76148

    Are you using the 'interface' directive in snmpd.conf? I'm
    guessing not. At any rate, try this simple patch. Not sure
    why you would be crashing and nobody else is, but it's worth
    a shot.

    ===================================================================
    RCS file:
    /cvsroot/net-snmp/net-snmp/agent/mibgroup/mibII/interfaces.c,v
    retrieving revision 5.14.2.5
    diff -u -r5.14.2.5 interfaces.c
    --- agent/mibgroup/mibII/interfaces.c 6 Oct 2004 20:16:05
    -0000 5.14.2.5
    +++ agent/mibgroup/mibII/interfaces.c 28 Oct 2004 16:10:38 -0000
    @@ -322,7 +322,7 @@
    struct _conf_if_list *next;
    } conf_if_list;

    -static conf_if_list *conf_list;
    +static conf_if_list *conf_list = NULL;
    #ifdef linux
    static struct ifnet *ifnetaddr_list;
    #endif

     
  • Ted Kaczmarek
    Ted Kaczmarek
    2004-11-05

    Logged In: YES
    user_id=409473

    5.2rc2 resolves this, so I didn't try the patch. If you want
    ant more info let me know. Thanks a bunch.

     
  • Ted Kaczmarek
    Ted Kaczmarek
    2004-11-05

    Logged In: YES
    user_id=409473

    Thanks for the bug report! We've fixed the problem in the
    main development tree, so it should be fixed in the 5.2 release
    of the net-snmp package.

     
  • Robert Story
    Robert Story
    2004-11-18

    Logged In: YES
    user_id=76148

    closing, as it works for me, nobody else seems to have the
    problem, and submitter is happy w/5.2.

     
  • Neal Groothuis
    Neal Groothuis
    2005-01-27

    Logged In: YES
    user_id=1206518

    I'm able to replicate this -- I'm running 2.6.10 on a pretty stripped down
    FC 3 box. In addition to conf_list not being initialized in interfaces.c, it's
    also not initialized in hr_disk.c. The following patch should fix it,
    although it looks like 5.2 is a complete rewrite anyway.

    diff -ruN net-snmp-5.1.2-vanilla/agent/mibgroup/host/hr_disk.c net-
    snmp-5.1.2/agent/mibgroup/host/hr_disk.c
    --- net-snmp-5.1.2-vanilla/agent/mibgroup/host/hr_disk.c 2004-07
    -02 08:50:19.000000000 -0500
    +++ net-snmp-5.1.2/agent/mibgroup/host/hr_disk.c 2005-01
    -27 17:11:32.527608800 -0600
    @@ -232,7 +232,7 @@
    conf_disk_item *list_item;
    struct _conf_disk_list *list_next;
    } conf_disk_list;
    -static conf_disk_list *conf_list;
    +static conf_disk_list *conf_list = NULL;

    static int match_disk_config(const char *);
    static int match_disk_config_item(const char *, conf_disk_item *);
    diff -ruN net-snmp-5.1.2-vanilla/agent/mibgroup/mibII/interfaces.c net-
    snmp-5.1.2/agent/mibgroup/mibII/interfaces.c
    --- net-snmp-5.1.2-vanilla/agent/mibgroup/mibII/interfaces.c 2004-07
    -22 19:55:41.000000000 -0500
    +++ net-snmp-5.1.2/agent/mibgroup/mibII/interfaces.c 2005-01
    -27 16:04:02.802260632 -0600
    @@ -322,7 +322,7 @@
    struct _conf_if_list *next;
    } conf_if_list;

    -static conf_if_list *conf_list;
    +static conf_if_list *conf_list = NULL;
    #ifdef linux
    static struct ifnet *ifnetaddr_list;
    #endif

     
  • Wes Hardaker
    Wes Hardaker
    2005-01-31

    Logged In: YES
    user_id=76242

    re-opening based on last comment.

     
  • Thomas Anders
    Thomas Anders
    2005-10-18

    Logged In: YES
    user_id=848638

    Thanks for the patch. Part of it has been applied earlier,
    the missing piece (hr_disk.c changes) have now also been
    applied to 5.1.x an will appear in 5.1.4. As we're in code
    freeze for 5.2.x, this branch will have to wait until after
    5.2.2.

     
  • Thomas Anders
    Thomas Anders
    2005-11-14

    Logged In: YES
    user_id=848638

    We had the chance to apply it to 5.2.2 before release, so
    all of 5.1.4, 5.2.2 and 5.3 will contain the fix.