Deleting table rows
Alex Finogenov
afinogenov____malibunet.com
Sun Jul 15 19:45:03 CEST 2001
Frank,
Thanks again for your reply.
My greatest problem now is that the agent dies with a Segmentation fault
even when I add and delete rows using AdventNet's Mib browser to a compiled
agent with *no* additions to the generated code. Simply after a few random
operations, but primarily on GetNexts. The agent.cpp is taken from your
examples (like DynamicTable, etc.), I just added my object groups to the
mib. Unfortunately I don't have Purify or any other memory analyzer
available to me at the moment.
I ported agent++/snmp++ to x86 Solaris (SunOs 5.8 Generic_108529-07 i86pc,
latest patches as of May 2001) compiling with g++/gcc 2.8.1. Agent++/snmp++
were compiled to exclude multithreading and SNMPv3, i.e. I have simplest
possible agent configuration for SNMPv2.
Regarding cleaning up when preloading table before each request using
overloaded MibTable::update(), I intend to delete all of the rows in a table
entry right in the update() immediately before processing a new request and
populating a table entry for it. This will clean up all the rows left since
the previous request. I intend to do this by calling either
MibTable::clean(), or cleanAll() on all of the 3 collections of rows
(deleted, not active, and content) in the MibTable.
I will appreciate any help regarding these issues.
Sincerely,
Alex
-----Original Message-----
From: Frank.Fock____t-online.de [mailto:Frank.Fock____t-online.de]
Sent: Saturday, July 14, 2001 3:54 PM
To: Alex Finogenov
Cc: Agent++ (E-mail)
Subject: Re: Deleting table rows
Hi Alex,
When do you delete your rows? This could be very important ;-)
Regards,
Frank
Alex Finogenov wrote:
> Hi,
>
> I am trying a different approach to the stateless agent problem.
>
> In the generated code I overloaded update(Request *) method for table
> entries. In this method, for each oid that arrives in a request I retrieve
> an object from my database (if it exists there, of course), populate a
row,
> and add the row to the entry's table. If the oid does not have an index, I
> add the first index that is valid for this table in the application at the
> time of the request.
>
> The problem is that agent++ keeps corrupting its stack after a couple of
> GetNexts on the table entry's OID (no indexes; with indexes it seems to
> work fine):
>
> ...
> 20010714.14:50:40: 09723: (3)EVENT : RequestList: finished subrequest
> (ind)(oid)(val): (0), (1.3.6.1.4.1.5275.6.2.1.2.4.1.1.139), (139).
> 20010714.14:50:40: 09723: (4)EVENT : RequestList: request answered
> (rid)(tid)(to)(err)(send)(sz): (140), (1), (172.16.1.127/1075), (0), (0),
> (1).
> 20010714.14:50:40: 09723: (2)EVENT : Agent: finished thread execution.
>
> Segmentation fault, aborting.
> $
>
> It dies in the main loop apparently cleaning up the response after sending
a
> correct reply.
>
> Does anybody have any idea what is the problem: I am not doing anything
> fancy in the update(), just generate unique rows and add them to the
tables?
>
> Thanks,
> Alex
More information about the AGENTPP
mailing list