[AGENT++] help: problem about snmpV3 in hp-ux 11i

Zheng Niejun steed at huawei.com
Thu Oct 13 02:38:16 CEST 2005


Hi,
    Thank you for your idea.
    I'm sorry that I cannot solve the problem yet. I hava to evade the problem in my code by moving the snmp loop to main thread. Now the code can run but it is ugly.
    Thank you so much for your time.
    Best regards. 
    steed.    
----- Original Message ----- 
From: "Frank Fock" <fock at agentpp.com>
To: "Zheng Niejun" <steed at huawei.com>
Cc: <agentpp at agentpp.org>
Sent: Tuesday, October 11, 2005 5:10 AM
Subject: Re: [AGENT++] help: problem about snmpV3 in hp-ux 11i


> Hi,
> 
> It seems that your thread is running just before SNMPv3 is fully
> initialized. This may work on different platforms by chance, because
> the dispatcher works differently. On HPUX11 new threads start to
> run before the calling thread continues. Keep this in mind when you
> change the example code.
> 
> Hope this helps.
> 
> Best regards,
> Frank
> 
> Zheng Niejun wrote:
> 
> >Hi,
> >    Thank you for you precious advice.
> >    I try it, but I'm sorry I find nothing.
> >    In fact, when I move the follow loop to main thread, everything is good. The program can receive SNMPv1 & SNMPv3 get request. But when I move the loop to a new thread which created by pthread_create call,  the program is ok when it receives SNMPv1 get request. But to my surprise, it will CORE down when it recievies SNMPv3 get request.
> >    while (run) {  
> >          req = reqList->receive(2);
> >          if (req) {
> >              mib->process_request(req);
> >          }
> >          else {
> >              mib->cleanup();
> >          }
> >    }
> >
> >    Could you give me more advice?
> >    Regards,
> >        Zheng Niejun
> >
> >
> >From: Jochen Katz <katz at agentpp.com>
> >Subject: Re: [AGENT++] help: problem about snmpV3 in hp-ux 11i
> >To: agentpp at agentpp.org
> >Message-ID: <4347D23B.2080502 at 2004.joka.homelinux.org>
> >Content-Type: text/plain; charset=us-ascii
> >
> >Hi,
> >
> >  
> >
> >>I just want to know if anyone tests SNMPv3 with pthread in HP-UX 11i. I use aCC compiler
> >>with compile options "-AA +DAportable -D_REENTRANT -D_RWSTD_MULTI_THREAD".
> >>Maybe something wrong with compile options or link options? but it's OK when receiving SNMPv1 request.
> >>    
> >>
> >
> >  
> >
> >>>>Program received signal SIGBUS, Bus error.
> >>>>0xaa7e0 in USM::build_sec_params (this=0x40031770, outBuf=0x7a20642c "",
> >>>>        
> >>>>
> >
> >  
> >
> >>>>2213      unsigned char *bufPtr = (unsigned char*)&buf;
> >>>>        
> >>>>
> >
> >these are the lines of code (which are only executed for v3 requests):
> >
> >  unsigned char buf[MAXLENGTH_BUFFER];
> >  unsigned char *bufPtr = (unsigned char*)&buf;
> >
> >Should this cause any alignment issues (searching for "hp-ux sigbus"
> >finds such hints)?
> >
> >Regards,
> >  Jochen
> >
> >  
> >
> >>Hi all,
> >>    I compile snmp++ 3.2.16 & agent++ 3.5.22c with macro '_NO_THREADS' in hp-ux 11i.
> >>i try to run an example of agent++. It seems OK. I then modify the example by adding 
> >>a thread and make it receive snmp request in the thread, and run again. When it 
> >>receives snmpV1 request, it is OK. But when it reveives snmpV3 request, it core down!
> >>    
> >>    I debug it. The detail is as follow:
> >>Program received signal SIGBUS, Bus error.
> >>0xaa7e0 in USM::build_sec_params (this=0x40031770, outBuf=0x7a20642c "",
> >>    maxLength=0x7a207438, sp={
> >>      msgAuthoritativeEngineID = "\200\000\023p\005socagent\006M\000\000\000\000\004\000\000\000\017\000\000\0000z Bt", msgAuthoritativeEngineIDLength = 15,
> >>      msgAuthoritativeEngineBoots = 0, msgAuthoritativeEngineTime = 0,
> >>      msgUserName = "\000\t\262#\000\t\261\353", '\000' <repeats 16 times>, "z \021@\000\000\000", msgUserNameLength = 0, msgAuthenticationParameters = 0x0,
> >>      msgAuthenticationParametersLength = 0, msgPrivacyParameters = 0x0,
> >>      msgPrivacyParametersLength = 0}, position=0x7a2052e0) at usm_v3.cpp:2213
> >>2213      unsigned char *bufPtr = (unsigned char*)&buf;
> >>     
> >>    Thank you so much for your time.
> >>    Best regards. 
> >>        steed.
> >>_______________________________________________
> >>    
> >>
> >_______________________________________________
> >AGENTPP mailing list
> >AGENTPP at agentpp.org
> >http://lists.agentpp.org/mailman/listinfo/agentpp
> >
> >
> >  
> >
> 
> 
> -- 
> AGENT++
> http://www.agentpp.com
> http://www.mibexplorer.com
> http://www.mibdesigner.com
> 
> 



More information about the AGENTPP mailing list