Author |
Message |
Initrd.gz Seasoned Helper
Joined: Sep 18 2008 Posts: 134 Location: Over there ---> Offline
|
Posted: Wed May 06, 2009 8:34 pm Post subject: Lots of segmentation faults? |
|
|
|
|
Hi all.
My ASSS program keeps closing, giving me a "Segmentation fault" message and leaving a file in the root directory. Is there a way to stop them, or at least a script that successfully restarts ASSS like in HS.
If it helps at all, I checked ASSS with Valgrind, and it detected several leaks in the core modules (I remember the config module was one)
|
|
Back to top |
|
|
Dr Brain Flip-flopping like a wind surfer
Age:38 Gender: Joined: Dec 01 2002 Posts: 3502 Location: Hyperspace Offline
|
Posted: Wed May 06, 2009 8:43 pm Post subject: |
|
|
|
|
What's the file look like? If it's a back trace, you can find out why the zone was crashing.
Check out scripts/run-asss
You'll have to edit ASSSHOME to get it to work. After that, just run the script. _________________ Hyperspace Owner
Smong> so long as 99% deaths feel lame it will always be hyperspace to me
|
|
Back to top |
|
|
Initrd.gz Seasoned Helper
Joined: Sep 18 2008 Posts: 134 Location: Over there ---> Offline
|
Posted: Wed May 06, 2009 9:18 pm Post subject: |
|
|
|
|
Dr Brain wrote: | What's the file look like? If it's a back trace, you can find out why the zone was crashing. |
Currently, the backtrace files just say gdb isn't installed. It is now, so the next time it happens, it should do a dump.
Dr Brain wrote: | Check out scripts/run-asss
You'll have to edit ASSSHOME to get it to work. After that, just run the script. | Mmk, thanks. I'll look at that.
|
|
Back to top |
|
|
Dr Brain Flip-flopping like a wind surfer
Age:38 Gender: Joined: Dec 01 2002 Posts: 3502 Location: Hyperspace Offline
|
|
Back to top |
|
|
Initrd.gz Seasoned Helper
Joined: Sep 18 2008 Posts: 134 Location: Over there ---> Offline
|
Posted: Sun May 10, 2009 9:28 pm Post subject: |
|
|
|
|
Here's the backtrace
A Backtrace I got, appended with .txt to get it to upload
segv-25139.bt.txt - 8.59 KB
File downloaded or viewed 45 time(s)
|
|
Back to top |
|
|
Dr Brain Flip-flopping like a wind surfer
Age:38 Gender: Joined: Dec 01 2002 Posts: 3502 Location: Hyperspace Offline
|
|
Back to top |
|
|
Initrd.gz Seasoned Helper
Joined: Sep 18 2008 Posts: 134 Location: Over there ---> Offline
|
Posted: Mon May 11, 2009 5:15 pm Post subject: |
|
|
|
|
I have absolutely no idea. No one goes on my server (or at least they shouldn't be at the moment). There are no recent log messages before the server crashes.
I have played on my server every now and then with another player. We can play for 30 minutes straight, using ?quickfix to mess around with the settings, and even do the speed/thrust glitch that makes you go through walls without problems.
|
|
Back to top |
|
|
D1st0rt Miss Directed Wannabe
Age:36 Gender: Joined: Aug 31 2003 Posts: 2247 Location: Blacksburg, VA Offline
|
|
Back to top |
|
|
Initrd.gz Seasoned Helper
Joined: Sep 18 2008 Posts: 134 Location: Over there ---> Offline
|
Posted: Tue May 26, 2009 6:46 pm Post subject: |
|
|
|
|
Mmk, we were messing around in my zone, and it crashed three times. I think it may be linked to sound macros ("%##"), but I still can't get it to crash consistently.
EDIT: I also use quickfix a bit.
|
|
Back to top |
|
|
Initrd.gz Seasoned Helper
Joined: Sep 18 2008 Posts: 134 Location: Over there ---> Offline
|
Posted: Wed Jun 03, 2009 6:16 pm Post subject: |
|
|
|
|
Looks like the object passed to afree is a string allocated by astrdup. I don't see how it's going wrong.
You think I could rewrite filetrans in python, since string manipulation is easier and there's no allocation/deallocation calls?
|
|
Back to top |
|
|
Goldeye Novice
Gender: Joined: Dec 15 2003 Posts: 57 Offline
|
Posted: Wed Jun 10, 2009 4:04 am Post subject: Re: Lots of segmentation faults? |
|
|
|
|
Initrd.gz wrote: | Hi all.
My ASSS program keeps closing, giving me a "Segmentation fault" message and leaving a file in the root directory. Is there a way to stop them, or at least a script that successfully restarts ASSS like in HS.
If it helps at all, I checked ASSS with Valgrind, and it detected several leaks in the core modules (I remember the config module was one) |
Btw, the file in the root directory is a core file. You can run "gdb -c <core file left behind> <asss bin file>"
|
|
Back to top |
|
|
Initrd.gz Seasoned Helper
Joined: Sep 18 2008 Posts: 134 Location: Over there ---> Offline
|
Posted: Wed Jun 17, 2009 6:17 pm Post subject: |
|
|
|
|
I did a change in filetrans.c so now, instead of juggling string allocations around, it simply has a string array of 256 bytes and uses astrncpy to copy the strings. Hopefully it will work.
|
|
Back to top |
|
|
Initrd.gz Seasoned Helper
Joined: Sep 18 2008 Posts: 134 Location: Over there ---> Offline
|
Posted: Wed Jun 24, 2009 7:33 pm Post subject: |
|
|
|
|
Nope. The random crashes have stopped, but every time someone leaves the zone, the server crashes...
EDIT:
I figured how to use GDB, and at the function cleanup_ud, it says that ud->work_dir, as well as ud->fname are "out of range" pointers.
|
|
Back to top |
|
|
Dr Brain Flip-flopping like a wind surfer
Age:38 Gender: Joined: Dec 01 2002 Posts: 3502 Location: Hyperspace Offline
|
Posted: Thu Jun 25, 2009 7:10 am Post subject: |
|
|
|
|
Try adding a watchpoint on them in GDB. See if something is corrupting them. You may have to unload the deadlock module to prevent things from dying when you're typing in commands in gdb.
|
|
Back to top |
|
|
Initrd.gz Seasoned Helper
Joined: Sep 18 2008 Posts: 134 Location: Over there ---> Offline
|
|
Back to top |
|
|
Dr Brain Flip-flopping like a wind surfer
Age:38 Gender: Joined: Dec 01 2002 Posts: 3502 Location: Hyperspace Offline
|
Posted: Fri Jun 26, 2009 9:29 am Post subject: |
|
|
|
|
It looks like gdb won't watch things that go out of scope. I'm not sure how to get around that. I tried setting a watch on the address on my machine, but that didn't seem to work. Instead it locked up the process.
|
|
Back to top |
|
|
Initrd.gz Seasoned Helper
Joined: Sep 18 2008 Posts: 134 Location: Over there ---> Offline
|
Posted: Fri Jun 26, 2009 2:40 pm Post subject: |
|
|
|
|
yeah I tried that too. I think it converts the hex adderss into an integer and tries to watch that. I'll see if I can compile gdb manually and look for a configuration option.
|
|
Back to top |
|
|
Dr Brain Flip-flopping like a wind surfer
Age:38 Gender: Joined: Dec 01 2002 Posts: 3502 Location: Hyperspace Offline
|
Posted: Fri Jun 26, 2009 3:09 pm Post subject: |
|
|
|
|
Well, a decimal integer and a hex integer are still the same address.
|
|
Back to top |
|
|
Initrd.gz Seasoned Helper
Joined: Sep 18 2008 Posts: 134 Location: Over there ---> Offline
|
Posted: Fri Jun 26, 2009 9:34 pm Post subject: |
|
|
|
|
I read a document, saying that Valgrind can detect this sort of stuff.
I did a test. I ran:
Quote: | valgrind --trace-children=yes --tool=memcheck --leak-check=yes --track-origins=yes --log-file=valgrind.log bin/asss |
Complete log file is attached. The interesting part is at around line 461:
Quote: | ==8341== Invalid free() / delete / delete[]
==8341== at 0x4025E5A: free (vg_replace_malloc.c:323)
==8341== by 0x804F0F9: afree (util.c:136)
==8341== by 0x80952DE: paction (filetrans.c:303)
==8341== by 0x8057F50: process_player_states (core.c:435)
==8341== by 0x805A0DF: RunLoop (mainloop.c:63)
==8341== by 0x804CF9B: main (main.c:293)
==8341== Address 0x384c0077 is 1158375 bytes inside data symbol "temporary"
|
Perhaps the data has already been free'd? From what I can tell, the module null's all the pointers, and I have FREE_DOESNT_CHECK_NULL defined, so afree doesn't free null pointers.
PS. for 1.5.0, looks like afree only checks the pointer if FREE_DOESNT_CHECK_NULL is defined. It should be #ifndef or FREE_CHECKS_NULL.
|
|
Back to top |
|
|
Initrd.gz Seasoned Helper
Joined: Sep 18 2008 Posts: 134 Location: Over there ---> Offline
|
Posted: Tue Jul 28, 2009 5:17 pm Post subject: |
|
|
|
|
Amazing. Redownload it and everything works...
|
|
Back to top |
|
|
Dr Brain Flip-flopping like a wind surfer
Age:38 Gender: Joined: Dec 01 2002 Posts: 3502 Location: Hyperspace Offline
|
Posted: Tue Jul 28, 2009 10:26 pm Post subject: |
|
|
|
|
At least it works now, even if we never will know what was wrong.
|
|
Back to top |
|
|
|