Copyright (C) 2010 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /secgate/sbin/snmpd...done.
Breakpoint 1 at 0x402ba0: file snmpd.c, line 436.
Starting program: /secgate/sbin/snmpd -c /secgate/etc/conf/snmp/snmpd.conf -Dall -f
(gdb) n
437 char options[128] = "aAc:CdD::fhHI:l:L:m:M:n:p:P:qrsS:UvV-:Y:";
(gdb) n
436 {
(gdb)
437 char options[128] = "aAc:CdD::fhHI:l:L:m:M:n:p:P:qrsS:UvV-:Y:";
(gdb)
436 {
(gdb)
437 char options[128] = "aAc:CdD::fhHI:l:L:m:M:n:p:P:qrsS:UvV-:Y:";
(gdb)
443 char option_compatability[] = "-Le";
(gdb)
454 for (i = getdtablesize() - 1; i > 2; --i) {
(gdb)
455 (void) close(i);
(gdb)
454 for (i = getdtablesize() - 1; i > 2; --i) {
(gdb)
455 (void) close(i);
(gdb)
454 for (i = getdtablesize() - 1; i > 2; --i) {
(gdb)
455 (void) close(i);
(gdb)
454 for (i = getdtablesize() - 1; i > 2; --i) {
(gdb)
455 (void) close(i);
(gdb)
454 for (i = getdtablesize() - 1; i > 2; --i) {
(gdb) c
Continuing.
Breakpoint 2, main (argc=5, argv=0x7fffffffe578) at snmpd.c:464
464 DEBUGMSGTL(("signal", "registering SIGTERM signal handler\n"));
(gdb) n
trace: main(): snmpd.c, 464:
signal: registering SIGTERM signal handler
465 signal(SIGTERM, SnmpdShutDown);
(gdb)
468 DEBUGMSGTL(("signal", "registering SIGINT signal handler\n"));
(gdb)
trace: main(): snmpd.c, 468:
signal: registering SIGINT signal handler
469 signal(SIGINT, SnmpdShutDown);
(gdb)
472 signal(SIGHUP, SIG_IGN); /* do not terminate on early SIGHUP */
(gdb)
475 DEBUGMSGTL(("signal", "registering SIGUSR1 signal handler\n"));
(gdb) b 920
Note: breakpoint 4 also set at pc 0x40377b.
Breakpoint 5 at 0x40377b: file snmpd.c, line 920.
(gdb)
Note: breakpoints 4 and 5 also set at pc 0x40377b.
Breakpoint 6 at 0x40377b: file snmpd.c, line 920.
(gdb) n
trace: main(): snmpd.c, 475:
signal: registering SIGUSR1 signal handler
476 signal(SIGUSR1, SnmpdDump);
(gdb)
479 DEBUGMSGTL(("signal", "registering SIGPIPE signal handler\n"));
(gdb)
trace: main(): snmpd.c, 479:
signal: registering SIGPIPE signal handler
480 signal(SIGPIPE, SIG_IGN); /* 'Inline' failure of wayward readers */
(gdb)
509 strcat(options, "g:u:");
(gdb)
480 signal(SIGPIPE, SIG_IGN); /* 'Inline' failure of wayward readers */
(gdb)
483 signal(SIGXFSZ, SnmpdCatchRandomSignal);
(gdb)
496 netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID,
(gdb)
trace: netsnmp_ds_set_boolean(): default_store.c, 216:
netsnmp_ds_set_boolean: Setting APP:3 = 0/False
498 netsnmp_ds_set_int(NETSNMP_DS_APPLICATION_ID,
(gdb)
trace: netsnmp_ds_set_int(): default_store.c, 268:
netsnmp_ds_set_int: Setting APP:4 = -1
500 netsnmp_ds_set_int(NETSNMP_DS_APPLICATION_ID,
(gdb)
trace: netsnmp_ds_set_int(): default_store.c, 268:
netsnmp_ds_set_int: Setting APP:5 = -1
503 netsnmp_ds_set_int(NETSNMP_DS_APPLICATION_ID,
(gdb)
trace: netsnmp_ds_set_int(): default_store.c, 268:
netsnmp_ds_set_int: Setting APP:10 = 5
509 strcat(options, "g:u:");
(gdb)
512 strcat(options, "x:");
(gdb)
509 strcat(options, "g:u:");
(gdb)
512 strcat(options, "x:");
(gdb)
515 strcat(options, "X");
(gdb)
512 strcat(options, "x:");
(gdb)
515 strcat(options, "X");
(gdb)
522 for (i=0; i<argc; i++) {
(gdb) n
515 strcat(options, "X");
(gdb)
522 for (i=0; i<argc; i++) {
(gdb)
434 main(int argc, char *argv[])
(gdb)
524 argv[i] = option_compatability;
(gdb)
434 main(int argc, char *argv[])
(gdb)
523 if (!strcmp(argv[i], "-L"))
(gdb)
522 for (i=0; i<argc; i++) {
(gdb)
523 if (!strcmp(argv[i], "-L"))
(gdb)
522 for (i=0; i<argc; i++) {
(gdb)
523 if (!strcmp(argv[i], "-L"))
(gdb)
522 for (i=0; i<argc; i++) {
(gdb)
523 if (!strcmp(argv[i], "-L"))
(gdb)
522 for (i=0; i<argc; i++) {
(gdb)
523 if (!strcmp(argv[i], "-L"))
(gdb)
522 for (i=0; i<argc; i++) {
(gdb)
531 snmp_log_syslogname(app_name);
(gdb)
534 netsnmp_ds_set_string(NETSNMP_DS_LIBRARY_ID,
(gdb)
541 switch (arg) {
(gdb)
531 snmp_log_syslogname(app_name);
(gdb)
534 netsnmp_ds_set_string(NETSNMP_DS_LIBRARY_ID,
(gdb)
trace: netsnmp_ds_set_string(): default_store.c, 294:
netsnmp_ds_set_string: Setting LIB:6 = "snmpd"
775 uid = strtoul(optarg, &ecp, 10);
(gdb)
534 netsnmp_ds_set_string(NETSNMP_DS_LIBRARY_ID,
(gdb)
775 uid = strtoul(optarg, &ecp, 10);
(gdb)
540 while ((arg = getopt(argc, argv, options)) != EOF) {
(gdb)
541 switch (arg) {
(gdb)
563 if (optarg != NULL) {
(gdb)
564 netsnmp_ds_set_string(NETSNMP_DS_LIBRARY_ID,
(gdb)
trace: netsnmp_ds_set_string(): default_store.c, 294:
netsnmp_ds_set_string: Setting LIB:5 = "/secgate/etc/conf/snmp/snmpd.conf"
540 while ((arg = getopt(argc, argv, options)) != EOF) {
(gdb)
541 switch (arg) {
(gdb)
583 debug_register_tokens(optarg);
(gdb)
584 snmp_set_do_debugging(1);
(gdb)
585 break;
(gdb)
540 while ((arg = getopt(argc, argv, options)) != EOF) {
(gdb)
541 switch (arg) {
(gdb)
540 while ((arg = getopt(argc, argv, options)) != EOF) {
(gdb)
839 if (do_help) {
(gdb)
850 if (optind < argc) {
(gdb)
885 if (0 == log_set)
(gdb)
886 snmp_enable_filelog(NETSNMP_LOGFILE,
(gdb)
logging:register: registering log type 3 with pri 7
893 DEBUGMSGTL(("aaa", "bb"));
(gdb)
Log handling defined - disabling stderr
900 argvrestartp = (char **)malloc((argc + 2) * sizeof(char *));
(gdb)
902 for (i = 0, ret = 1; i < argc; i++) {
(gdb)
900 argvrestartp = (char **)malloc((argc + 2) * sizeof(char *));
(gdb)
902 for (i = 0, ret = 1; i < argc; i++) {
(gdb)
900 argvrestartp = (char **)malloc((argc + 2) * sizeof(char *));
(gdb)
902 for (i = 0, ret = 1; i < argc; i++) {
(gdb)
434 main(int argc, char *argv[])
(gdb)
903 ret += strlen(argv[i]) + 1;
(gdb)
902 for (i = 0, ret = 1; i < argc; i++) {
(gdb)
903 ret += strlen(argv[i]) + 1;
(gdb)
902 for (i = 0, ret = 1; i < argc; i++) {
(gdb)
903 ret += strlen(argv[i]) + 1;
(gdb)
902 for (i = 0, ret = 1; i < argc; i++) {
(gdb)
903 ret += strlen(argv[i]) + 1;
(gdb)
902 for (i = 0, ret = 1; i < argc; i++) {
(gdb)
903 ret += strlen(argv[i]) + 1;
(gdb)
902 for (i = 0, ret = 1; i < argc; i++) {
(gdb)
903 ret += strlen(argv[i]) + 1;
(gdb)
902 for (i = 0, ret = 1; i < argc; i++) {
(gdb)
903 ret += strlen(argv[i]) + 1;
(gdb)
902 for (i = 0, ret = 1; i < argc; i++) {
(gdb)
903 ret += strlen(argv[i]) + 1;
(gdb)
902 for (i = 0, ret = 1; i < argc; i++) {
(gdb)
903 ret += strlen(argv[i]) + 1;
(gdb)
902 for (i = 0, ret = 1; i < argc; i++) {
(gdb) c
Continuing.
Breakpoint 3, main (argc=5, argv=0x7fffffffe578) at snmpd.c:905
905 argvrestart = (char *) malloc(ret);
(gdb)
Continuing.
Breakpoint 4, main (argc=<value optimized out>, argv=0x7fffffffe578) at snmpd.c:921
921 DEBUGMSGTL(("aaa", "agent_mode:%d", agent_mode));
(gdb) n
922 if (agent_mode == -1) {
(gdb)
923 if (strstr(argv[0], "agentxd") != NULL) {
(gdb)
927 DEBUGMSGTL(("aaa", "bb"));
(gdb)
928 netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID,
(gdb)
937 DEBUGMSGTL(("aaa", "bb"));
(gdb) n
939 if (init_agent(app_name) != 0) {
(gdb)
944 DEBUGMSGTL(("aaa", "bb"));
(gdb)
945 init_mib_modules();
(gdb)
950 DEBUGMSGTL(("aaa", "bb"));
(gdb)
951 init_snmp(app_name);
(gdb)
953 if ((ret = init_master_agent()) != 0) {
(gdb)
965 if(!dont_fork) {
(gdb)
986 if (pid_file != NULL) {
(gdb)
1020 DEBUGMSGTL(("aaa", "bb"));
(gdb)
1024 persistent_dir = get_persistent_directory();
(gdb)
1025 mkdirhier( persistent_dir, NETSNMP_AGENT_DIRECTORY_MODE, 0 );
(gdb)
1024 persistent_dir = get_persistent_directory();
(gdb)
1025 mkdirhier( persistent_dir, NETSNMP_AGENT_DIRECTORY_MODE, 0 );
(gdb)
1027 uid = netsnmp_ds_get_int(NETSNMP_DS_APPLICATION_ID,
(gdb)
1029 gid = netsnmp_ds_get_int(NETSNMP_DS_APPLICATION_ID,
(gdb)
1027 uid = netsnmp_ds_get_int(NETSNMP_DS_APPLICATION_ID,
(gdb)
1029 gid = netsnmp_ds_get_int(NETSNMP_DS_APPLICATION_ID,
(gdb)
1033 DEBUGMSGTL(("aaa", "bb"));
(gdb)
1034 if ( uid != 0 || gid != 0 )
(gdb)
1039 DEBUGMSGTL(("aaa", "bb"));
(gdb)
1040 if ((gid = netsnmp_ds_get_int(NETSNMP_DS_APPLICATION_ID,
(gdb)
1057 DEBUGMSGTL(("aaa", "bb"));
(gdb) n
1058 if ((uid = netsnmp_ds_get_int(NETSNMP_DS_APPLICATION_ID,
(gdb)
1097 snmp_store(app_name);
(gdb)
1100 DEBUGMSGTL(("signal", "registering SIGHUP signal handler\n"));
(gdb)
1101 signal(SIGHUP, SnmpdReconfig);
(gdb)
1107 send_easy_trap(0, 0);
(gdb)
1112 snmp_log(LOG_INFO, "NET-SNMP version %s\n", netsnmp_get_version());
(gdb)
1116 netsnmp_addrcache_initialise();
(gdb)
1121 DEBUGMSGTL(("snmpd/main", "We're up. Starting to process data.\n"));
(gdb)
1122 if (!netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
(gdb)
1124 receive();
(gdb)