22 Jan, 2008, Nash wrote in the 1st comment:
Votes: 0
How exactly is the mud configured to drop a core, especially all the time, regardless of whether I'm logged into shell or not?
22 Jan, 2008, Omega wrote in the 2nd comment:
Votes: 0
you need to update your makefile.

This is my way bloated makefile…

DEP	= makedepend
INSTALL = /usr/bin/install -c

#Are we the coding port
SSTM_CODERPORT = 0
USE_SIGNALS = 0

D_FLAGS = -DSANDSTORM -DUSE_ASPELL -DWEBSTER -DWEBPLAY -Duse_gzip #-USE_ABERCHAT -DCONNECT_DEBUG -DUPDATE_DEBUG -DFIRST_BOOT -Dcygwin
D_FLAGS := $(D_FLAGS) -DIMCROM -DIMC #-DMUDSSL -DUSE_SIGNALS -DDEBUGGING_EVENTS -DDEBUG_AFFECTS

ifdef SSTM_CODERPORT
D_FLAGS := $(D_FLAGS) -DSSTM_CODERPORT
endif

CC = g++
PROF = -g3
OPTIMIZE = -Os
CORE = -ggdb3
NOCRYPT =
PACKAGE = Sandstorm: Mages Sanctuary

ifdef SSTM_CODERPORT

DEPS_FLAG = -MMD
MACHINE = #-march=athlon-xp

else

DEPS_FLAG =
MACHINE = #-march=athlon-xp

endif


WARN = -Wall #-Wformat-security -Wredundant-decls #-Winline -fno-inline -Wno-error
ERRORBOY = -Wno-sign-compare #-Werror -Wshadow -Wpointer-arith -Wno-sign-compare #-Wcast-align -Wcast-qual
PIPE = -pipe
OTHERWARNS = -Wlong-long -Wno-unused #-Wfloat-equal -Waggregate-return -Wimplicit-int -Wimplicit-function-declaration
trueWARNS = #-Wno-deprecated -Werror-implicit-function-declaration
WARNTYPE = #-Wchar-subscripts -Wreturn-type -Wswitch
NEWWARNS = #-Wunknown-pragmas #-Wunreachable-code
MRPICKY = #-ansi -trigraphs #-Weffc++# -Wextra #-ansi -pedantic # VERY PICKY!

# Standard Defines
EXE = sstm
MYLIB = sstm.a

SRC = .
BIN = ../bin
HDIR = h
CDIR = c
OLCDIR = olc
UTDIR = utils
SKDIR = skills
SDIR = snippets
SPDIR = script
ODIR = o
LIB = lib

C_FLAGS = -L/opt/lampp/lib/ -L/usr/local/lib/ $(MACHINE) $(WARN) $(ERRORBOY) $(OTHERWARNS) $(NEWWARNS) $(MRPICKY) $(trueWARNS) $(WARNTYPE) $(PROF) $(DEPS_FLAG) $(OPTIMIZE) $(CORE) $(PIPE) $(D_FLAGS) $(NOCRYPT) -I${HDIR}
LIB_MYSQL = -L/usr/lib64/mysql/ -lmysqlclient
LIBS = -lresolv -lz -lm -laspell -lgd $(LIB_MYSQL)
LIBS := $(LIBS) -L/home/sandstorm/NewSstm/src/lua-5.1.1/src/ -llua
LIBS := $(LIBS) # -rdynamic -lpthread -lnsl -lpcre -lpcrecpp

# Enhance our libs
ifdef MUDSSL
LIBS := $(LIBS) -lssl -lpthread
endif


L_FLAGS = $(PROF) $(LIBS)

#The .cpp Files!
C_FILES := ${wildcard ${CDIR}/*.cpp}
S_FILES := ${wildcard ${SDIR}/*.cpp}
OLC_FILES := ${wildcard ${OLCDIR}/*.cpp}
SK_FILES := ${wildcard ${SKDIR}/*.cpp}
UT_FILES := ${wildcard ${UTDIR}/*.cpp}
SCRIPT_F := ${wildcard ${SPDIR}/*.cpp}

#The .o Files!
SO_FILES := ${patsubst %.cpp, ${SDIR}/%.o, ${s_FILES}}
OQ_FILES := ${patsubst %.cpp, ${OLCDIR}/%.o, ${olc_FILES}}
SQ_FILES := ${patsubst %.cpp, ${SKDIR}/%.o, ${sk_FILES}}
UQ_FILES := ${patsubst %.cpp, ${UTDIR}/%.o, ${ut_FILES}}
SP_FILES := ${patsubst %.cpp, ${SPDIR}/%.o, ${sp_FILES}}

O_FILES := ${patsubst %.cpp, ${ODIR}/%.o, ${C_FILES} ${S_FILES} ${OLC_FILES} ${SK_FILES} ${UT_FILES} ${SCRIPT_F}}

H_FILES := ${wildcard ${HDIR}/*.h}

#handle the library file
CLIBS := ${wildcard ${LIB}/*.cpp}
OLIBS := ${patsubst %.cpp, %.o, ${CLIBS}}

SRCS := ${C_FILES} ${S_FILES} ${OLC_FILES} ${SK_FILES} ${UT_FILES} ${SCRIPT_F} ${H_FILES}

all: build sort ${EXE}

${EXE}: ${sort ${O_FILES}}
@rm -f ${EXE}
@${CC} ${L_FLAGS} $(LIBS) -o ${EXE} ${O_FILES} ${SO_FILES} ${OQ_FILES} ${SQ_FILES} ${UQ_FILES} ${SP_FILES} $(LIBS)
@chmod 664 $(O_FILES) # -rw-rw-r–
@chmod 2770 $(EXE) # -rwxrws—
@${INSTALL} ${EXE} ${BIN}
@rm -f ${EXE} #remove the exe (save some space)
@echo "Done."

#Make the library file
${MYLIB}: ${OLIBS}
@rm -f ${MYLIB}
@${CC} ${L_FLAGS} -o ${MYLIB} ${OLIBS}
@echo "Done."

${ODIR}/%.o: %.cpp
@echo "`date +"%X"` : Compiling $<…"
@${CC} -c ${C_FLAGS} -o $@ $<

%.header: %.h
@mv -f $< ${HDIR}

sort: makedirs ${patsubst %.h, %.header, ${wildcard *.h}}
@if [ ! -e .depend ]; then echo > .depend; fi

makedirs:
@if [ ! -d ${HDIR} ]; then mkdir ${HDIR}; fi
@if [ ! -d ${CDIR} ]; then mkdir ${CDIR}; fi
@if [ ! -d ${SDIR} ]; then mkdir ${SDIR}; fi
@if [ ! -d ${ODIR} ]; then mkdir ${ODIR}; fi
@if [ ! -d ${ODIR} ]; then mkdir ${UTDIR}; fi
@if [ ! -d ${ODIR} ]; then mkdir ${OLCDIR}; fi
@if [ ! -d ${ODIR} ]; then mkdir ${SKDIR}; fi
@if [ ! -d ${SPDIR} ]; then mkdir ${SPDIR}; fi;
clean:
@rm -f *.o *.patch ${ODIR}/c/*.o ${ODIR}/c/*.d ${ODIR}/snippets/*.o ${ODIR}/snippets/*.d
@rm -f ${ODIR}/olc/*.o ${ODIR}/olc/*.d DEADJOE *~ ${HDIR}/*~ ${CDIR}/*~ ${EXE} ${SDIR}/*~ ${OLCDIR}/*~
@rm -f ${SKDIR}/*~ ${ODIR}/skills/*.d ${ODIR}/skills/*.o ${ODIR}/utils/*.o ${ODIR}/utils/*.d
@rm -f ${SPDIR}/*~ ${ODIR}/script/*.d ${ODIR}/script/*.o
@echo "Done cleaning… Making"

backup:
@${BIN}/backup clean
@${BIN}/backup all

build:
@clear
@echo "($$)============[ Sandstorm Codebase ]============($$)"
@if [ -f .build ]; then \
expr `cat .build` + 1 > .build; \
else \
echo '1' > .build; \
fi
@if [ -f .version ]; then \
expr `cat .version` + 1 > .version; \
else \
echo '10001' > .version; \
fi
@if [ `cat .build` -ge 51 ]; then \
echo '1' > .build; \
fi
@echo '#ifndef BUILD_H' > build.h
@echo '#define BUILD_H' >> build.h
@echo "#define LinkCOUNT `cat .build`" >> build.h
@echo '#endif' >> build.h
@echo '#ifndef VERSION_H' > version.h
@echo '#define VERSION_H' >> version.h
@echo "#define VERSION `cat .version`" >> version.h
@echo '#endif' >> version.h
@echo "Build number `cat .build`, version `cat .version` set."
mv *.h h

#Create a patch-file for upload instead of uploading all the code that wasn't modified.
diff: clean
@clear
@make clean
@echo Diffing against ./original directory and creating sstm.patch.
@echo Ignore the following error.
@echo
@diff -c -P -N -x sstm -x core -x sstm.patch ./original ./ > ./sstm.patch

# Okay, am I evil, yes I am :), once the diff is done, update the active-source
update:
@echo "($$)============[ Update ]============($$)"
rm -f orignial/*
cp -R c h makefile original
@echo "($$)============[ End Update ]============($$)"

touch:
@if [ "${TOUCH}" != "error" ]; then \
${TOUCH} ${SRCS}; \
echo "Done touching ${PACKAGE} files."; \
else \
echo "No touch command found."; \
fi

.PHONY: indent
indent:
@if [ "${INDENT}" != "error" ]; then \
${INDENT} ${SRCS}; \
echo "Done formating ${PACKAGE} files."; \
else \
echo "No indent program found."; \
fi


depend:
@if [ "${DEP}" != "error" ]; then \
${DEP} -DDEPEND -p${ODIR}/ -f- – ${C_FLAGS} – ${SRCS} > .depend; \
else \
echo > .depend; \
fi
@echo "Done making dependencies."

ifdef SSTM_CODERPORT
include .depend
endif

# DO NOT DELETE



The point to look for is.
CORE       = -ggdb3


then add $(CORE) to your C_FLAGS. Do a clean compile, and then anytime your mud segment-faults, you'll have your core-file.

pending on the system your using, you make get a overwrite of core, or you may get a core.<insert pid-number>

Hope this helps.
22 Jan, 2008, David Haley wrote in the 3rd comment:
Votes: 0
Sometimes you also have to enable core dumps in the shell and not just the makefile. See Nick's gdb guide, namely the section "Enable large core dumps".
0.0/3