Hello everyone. I my name is Wojtek and I am new to the list. I would
like to get your opinion on the problem that has been troubling me
lately.

I put together my own table closely following this example:
http://net-snmp.sourceforge.net/dev/agent/data__set_8c-example.html

The main difference between the tables in the example and mine is that
mine has around 23 columns. 

The "large" number of columns makes my agent crash on set requests. I
suspect that this is due to a bug that reveals itself when operating on
larger tables (with larger number of columns that is, and not
necessarily many rows).

Initially the agent would crash randomly, but I was able to get a crash
on demand. I would issue set requests to two rows in a table in one
snmpset, twice. That is, I would do

snmpset table.row1 = v1 table.row1 = v2 ... table.row1 = v23 \
        table.row2 = w1 table.row2 = w2 ... table.row2 = w23

snmpset table.row1 = v1 table.row1 = v2 ... table.row1 = v23 \
        table.row2 = w1 table.row2 = w2 ... table.row2 = w23

The second call would crash the agent.

(I tried to reproduce this on the table from the tutorial, but it seems
to be too small; I was able to reproduce this on slightly larger tables
with a more than 2 calls to snmpset)

I started looking at the code of the helper handler and determined that
the agent crashes at the very end of the set request, particularly on
the STATE_COMMIT, when it executes (table_dataset.c:588)

        data =
            netsnmp_table_data_set_find_column(data,
table_info->colnum);

The "data" structure is corrupted, and since this is obtained from the
"row" structure that would mean that "row" is corrupted. The interesting
part is that whatever is computed in table_dataset.c:588 is never used
on STATE_COMMIT, so skipping that line on this particular state seems to
resolve the issue.

However, I would like to get a deeper understanding of what really is
going on, to make sure the change really fixes a bug, instead of hiding
it deeper.

So the question is: in the context of STATE_COMMIT what is the meaning
of "row" variable? Why would we need to execute
netsnmp_table_data_set_find_column on COMMIT? Wouldn't we want to
operate on newrow, instead of row, just like in modes SET_RESERVE1 and
SET_RESERVE2 (see table_dataset.c:557) (I am just guessing here)? Why is
the "row" structure corrupted? 

Thanks for any clues. Hopefully this discussion will let me gain
understanding of the code and help you improve the software.

Wojtek

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to