Re: No Core

From: Mike Stilson (mike@velgarian.sytes.net)
Date: 06/06/02


On Thu, Jun 06, 2002 at 10:09:39AM -0500, Patrick Dughi wrote:
>> On Tuesday 04 June 2002 10:16 pm, Mythran wrote:
>> > Every time my mud has crashed with no error messages, except for
>> > Sigmentation Faults, there is no core made...:(
>> >
>> > Anyone ran into this before?  I am running RedHat Linux 7.2 with
>> > Circle30bpl17 with all the fixins (code is modified).
>> >
>> > Mythran
>>
>> Add 'ulimit -c unlimited' to your runscript(or wherever it'll be run before
>> the mudserver)
>
>        One or two things to note: depending on your installation, your
>ulimit is set within the default login scripts (located in /etc usually,
>as things like csh.login, or cshrc, for c shell).  That's great, and works
>because the login process is running with root priveleges.
>
>        This is important, because just like nice, you cannot (in most
>situations) raise your ulimits, only decrease them.
>
>        So, unless you run your mud as root, you may not be able to
>backwards-adjust your ulimit TO unlimited.  Implementation specific, of
>course (depends on hard and soft limits).
>
>        Oh, and if you run your mud as root, you're a moron, and I'm not
>even going to bother to explain.
>
>                                                PjD

The easiest way I know around it is to do one of two things:
$ ulimit -c `ulimit -Hc`   # set soft coresize limit to hard limit.
(those are back-quotes)

or something like:

struct rlimit &rlim;
getrusage(RLIM_CORE, &rlim);
setrusage(RLIM_CORE, &rlim);

in the startup code somewhere (but if I remember, that didn't work
right.)

You're mostly right though.  If the startup scripts set, say, a 15M hard
coresize limit and you try to "ulimit -c unlimited" it'll fail.


As for running as root, I agree, you're a moron if you do.  But if it's
ABSOLUTELY necessary (for whatever reason I can't fathom... maybe you
hafta sneak it in on some low port on the server?) then there had REALLY
damn well better be some setuid/gid()'s to drop to an unprivileged user
as soon as whatever you need root for is done with.

-Mike

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/25/03 PDT