18 Feb, 2014, Davenge wrote in the 21st comment:
Votes: 0
alteraeon said:
Tyche said:
Davenge said:
These are valid points. If it is unsafe, its unsafe. That's what I wanted to know.

This wasn't some goal to never have to fix what was crashing the mud… just curious if it was a safe way to "gracefully shut down"(as I've seen it called) and maybe cut down on the frequency of I/O calls in my code.

Based on my experience, and hundreds of "help my mud is crashing posts" I've read, the vast majority of SIGSEGVs are caused by string buffer overruns.
So I would highly recommend using Safe String library.

Is that really that big of a problem? I literally cannot remember the last time I had a string buffer related crash, and I've never used a string safe library, just ordinary string handling functions and an overrun-proof buffer class. It's got to be on the order of at least five years or more.

Regarding the guy who saves files from the signal handler: beware. fopen/fwrite are not signal safe.

-dentin

Alter Aeon MUD
http://www.alteraeon.com


I think if you are using snprintf in some fashion, it's pretty hard to overrun your string buffers.
18 Feb, 2014, Tyche wrote in the 22nd comment:
Votes: 0
alteraeon said:
Is that really that big of a problem? I literally cannot remember the last time I had a string buffer related crash, and I've never used a string safe library, just ordinary string handling functions and an overrun-proof buffer class. It's got to be on the order of at least five years or more.

In C++? No I wouldn't bother with a safe string library in C++ either.
20.0/22