Results 1 to 7 of 7
  1. #1

    Unix / FreeBSD question

    We moved from Red Hat to FreeBSD few months ago and we really like FreeBSD now for many reasons.

    Nevertheless, FreeBSD tricked us badly... Let me explain.

    We are running a software and after awhile, it was crashing because it ate all available memory. Then we though that there was a memory leak somewhere and we searched for it for awhile but then we realized that unix (or FreeBSD, I got no clue) was generating a .core and was keeping the software alive until there was no memory left.

    Now, I am just wondering, what is that feature exactly and why is it there? Any reasons? I mean, I know it can be practical but the software will crash anyway once all available memory will be consumed so what is the real use of it? Does the software can be restarted while the .core is running and once it is started, the .core will drop? I doubt it but maybe I am wrong?

    Thanks much!

  2. #2
    Join Date
    Mar 2003
    Sacramento, CA
    A valuable read on BSD kernel debugging problems.

    In your case you should use gdb to read what the .core file is saying happened. Reading that might give you a clue as to whats going wrong.

    It sounds as if the program in question is not handling itself properly when it has any sort of exit status that indicates an error.
    Jacob Squires , CISSP

    security assesment, network analysis

  3. #3
    Oh we found what was the bug in our program but I was mainly wondering about the .core, what was it's use exactly and if it would be possible to restart the "real" software while the .core is running since the "real" software crashed or if we really have to close the process or wait until it crashed by itself.

  4. #4
    The 'core file (IIRC -- been a long time since CS-101. ) is a dump of the memory that was allocated to the program, so you can analyze it and see what failed.

    Kind of like the junk Dr. Watson will create in Windows.

  5. #5
    Join Date
    Dec 2004
    Exactly dzeanah. The core dump is a debugging tool; the kernel will dump the entire allocated memory area (and some addressing metadata) when a program crashes hard out to a file for analysis later with a debugger. There's usually a kernel option or sysctl parameter to turn this off (I'm not sure what it is on FreeBSD).

    You should submit a bug report to the developers of the software that is crashing. Certainly that is not what's supposed to be happening.

  6. #6
    Ok but hmmm... the program crashed but is still running using that .core. Question: is the .core able to run indefinetly or is it limited? Will it eat all memory or will it run until I close the process?


  7. #7
    Join Date
    Aug 2003
    There's usually a kernel option or sysctl parameter to turn this off (I'm not sure what it is on FreeBSD).
    The default kernel on freebsd will not have debugging enabled you have to actually enable it by uncommenting it out on your custom kernel when you compile it.

    Also killer15669 when a program core dumps typically the program should exit and not do what you are defining. The issue you are having is the program is creating a loop and then constantly core dumping itself due to this loop more then likely. Glad to hear you have solved your problem though. In any case normally when a program will core dump it will fail and be dumped to a core debug output file. The program "should" be exited automatically.

    Justin Schurawlow :: Technology Enthusiast
    Schurawlow PC Repair
    Computer Services for the Lehigh Valley area
    Blog :: The Justin Schurawlow Blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts