[AGENT++] AGENTPP Digest, Vol 43, Issue 1

Rajesh Bansal bansal.rajeshkr at gmail.com
Wed Aug 1 13:02:38 CEST 2007


Dear Jochen,
1st case -------------------------

I am runing a example from this sorcr file
agent++/examples/dynamic_table/src/agent.cpp
output is this
[jimmy at localhost src]$ ./agent
20070801.16:02:37: 11514: (1)EVENT  : main: SNMP listen port: (4700)
20070801.16:02:37: 11514: (3)DEBUG  : MibContext: adding MIB object
(context)(oid): (), (1.3.6.1.2.1.1)
20070801.16:02:37: 11514: (3)DEBUG  : MibContext: adding MIB object
(context)(oid): (), (1.3.6.1.2.1.11)
20070801.16:02:37: 11514: (3)DEBUG  : MibContext: adding MIB object
(context)(oid): (), (1.3.6.1.6.3.12)
20070801.16:02:37: 11514: (3)DEBUG  : MibContext: adding MIB object
(context)(oid): (), (1.3.6.1.6.3.13.1)
20070801.16:02:37: 11514: (3)DEBUG  : MibContext: adding MIB object
(context)(oid): (), (1.3.6.1.4.1.4976.6.2.1)
20070801.16:02:37: 11514: (1)DEBUG  : TaskManager: thread started
20070801.16:02:37: 11514: (1)DEBUG  : TaskManager: thread started
20070801.16:02:37: 11514: (1)DEBUG  : TaskManager: thread started
20070801.16:02:37: 11514: (1)DEBUG  : TaskManager: thread started
20070801.16:02:37: 11514: (1)DEBUG  : Thread: started (tid): (-1208951888)
20070801.16:02:37: 11514: (1)DEBUG  : Thread: started (tid): (-1219441744)
20070801.16:02:37: 11514: (1)DEBUG  : Thread: started (tid): (-1229931600)
20070801.16:02:37: 11514: (1)DEBUG  : Thread: started (tid): (-1240421456)

Segmentation fault, aborting.
code of agent
Vbx* vbs = 0;
  coldStartOid coldOid;
  NotificationOriginator no;
  UdpAddress dest("127.0.0.1/162");
  no.add_v1_trap_destination(dest, "defaultV1Trap", "v1trap", "public");
  no.generate(vbs, 0, coldOid, "", "");
Request* req;
  while (run) {
        req = reqList->receive(2);
     if (req) {
         mib->process_request(req);
    }
    else {
          mib->cleanup();
    }
  }
  delete mib;
  Snmp::socket_cleanup();
  return 0;

this fault is at no.generate(vbs, 0, coldOid, "", ""); line
after commenting this line it gives segmentation fault after comming out
reqList->receive(2); function

2nd case --------------------------------
in example agent++/examples/atm_mib/src/agent.cpp
and ouput is this

./agent
20070801.16:07:15: 11564: (1)EVENT  : main: SNMP listen port: (4700)
20070801.16:07:15: 11564: (3)DEBUG  : MibContext: adding MIB object
(context)(oid): (), (1.3.6.1.2.1.1)
20070801.16:07:15: 11564: (3)DEBUG  : MibContext: adding MIB object
(context)(oid): (), (1.3.6.1.2.1.11)
20070801.16:07:15: 11564: (3)DEBUG  : MibContext: adding MIB object
(context)(oid): (), (1.3.6.1.6.3.1.1.6.1.0)
20070801.16:07:15: 11564: (3)DEBUG  : MibContext: adding MIB object
(context)(oid): (), (1.3.6.1.2.1.37)
20070801.16:07:15: 11564: (3)DEBUG  : MibContext: adding MIB object
(context)(oid): (), (1.3.6.1.4.1.4976.2.1)
20070801.16:07:15: 11564: (3)DEBUG  : MibContext: adding MIB object
(context)(oid): (), (1.3.6.1.4.1.4976.6.2)
20070801.16:07:15: 11564: (3)DEBUG  : MibContext: adding MIB object
(context)(oid): (), (1.3.6.1.4.1.4976.6.3)
20070801.16:07:15: 11564: (3)DEBUG  : MibContext: adding MIB object
(context)(oid): (), (1.3.6.1.6.3.12)
20070801.16:07:15: 11564: (3)DEBUG  : MibContext: adding MIB object
(context)(oid): (), (1.3.6.1.6.3.13.1)
20070801.16:07:15: 11564: (1)DEBUG  : TaskManager: thread started
20070801.16:07:15: 11564: (1)DEBUG  : TaskManager: thread started
20070801.16:07:15: 11564: (1)DEBUG  : TaskManager: thread started
20070801.16:07:15: 11564: (1)DEBUG  : TaskManager: thread started

Segmentation fault, aborting.

code of agent
Vbx* vbs = 0;
  coldStartOid coldOid;
  NotificationOriginator no;
  UdpAddress dest("127.0.0.1/162");
  no.add_v1_trap_destination(dest, "defaultV1Trap", "v1trap", "public");
mib->notify("", coldOid, vbs, 0);
Request* req;
  while (run) {
        req = reqList->receive(2);
     if (req) {
         mib->process_request(req);
    }
    else {
          mib->cleanup();
    }
  }
  delete mib;
  Snmp::socket_cleanup();
  return 0;

this fault is at mib->notify("", coldOid, vbs, 0); line
after commenting this line it gives segmentation fault after comming out
reqList->receive(2); function





On 8/1/07, agentpp-request at agentpp.org <agentpp-request at agentpp.org> wrote:
>
> Send AGENTPP mailing list submissions to
>         agentpp at agentpp.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         http://lists.agentpp.org/mailman/listinfo/agentpp
> or, via email, send a message with subject or body 'help' to
>         agentpp-request at agentpp.org
>
> You can reach the person managing the list at
>         agentpp-owner at agentpp.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of AGENTPP digest..."
>
> Today's Topics:
>
>    1. AGENTPP Digest, Vol 42, Issue 15 (Rajesh Bansal)
>    2. Re: AGENTPP Digest, Vol 42, Issue 14 (Rajesh Bansal)
>    3. Re: Re: AGENTPP Digest, Vol 42, Issue 14 (Jochen Katz)
>
>
> ---------- Forwarded message ----------
> From: "Rajesh Bansal" <bansal.rajeshkr at gmail.com>
> To: katz at agentpp.com
> Date: Tue, 31 Jul 2007 17:44:00 +0530
> Subject: [AGENT++] AGENTPP Digest, Vol 42, Issue 15
> Dear Jochen,
> I have tried many times result is same. Again after commenting #define
> _NO_SNMPv3 this line and compiling snmp++ and agent++ libraries all
> examples
> are working fine. Can you tell me where may be a problem.
>
> On 7/31/07, agentpp-request at agentpp.org <agentpp-request at agentpp.org>
> wrote:
> >
> > Send AGENTPP mailing list submissions to
> >         agentpp at agentpp.org
> >
> > To subscribe or unsubscribe via the World Wide Web, visit
> >         http://lists.agentpp.org/mailman/listinfo/agentpp
> > or, via email, send a message with subject or body 'help' to
> >         agentpp-request at agentpp.org
> >
> > You can reach the person managing the list at
> >         agentpp-owner at agentpp.org
> >
> > When replying, please edit your Subject line so it is more specific
> > than "Re: Contents of AGENTPP digest..."
> >
> > Today's Topics:
> >
> >    1. Re: A bug (Jochen Katz)
> >
> >
> > ---------- Forwarded message ----------
> > From: Jochen Katz <katz at agentpp.com>
> > To: agentpp at agentpp.org
> > Date: Mon, 30 Jul 2007 19:56:50 +0200
> > Subject: Re: [AGENT++] A bug
> > Hi,
> >
> > > I have defined _NO_SNMPv3 in config_snmp_pp.h file and after that i
> > compile
> > > snmp++ , agent++ , agentX++ libraries these are compiling right but
> > after
> > > that when i am tring to use given examples in agent++ and agentX++ all
> > are
> > > quiting program with segmentation fault. first after defiining
> > _NO_SNMPv3
> > > all examples are not compiling these are making errors
> > >
> > > master.o(.text+0x30e): In function `init(Agentpp::Mib&)':
> > > undefined reference to `Agentpp::UsmUserTable::UsmUserTable()'
> >
> > there seems to be an old library or object file somewhere. Make sure
> > that you do a complete rebuild in all directories.
> >
> > Regards,
> >   Jochen
> >
> >
> >
> > _______________________________________________
> > AGENTPP mailing list
> > AGENTPP at agentpp.org
> > http://lists.agentpp.org/mailman/listinfo/agentpp
> >
> >
>
>
> --
> Best Regards,
> Rajesh Bansal
>
>
>
> ---------- Forwarded message ----------
> From: "Rajesh Bansal" <bansal.rajeshkr at gmail.com>
> To: agentpp at agentpp.org
> Date: Tue, 31 Jul 2007 18:48:07 +0530
> Subject: [AGENT++] Re: AGENTPP Digest, Vol 42, Issue 14
> Dear All,
> segmentation fault is due to problem in request.cpp in function Request*
> RequestList::receive(int sec)
> because there ifdef _SNMPv3 statements are not properly aligned (not
> closed
> if statement properly) at line no 1273.
>
> On 7/30/07, agentpp-request at agentpp.org <agentpp-request at agentpp.org>
> wrote:
> >
> > Send AGENTPP mailing list submissions to
> >         agentpp at agentpp.org
> >
> > To subscribe or unsubscribe via the World Wide Web, visit
> >         http://lists.agentpp.org/mailman/listinfo/agentpp
> > or, via email, send a message with subject or body 'help' to
> >         agentpp-request at agentpp.org
> >
> > You can reach the person managing the list at
> >         agentpp-owner at agentpp.org
> >
> > When replying, please edit your Subject line so it is more specific
> > than "Re: Contents of AGENTPP digest..."
> >
> > Today's Topics:
> >
> >    1. A bug (Rajesh Bansal)
> >
> >
> > ---------- Forwarded message ----------
> > From: "Rajesh Bansal" <bansal.rajeshkr at gmail.com>
> > To: agentpp at agentpp.org
> > Date: Mon, 30 Jul 2007 12:31:35 +0530
> > Subject: [AGENT++] A bug
> > Dear All,
> > I have defined _NO_SNMPv3 in config_snmp_pp.h file and after that i
> > compile
> > snmp++ , agent++ , agentX++ libraries these are compiling right but
> after
> > that when i am tring to use given examples in agent++ and agentX++ all
> are
> > quiting program with segmentation fault. first after defiining
> _NO_SNMPv3
> > all examples are not compiling these are making errors
> >
> > master.o(.text+0x30e): In function `init(Agentpp::Mib&)':
> > /home/jimmy/development/agentX++/examples/master/src/master.cpp:170:
> > undefined reference to
> `Agentpp::snmp_community_mib::snmp_community_mib()'
> > master.o
> >
> (.text+0x455):/home/jimmy/development/agentX++/examples/master/src/master.cpp:175:
> > undefined reference to
> > `Agentpp::notification_log_mib::notification_log_mib()'
> > master.o
> >
> (.text+0x4b2):/home/jimmy/development/agentX++/examples/master/src/master.cpp:177:
> > undefined reference to `Agentpp::UsmUserTable::UsmUserTable()'
> > master.o
> >
> (.text+0xc86):/home/jimmy/development/agentX++/examples/master/src/master.cpp:218:
> > undefined reference to `Agentpp::UsmStats::UsmStats()'
> > master.o
> >
> (.text+0xcfa):/home/jimmy/development/agentX++/examples/master/src/master.cpp:221:
> > undefined reference to
> `Agentpp::usm_mib::usm_mib(Agentpp::UsmUserTable*)'
> > master.o
> >
> (.text+0xd67):/home/jimmy/development/agentX++/examples/master/src/master.cpp:223:
> > undefined reference to `Agentpp::V3SnmpEngine::V3SnmpEngine()'
> > master.o
> >
> (.text+0xdd4):/home/jimmy/development/agentX++/examples/master/src/master.cpp:224:
> > undefined reference to `Agentpp::MPDGroup::MPDGroup()'
> > master.o
> >
> (.text+0xe48):/home/jimmy/development/agentX++/examples/master/src/master.cpp:225:
> > undefined reference to
> > `Agentpp::agentpp_config_mib::agentpp_config_mib(Agentpp::Mib*)'
> > master.o(.text+0xee6): In function `allow_agentx_tcp_from_localhost()':
> > /home/jimmy/development/agentX++/examples/master/src/master.cpp:134:
> > undefined reference to `Agentpp::snmpTargetAddrExtEntry::instance'
> > master.o
> >
> (.text+0x10c4):/home/jimmy/development/agentX++/examples/master/src/master.cpp:142:
> > undefined reference to `Agentpp::snmpTargetAddrExtEntry::instance'
> >
> > and after that if i am commenting all portion of SNMPv3 then it is
> making
> > segmentation faullt
> > --
> > Best Regards,
> > Rajesh Bansal
> >
> >
> > _______________________________________________
> > AGENTPP mailing list
> > AGENTPP at agentpp.org
> > http://lists.agentpp.org/mailman/listinfo/agentpp
> >
> >
>
>
> --
> Best Regards,
> Rajesh Bansal
>
>
>
> ---------- Forwarded message ----------
> From: Jochen Katz <katz at agentpp.com>
> To: agentpp at agentpp.org
> Date: Tue, 31 Jul 2007 22:41:35 +0200
> Subject: Re: [AGENT++] Re: AGENTPP Digest, Vol 42, Issue 14
> Hi,
>
> > agentX++/examples/master/src/master.cpp:177:
> > undefined reference to `Agentpp::UsmUserTable::UsmUserTable()'
> > master.o
>
> this indicates that the master.cpp file was compiled WITH _SNMPv3
> defined. UsmUserTable is not found because agent++ is compiled without
> _SNMPv3 defined. Therefore I recommended to remove *.o and lib* and do a
> rebuild of all parts.
>
> > segmentation fault is due to problem in request.cpp in function Request*
> > RequestList::receive(int sec)
> > because there ifdef _SNMPv3 statements are not properly aligned (not
> closed
> > if statement properly) at line no 1273.
>
> Ok, there are some unnecessary #ifdefs in this function, but for me it
> compiles and I can run the agentX++ master and the agent++ cmd_exe_mib
> agent without problems.
>
> So please do the following:
> - Use the current unmodified snmp++/agent++/agentX++ releases
> - disable SNMPv3 only in config_snmp_pp.h
> - Build the libs and examples
>
> If you then still get segmentation faults, send me a stack trace and a
> description of how you start which agents and what requests you are
> sending to them.
>
> Regards,
>   Jochen
>
>
> _______________________________________________
> AGENTPP mailing list
> AGENTPP at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/agentpp
>
>


-- 
Best Regards,
Rajesh Bansal



More information about the AGENTPP mailing list