1) Have problem with my daemon. Its crashed time to time without core dumb generation. system is FreeBSD. Before always .core
was generated. Seems this is some other kind of error or something other happens and its exit without core. Anyway I want to know this and fix!
2) How to check on freebsd that core must 100% sure be generated?
here: How to generate a core dump in Linux when a process gets a segmentation fault?
says that ulimit -c unlimited
but Command not found
3) Seems to catch the error/crash I need to attach to the process with GDB? How to do that? Also searched at stackoverflow and founded: gdb attach to a process without stop but i am note sure that I do all right:
a) I make the file called attach
give his rights to execute and add this lines:
echo "cont" > attach.gdb
gdb server $1 -x attach.gdb
rm attach.gdb
b) run like ./attach
and its started, but I can not do nothing. Its right? I need to wait before daemon will crash and than write generate-core-file
to get core?
4) Will core be generated by command generate-core-file
if daemon exit without SEGFAIL or other exception ?
thanks and sorry for my english. Its hard to write some big messages on not native language. You must to understand...