Author Topic: Segmentation fault - what iis a Segmentation fault?  (Read 2302 times)

Cejo

  • Wayfarer
  • *
  • Posts: 6
    • View Profile
Segmentation fault - what iis a Segmentation fault?
« 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



« Last Edit: December 30, 2003, 08:08:40 pm by Cejo »

Grakrim

  • Hydlaa Citizen
  • *
  • Posts: 468
    • View Profile
(No subject)
« Reply #1 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*.
\" I think you should just follow Grakrim\'s advice ;)\"

\"A universe is enough for more than one opinion.\" - Maxximus

Cejo

  • Wayfarer
  • *
  • Posts: 6
    • View Profile
(No subject)
« Reply #2 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.
« Last Edit: December 30, 2003, 08:30:08 pm by Cejo »

Cejo

  • Wayfarer
  • *
  • Posts: 6
    • View Profile
(No subject)
« Reply #3 on: December 30, 2003, 08:36:28 pm »
no ideas?

Cejo

  • Wayfarer
  • *
  • Posts: 6
    • View Profile
(No subject)
« Reply #4 on: December 30, 2003, 09:23:37 pm »
it\'s the same ..................every time.
Please try to help me.

Uyaem

  • Hydlaa Notable
  • *
  • Posts: 747
    • View Profile
(No subject)
« Reply #5 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...
The internet is "the terrorists'" most important weapon, they say.
Wrong.
Fear is their most important weapon.
Ours is our freedom.

Rulzern

  • Hydlaa Resident
  • *
  • Posts: 134
    • View Profile
(No subject)
« Reply #6 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
« Last Edit: December 31, 2003, 04:00:58 am by Rulzern »
Thanks a lot Venge...

Cejo

  • Wayfarer
  • *
  • Posts: 6
    • View Profile
(No subject)
« Reply #7 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?

Rulzern

  • Hydlaa Resident
  • *
  • Posts: 134
    • View Profile
(No subject)
« Reply #8 on: December 31, 2003, 03:57:25 pm »
try compiling from source
Thanks a lot Venge...

Axsyrus

  • Veteran
  • *
  • Posts: 1119
    • View Profile
(No subject)
« Reply #9 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/

Axsyrus the Azure - Ruler of the Winds
Member of The Arcane Order\'s Council

tangerine

  • Hydlaa Resident
  • *
  • Posts: 192
    • View Profile
(No subject)
« Reply #10 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.
« Last Edit: December 31, 2003, 05:02:14 pm by tangerine »

Uyaem

  • Hydlaa Notable
  • *
  • Posts: 747
    • View Profile
(No subject)
« Reply #11 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...
The internet is "the terrorists'" most important weapon, they say.
Wrong.
Fear is their most important weapon.
Ours is our freedom.

alveraan

  • Wayfarer
  • *
  • Posts: 2
    • View Profile
(No subject)
« Reply #12 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.
« Last Edit: May 31, 2004, 11:57:28 am by alveraan »

Androgos

  • Guest
(No subject)
« Reply #13 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 :(

dfryer

  • Veteran
  • *
  • Posts: 1070
    • View Profile
(No subject)
« Reply #14 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.
Quidquid latine dictum sit, altum sonatur.