How can I deal with Segmentation fault - sigsegv ?

Frank Fock Frank.Fock____t-online.de
Wed Feb 27 23:57:26 CET 2002


Hi,

The segmentation fault is most likely a programmin error. Run the program in
a debugger and find out the cause.(May be it's dereferencing a null pointer?).

signal() is a system function to register a function to be called when certain
events (signals) occur.

Best regards,
Frank

Kjersti Grønnevik wrote:

> Hi,
>
> I'm running KDevelop with the latest agent++/snmp++.
> I am testing with the static_table example, have deleted all Snmpv3 related code and chanced the port to 4700
> In the init_signals() function I have added the line:
> mib.add(new myMib());
> and /* */ every thing else in the function
> myMib.cpp and myMib.h are added to the project (created by the agentGen.sta..)
>
> When I run the agent all I get is this:
> ---------------------------------------------------------------------------------------------------------
> 20020227 .10:41:47: 7040: (1)EVENT      : main: SNMP listen port: (4700)
> 20020227 .10:41:47: 7040: (3)DEBUG      : MibContext: adding MIB object (context)(oid): (), (1)
>
> Segmentation fault, aborting.
>
> Press Enter to continue!
> ---------------------------------------------------------------------------------------------------------
> Should there be something in the context parenteses?
> I have debuged the code and:
> //20020227 .10:41:47: 7040: (3)DEBUG    : MibContext: adding MIB object (context)(oid): (), (1)
> comes after the function  myMib::myMib() : MibGroup("1", "MYMIB-MIB") is finished
>
> Exactly where the the variable signo in main are set I can not see.
>
> Where are the function signal(SIGTERM, sig); (and the two next functionscals)  definition hidden?
> I can't seem to find it?
>
> I have tried  -Igcc_r   , but it didn't chance anything....
>
> Thanks for any help or idees in advance!!
>
> Regards,
> Kjersti







More information about the AGENTPP mailing list