Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Thread: Tracking segfaults

  1. #1

    Tracking segfaults

    While fighting with chunk rendering, I've encountered problem which is segfault. Problem is that debugger points me to fpc_popaddrstack symbol, which is too vague to be of any use. How can I track it more precisely (note that I know most likely culprit, but those are three function chained from one and I need to know where it really occurs).

    //edit: It seems to be worse than I thought, it seems to be multiple segfaults from different sources - after I seem to fix one, another pops up, but with same symbol.

    If anyone is willing to help me debugging it, I can send compressed project folder. Dunno if I can debug it on my own.
    Last edited by Darkhog; 24-06-2013 at 01:57 AM.

  2. #2
    you've checked the 'call stack' window? it helps tracking crash history

  3. #3
    Yeah, it looks like this:

    #0 fpc_popaddrstack at :0
    #1 ?? at :0
    #2 TSPRITE__CREATE(0x1848720, 0x1846a58, 0x42a428, <error reading variable>) at sprites.pas:39
    #3 TTILESET__GETTILESPRITE(4, <error reading variable>) at tilesets.pas:65
    #4 TCHUNK__GETTERRAINSPRITE(0x158d170, <error reading variable>) at chunkutils.pas:264
    #5 TCHUNK__DRAW(0x1846d20, 0, 64, 0x158d170, 4, true, <error reading variable>) at chunkutils.pas:177
    #6 DRAW at alletest.lpr:37
    #7 main at alletest.lpr:158

    But dunno how to interpret this.

  4. #4
    Quote Originally Posted by Darkhog View Post
    If anyone is willing to help me debugging it, I can send compressed project folder. Dunno if I can debug it on my own.
    I could give debugging it a try if you want...I have Lazarus 1.0 installed on my windows 8 laptop here - just PM me

  5. #5
    OK. Do you have allegro.pas installed as well? You'll need it to compile this (and possibly you'll have to adjust directories in project options).

  6. #6
    I have now installed allegro.pas and gotten it to compile. It crashes after generating a few new chunks.

  7. #7
    Quote Originally Posted by Darkhog View Post
    Yeah, it looks like this:

    #0 fpc_popaddrstack at :0
    #1 ?? at :0
    #2 TSPRITE__CREATE(0x1848720, 0x1846a58, 0x42a428, <error reading variable>) at sprites.pas:39
    #3 TTILESET__GETTILESPRITE(4, <error reading variable>) at tilesets.pas:65
    #4 TCHUNK__GETTERRAINSPRITE(0x158d170, <error reading variable>) at chunkutils.pas:264
    #5 TCHUNK__DRAW(0x1846d20, 0, 64, 0x158d170, 4, true, <error reading variable>) at chunkutils.pas:177
    #6 DRAW at alletest.lpr:37
    #7 main at alletest.lpr:158

    But dunno how to interpret this.
    those are procedures/functions that were called prior to crash.
    on top is most recent one and going down you can track what have led there. btw why you create sprite after chunk.draw? shouldn't it be done in some init part?

  8. #8
    Sprite is created IN Tchunk.draw. This is because how they are handled in game - they are created as necessary and destroyed when no longer needed. Because of that memory used by game is about 30... MB and it should in theory run even on old 128mb machines.

  9. #9
    well ok i guess as long as you are not loading resources there. anyways looks like problem lies around* tsprite.create
    Last edited by laggyluk; 24-06-2013 at 12:04 PM.

  10. #10
    I can send you sources, if you want to look into it.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •