On Wed, Dec 22, 2010 at 10:22 AM, Mishustin Kirill
<[email protected]>wrote:
> 22.12.2010 15:02, Bart Van Assche wrote:
>
>> Hi Kirill,
>>
>> Sorry, but that still doesn't prove that the cause is in the Net-SNMP
>> source code. As an example, adding threads without using proper
>> synchronization constructs may introduce race conditions that do no harm
>> with one version of the Net-SNMP source code but are harmless with
>> another version. Have you already analyzed your code with a data race
>> detector ?
>>
>> Another potential booby trap when working with threads are POSIX
>> signals. Unless signals are blocked before any threads are created and
>> unblocked by the thread that will handle them, signals can be delivered
>> to any thread. That's another potential source of race conditions. For
>> more information, see also
>> http://pubs.opengroup.org/onlinepubs/009695399/functions/sigprocmask.html
>> .
>>
>> Bart.
>>
>
> I wrote special test mib-module that starts thread like this:
>
> void test_thread_function(void)
> {
> while(1)
> {
> struct timeval timeout;
> timeout.tv_sec = 1;
> timeout.tv_usec = 0;
> select(0, NULL, NULL, NULL, &timeout);
> log_add(LOG_INFO, "I am still alive\n");
> }
> }
>
> Works ok in 5.4.2.1 and does not work in 5.5.
> log_add function just writes string to the file and it is not used anywhere
> else. I can't see any possibilities for race conditions here.
>
> And thanks for info on signals, I'll check it.
>
Hello Kirill,
That's interesting. Can you please run the entire snmpd (open source code +
your MIB) through Valgrind (first through memcheck, next through Helgrind
and/or DRD) ? The output of these tools should allow to find out what is
causing threads to stop unexpectedly.
Bart.
------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months. Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users