"yi*****@gmail.com" <yi*****@gmail.comwrote in
news:11**********************@k79g2000hse.googlegr oups.com:
Hi,
i get this segmentation fault in my c++ program:
My question is 'it shows inMethodStr is not null, how come this can
have *inMethodStr.Ptr segmentation fault?
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1229927536 (LWP 16203)]
0x0806a1ee in RTSPProtocol::GetMethod (inMethodStr=@0xb6b0b6b0)
at Protocol.cpp:58
58 switch(*inMethodStr.Ptr)
Thank you for any help.
How would we know? We can't see the rest of the code. Please post a
minimal, compilable example that shows the problem.
Offhand the address of inMethodStr is suspicious because it has a repeating
pattern (0xb6b0b6b0). This may suggest that you are using and/or passing
an uninitialized variable into GetMethod. Then you use the . operator on
that object, and Undefined Behaviour occurs (effectively dereferencing a
pointer to who-knows-where).