[Solved] Debian Linux | "Speicherzugriffsfehler" segmentation fault
|
28-12-2014, 11:27 PM
(This post was last modified: 04-01-2015 10:50 PM by ChriD.)
Post: #1
|
|||
|
|||
[Solved] Debian Linux | "Speicherzugriffsfehler" segmentation fault
Hi,
I've created an application with ohNet. The windows build runs without any error. The Debian Linux build throws a "segmentation fault" error while starting up the ControlPoint Device Error on Code: OpenHome::Net::UpnpLibrary::StartCp(subnet); Any suggestions? Thanks! |
|||
29-12-2014, 09:53 AM
Post: #2
|
|||
|
|||
RE: Debian Linux | "Speicherzugriffsfehler" segmentation fault
The problem is likely to be in code before the line you've highlighted. Can you post a complete and short program that demonstrates this crash please?
|
|||
29-12-2014, 04:46 PM
Post: #3
|
|||
|
|||
RE: Debian Linux | "Speicherzugriffsfehler" segmentation fault
Here is the code.
Is from my "InitUPNP" Method. i hope it doesnt hurt your eyes ![]() Code: OpenHome::Net::InitialisationParams* initParams; |
|||
29-12-2014, 06:49 PM
(This post was last modified: 29-12-2014 06:52 PM by ChriD.)
Post: #4
|
|||
|
|||
RE: Debian Linux | "Speicherzugriffsfehler" segmentation fault
And here the simplest one which has the segment fault...
The "10" on the StartCp is the subnet value. (looked it up in the debugger) To be sure that nothing else causes the Segment fault i used it directly Code: #include <OpenHome/Net/Cpp/OhNet.h> EDIT: Maybe one thing to mention is, that i am working in an OracleVM on Debian Wheezy |
|||
29-12-2014, 09:57 PM
Post: #5
|
|||
|
|||
RE: Debian Linux | "Speicherzugriffsfehler" segmentation fault
Open SUSE throws the same error
![]() |
|||
30-12-2014, 11:28 AM
Post: #6
|
|||
|
|||
RE: Debian Linux | "Speicherzugriffsfehler" segmentation fault
Your code looks fine. The call to StartCp() tries to create a TCP server on the network interface you specify (this'll later receive evented updates from UPnP devices). I wonder whether the problem is that your VM isn't allowing this?
Is there any message printed to console - either "Assertion failed - ..." or "Unhandled exception - ..." just before the segfault? If there is, can you post a complete copy of the message please? If not, can you use gdb to step through the code inside StartCp() until you find the line that fails? |
|||
30-12-2014, 05:15 PM
Post: #7
|
|||
|
|||
RE: Debian Linux | "Speicherzugriffsfehler" segmentation fault
Thank you for your help simonc
There are no any other messages. GDB shows up this: Code: Program received signal SIGSEGV, Segmentaion fault. stepped through Code: OpenHome::Net::UpnpLibrary::startCp (aSubnet=10) at OpenHome/Net/OhNetCp.cpp:16 and in "->NetworkAdapterList()" there is "return *iNetworkAdapterList" and this does the segmentation fault ![]() |
|||
31-12-2014, 12:17 PM
Post: #8
|
|||
|
|||
RE: Debian Linux | "Speicherzugriffsfehler" segmentation fault
The call to OpenHome::Net::UpnpLibrary::Initialise() in your program should have initialised iNetworkAdapterList in gEnv. I don't have easy access to a Linux machine at present but have checked that your code works on Windows. Could you try single stepping into the call to Initialise() to see if that gives any hints about what's going wrong?
|
|||
31-12-2014, 01:47 PM
Post: #9
|
|||
|
|||
RE: Debian Linux | "Speicherzugriffsfehler" segmentation fault
iNetworkAdapterList is initialized at "UPNPLibrary::Initialize()" and seems to be okay!
But in the "NetworkAdapterList" Method, where its going to be returend, its not okay anomre. In UPNPLibrary::StartCp(...) the "gEnv" seems to be wrong/empty (Null pointer) (value=0x0) In Windows Environment its okay. There is a pointer adressed. I use "Nemiver" for gdb debugging. Maybee it shows the wrong values here... I'm not sure.... |
|||
01-01-2015, 05:15 PM
(This post was last modified: 01-01-2015 05:27 PM by ChriD.)
Post: #10
|
|||
|
|||
RE: Debian Linux | "Speicherzugriffsfehler" segmentation fault
Some more stuff...
Hmm.. i use GNU 4.7.2-8 for compiling my application. I think this is ok. There were some bugs in older Versions of GNU Compiler http://stackoverflow.com/questions/20410...d-variable Another thing is the stackSize defined on the Linux System for global variables. Thisd may cause a seg fault too if the size gets to big. But in my Environment its set to 'unlimited', so this cant be the Problem http://stackoverflow.com/questions/11977...-variables |
|||
« Next Oldest | Next Newest »
|