PlaneShift

Support => Technical Help: Problems BEFORE entering the game => Topic started by: Cejo on December 30, 2003, 08:03:35 pm

Title: Segmentation fault - what iis a Segmentation fault?
Post by: Cejo on December 30, 2003, 08:03:35 pm
Hello,
this is my first post here.

A question.
(I\'m using the Linux-version under Mandrake-Linux)

I\'m not a nativ speaker - what is a Segmentation fault?
The Game always crush when while it is loading the world.

The console said this:


Code: [Select]
(...) cel.persist.classic: Adding PC \'pccharacterdata\' to Entity \'Cejo\'
cel.persist.classic: Adding PC \'pcproximitylist\' to Entity \'Cejo\'
cel.persist.classic: Adding PC \'pcinventory\' to Entity \'actorlist\'
HandleMessage: Received Player list!

crystalspace.engine.warning: Couldn\'t load cached lighting for 2849 object(s):
crystalspace.engine.warning:     _s_walkway_017
crystalspace.engine.warning:     _s_walkway_01
crystalspace.engine.warning:     _s_floor
crystalspace.engine.warning:     _s_street_NEW_02
crystalspace.engine.warning:     ...
crystalspace.engine.warning: Use -relight cmd option to refresh lighting.
The time is now -23 o\'clock.
Sector crossed.
ReadKeyBindings: Loading Key Bindings...
First Person Mode
GetCameraFirstPos: race (0.00, 1.63, 0.00)
        loading definitions file /planeshift/gui/player.def...
        load successful (1 windows, 0 skins loaded.)
        loading definitions file /planeshift/gui/interact.def...
        load successful (1 windows, 0 skins loaded.)
planeshift.application.client: PSLoader: step 4: success
        loading definitions file /planeshift/gui/comm.def...
        load successful (1 windows, 0 skins loaded.)
        loading definitions file /planeshift/gui/status.def...
        load successful (1 windows, 0 skins loaded.)
        loading definitions file /planeshift/gui/inventory.def...
        load successful (1 windows, 0 skins loaded.)
crystalspace.engine.warning: Lightmaps are not up to date (no \'lm_precalc_info\' found in cache).
crystalspace.engine.warning: Use -relight cmd option to calc lighting.
crystalspace.engine.warning: Couldn\'t load cached lighting for 1 object(s):
crystalspace.engine.warning:     stagewalls
crystalspace.engine.warning: Use -relight cmd option to refresh lighting.
CreateStage: Paper doll Room created
        loading definitions file /planeshift/gui/itemdescription.def...
        load successful (1 windows, 0 skins loaded.)
Segmentation fault



Title:
Post by: Grakrim on December 30, 2003, 08:11:48 pm
Without geting too technical, it just means that the program accessed memory that its not supposed to access.  Nothing serious, you just need to restart the game it should work fine.

Looks like someone has been doing some pointer magic *cough*.
Title:
Post by: Cejo on December 30, 2003, 08:15:36 pm
i tried it more then once.

it is always the same.


Edit: it crushed while this loading-screen.

It said:

Initilazing ...bla bla

this happens fast. but it always crush at the\"initialzing world\" sentence.
Title:
Post by: Cejo on December 30, 2003, 08:36:28 pm
no ideas?
Title:
Post by: Cejo on December 30, 2003, 09:23:37 pm
it\'s the same ..................every time.
Please try to help me.
Title:
Post by: Uyaem on December 31, 2003, 12:52:38 am
trying to explain \"segmentation fault\".
Imagine you run a couple of programs that (cumulatively) use more RAM than you actually have. Every modern operating system \"swaps\" used memory that is not currently accessed by any of the programs onto your hard drive (as linux user probably to your SWAP partition (if you have any)). Suddenly a program needs to use information that was loaded into RAM, but was swapped to hard drive by your operating system. If your RAM is still full, the OS must swap some other stuff on the hard drive and load the needed parts back in again. The program requiring the information is not supposed to know about any of these operations.

Imagine the OS messes up, loading the wrong information into RAM. When the program tries to access it... BAM! The OS should notice that the access is \"out of bounds\" and terminate it with an error message. If you have been using Win95 or Win98 and complaining about bluescreens a lot: This is the most probable cause for them. (On the one hand it\'s good that the OS notices accesses to RAM that should not be allowed, on the other hand it\'s the OS\'s fault :]).

Bottom line: I don\'t think the problem roots in the code of planeshift, but rather in your linux distri...
Title:
Post by: Rulzern on December 31, 2003, 03:58:17 am
a segfault is the error that occurs when a program tries to access memory that isn\'t allocated to it, the most common reason for it is coding error.

EDIT:
Quote
Segmentation fault (segfault)

    A program crash. More precisely, this is what happens when a program tries to access resources which do not belong to it; in such a case, for security reasons the operating system immediately kills the offending program. Segfaults are almost always caused by bugs in the program.


From the Gnome user guide
Title:
Post by: Cejo on December 31, 2003, 01:12:53 pm
i was reinstaling the game, but it is the same.

Reinstaling does\'nt help. What can i do now?
Title:
Post by: Rulzern on December 31, 2003, 03:57:25 pm
try compiling from source
Title:
Post by: Axsyrus on December 31, 2003, 04:53:19 pm
The compiled binaries give a lot of problems on linux, building it from source will probably be much better.

How to build PS instructions: http://icarus.uic.edu/~ssenne1/
Title:
Post by: tangerine on December 31, 2003, 04:55:14 pm
Quote
Originally posted by Pogopuschel
trying to explain \"segmentation fault\".
Imagine you run a couple of programs that (cumulatively) use more RAM than you actually have. Every modern operating system \"swaps\" used memory that is not currently accessed by any of the programs onto your hard drive (as linux user probably to your SWAP partition (if you have any)). Suddenly a program needs to use information that was loaded into RAM, but was swapped to hard drive by your operating system. If your RAM is still full, the OS must swap some other stuff on the hard drive and load the needed parts back in again. The program requiring the information is not supposed to know about any of these operations.

Imagine the OS messes up, loading the wrong information into RAM. When the program tries to access it... BAM! The OS should notice that the access is \"out of bounds\" and terminate it with an error message. If you have been using Win95 or Win98 and complaining about bluescreens a lot: This is the most probable cause for them. (On the one hand it\'s good that the OS notices accesses to RAM that should not be allowed, on the other hand it\'s the OS\'s fault :]).

Bottom line: I don\'t think the problem roots in the code of planeshift, but rather in your linux distri...


Ummmm .... not. It\'s very very very much unlikely that the OS screwed something up. PS or CS did. Segmentation fault happens when accessing part of virtual memory space that is not mapped to real physical memory. Most probably accesing NULL pointers or pointers that point to already deleted objects or similar type of screw ups.

Cejo, I have no idea where the problem is from your listing. If you don\'t succeed, wait for new version of PS that should come out in month or two. All devs are focused on this new version now and no bugs in the old are fixed.
Title:
Post by: Uyaem on January 01, 2004, 05:38:18 pm
alright, I\'ve been mostly programming with languages like Java/C# where there are no pointers and you cannot make such a mistake. ;)
So for me it\'s always the VM or the OS messing up memory pages, not myself *g*.

What do we learn from my previous reply? Don\'t drink and post...
Title:
Post by: alveraan on May 31, 2004, 11:51:56 am
I can confirm this. I get almost exaclty the same terminal output when loading the initial world.

Hope this will be fixed with the next version since I am eager to try out planeshift.

AMD Athlon XP 2700+, GeForce 4200 Ti, 1 Gig of Ram, SB Audigy, Mandrake 10 Official with Gnome 1.4. I compiled crystal source, cel and planeshift from cvs.
Title:
Post by: Androgos on May 31, 2004, 12:14:10 pm
Quote
Originally posted by Pogopuschel
alright, I\'ve been mostly programming with languages like Java/C# where there are no pointers and you cannot make such a mistake. ;)
So for me it\'s always the VM or the OS messing up memory pages, not myself *g*.

What do we learn from my previous reply? Don\'t drink and post...


No pointers? Hmm, what\'s the equal?

I love pointers :(
Title:
Post by: dfryer on May 31, 2004, 09:11:42 pm
The equivalent of a segfault in Java is accessing an object that hasn\'t been constructed yet, I think (an uninitialized object).

Causes of segfaults in C++ are uninitialized objects, accessing objects that were deleted accidentally, and doing bad pointer or array math (off by one errors especially)

I\'ve never heard of an operating system that got confused and swapped in the wrong pages- not even Windows.  Segfaults are due to attempting access to pages which are not part of your address space, whether they\'re swapped in or not.
Title:
Post by: Seytra on May 31, 2004, 11:46:30 pm
If you\'re lucky, using a wild pointer gives you a plain segfault, if it actually goes out of your program\'s memory space.
If you\'re not, it\'ll stay inside and not do anything noticable at all, at least not immediately. Slow data corruption and / or strange behaviour / intermittant errors after changing totally unrelated things, maybe weeks later, cause much more of a headache... ;)

@ Androgos: I also love pointers. :)
Title:
Post by: Uyaem on June 01, 2004, 08:32:21 am
Quote
Originally posted by Androgos
Quote
Originally posted by Pogopuschel
alright, I\'ve been mostly programming with languages like Java/C# where there are no pointers and you cannot make such a mistake. ;)
So for me it\'s always the VM or the OS messing up memory pages, not myself *g*.

What do we learn from my previous reply? Don\'t drink and post...


No pointers? Hmm, what\'s the equal?


Nothing. Address handling there is done by the language itself. E.g. whenever you pass an object to a method it is not duplicated in memory, but instead it\'s offset address is used, so you can modify the object directly (No dereferencing chains of *).
Title:
Post by: dfryer on June 01, 2004, 07:23:16 pm
You really do have pointers in Java, but with all the sharp pointy edges sanded down :) You can\'t treat them as numbers and do math on them, or pass by reference,  and garbage collection is automatic (no more segfaults due to allocation/deallocation problems).  

The only thing that bugs me is the lack of pass-by-reference, but in some cases it enforces cleaner design.