core dump — linux











up vote
3
down vote

favorite












I'm trying to understand the core dump generation. Is the core dump generated separately for a user space application process crash and the kernel level crash? Is the ulimit -c for both kinds?










share|improve this question




























    up vote
    3
    down vote

    favorite












    I'm trying to understand the core dump generation. Is the core dump generated separately for a user space application process crash and the kernel level crash? Is the ulimit -c for both kinds?










    share|improve this question


























      up vote
      3
      down vote

      favorite









      up vote
      3
      down vote

      favorite











      I'm trying to understand the core dump generation. Is the core dump generated separately for a user space application process crash and the kernel level crash? Is the ulimit -c for both kinds?










      share|improve this question















      I'm trying to understand the core dump generation. Is the core dump generated separately for a user space application process crash and the kernel level crash? Is the ulimit -c for both kinds?







      linux linux-kernel core-dump






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 25 at 23:43









      Rui F Ribeiro

      38.3k1477127




      38.3k1477127










      asked Mar 1 '13 at 6:32









      foo_l

      12514




      12514






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          5
          down vote



          accepted










          When a userland program crashes, it can leave a core file behind, containig a copy of the contents of the memory when it went down (the core name comes from the prehistory of computing, when memory was core). This is controlled by the ulimit(1) command, it is normally disabled as the core files are large and tend to confuse newbies. A core file can be analyzed by e.g. a debugger, together with the executable and symbol table, to find out what happened.



          When the kernel crashes, it normally triggers a kernel panic. If the kernel has found some critical inconsistency, it really isn't wise to count on it bahaving sanely to write out anything. So no core gets generated, and the system goes down. Contents of registers and code surrounding the address where the problem happened is written to the console. It is a good idea to save this (e.g. take a picture) for possible later analysis.



          A similar situation is the kernel Oops, when the kernel detects an inconsistency that isn't considered fatal. In that case (as in a kernel panic) contents of registers and code surrounding the address where the problem happened is written to the console, and also logged.






          share|improve this answer





















          • In my case the kernel version is 2.4.20 and it does not have the proc/sys/kernel/core_pattern file to specify my own path to dump the core file. Whenever I build the kernel(along with the application) and load the bin in my embedded system the current directory is always / and hence it is not able to generate the core dump when my application crashes,maybe due to the permissions issue. Is there any way that I can change the location of the core dump file or change the permissions of the / dir or change the current dir / to other dir say /tmp. Also there is no sysctl.conf file.
            – foo_l
            Mar 11 '13 at 6:37












          • The simplest may be to move the current working directory of the bin. If you can control how it starts, then first cd to a directory other than / and start it from there. Otherwise, have the bin call chdir("/tmp") (or other dir) if you can. Changing permissions on / is possible, but may be unwise for security reasons.
            – ash
            Aug 28 '13 at 13:02











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "106"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f66511%2fcore-dump-linux%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          5
          down vote



          accepted










          When a userland program crashes, it can leave a core file behind, containig a copy of the contents of the memory when it went down (the core name comes from the prehistory of computing, when memory was core). This is controlled by the ulimit(1) command, it is normally disabled as the core files are large and tend to confuse newbies. A core file can be analyzed by e.g. a debugger, together with the executable and symbol table, to find out what happened.



          When the kernel crashes, it normally triggers a kernel panic. If the kernel has found some critical inconsistency, it really isn't wise to count on it bahaving sanely to write out anything. So no core gets generated, and the system goes down. Contents of registers and code surrounding the address where the problem happened is written to the console. It is a good idea to save this (e.g. take a picture) for possible later analysis.



          A similar situation is the kernel Oops, when the kernel detects an inconsistency that isn't considered fatal. In that case (as in a kernel panic) contents of registers and code surrounding the address where the problem happened is written to the console, and also logged.






          share|improve this answer





















          • In my case the kernel version is 2.4.20 and it does not have the proc/sys/kernel/core_pattern file to specify my own path to dump the core file. Whenever I build the kernel(along with the application) and load the bin in my embedded system the current directory is always / and hence it is not able to generate the core dump when my application crashes,maybe due to the permissions issue. Is there any way that I can change the location of the core dump file or change the permissions of the / dir or change the current dir / to other dir say /tmp. Also there is no sysctl.conf file.
            – foo_l
            Mar 11 '13 at 6:37












          • The simplest may be to move the current working directory of the bin. If you can control how it starts, then first cd to a directory other than / and start it from there. Otherwise, have the bin call chdir("/tmp") (or other dir) if you can. Changing permissions on / is possible, but may be unwise for security reasons.
            – ash
            Aug 28 '13 at 13:02















          up vote
          5
          down vote



          accepted










          When a userland program crashes, it can leave a core file behind, containig a copy of the contents of the memory when it went down (the core name comes from the prehistory of computing, when memory was core). This is controlled by the ulimit(1) command, it is normally disabled as the core files are large and tend to confuse newbies. A core file can be analyzed by e.g. a debugger, together with the executable and symbol table, to find out what happened.



          When the kernel crashes, it normally triggers a kernel panic. If the kernel has found some critical inconsistency, it really isn't wise to count on it bahaving sanely to write out anything. So no core gets generated, and the system goes down. Contents of registers and code surrounding the address where the problem happened is written to the console. It is a good idea to save this (e.g. take a picture) for possible later analysis.



          A similar situation is the kernel Oops, when the kernel detects an inconsistency that isn't considered fatal. In that case (as in a kernel panic) contents of registers and code surrounding the address where the problem happened is written to the console, and also logged.






          share|improve this answer





















          • In my case the kernel version is 2.4.20 and it does not have the proc/sys/kernel/core_pattern file to specify my own path to dump the core file. Whenever I build the kernel(along with the application) and load the bin in my embedded system the current directory is always / and hence it is not able to generate the core dump when my application crashes,maybe due to the permissions issue. Is there any way that I can change the location of the core dump file or change the permissions of the / dir or change the current dir / to other dir say /tmp. Also there is no sysctl.conf file.
            – foo_l
            Mar 11 '13 at 6:37












          • The simplest may be to move the current working directory of the bin. If you can control how it starts, then first cd to a directory other than / and start it from there. Otherwise, have the bin call chdir("/tmp") (or other dir) if you can. Changing permissions on / is possible, but may be unwise for security reasons.
            – ash
            Aug 28 '13 at 13:02













          up vote
          5
          down vote



          accepted







          up vote
          5
          down vote



          accepted






          When a userland program crashes, it can leave a core file behind, containig a copy of the contents of the memory when it went down (the core name comes from the prehistory of computing, when memory was core). This is controlled by the ulimit(1) command, it is normally disabled as the core files are large and tend to confuse newbies. A core file can be analyzed by e.g. a debugger, together with the executable and symbol table, to find out what happened.



          When the kernel crashes, it normally triggers a kernel panic. If the kernel has found some critical inconsistency, it really isn't wise to count on it bahaving sanely to write out anything. So no core gets generated, and the system goes down. Contents of registers and code surrounding the address where the problem happened is written to the console. It is a good idea to save this (e.g. take a picture) for possible later analysis.



          A similar situation is the kernel Oops, when the kernel detects an inconsistency that isn't considered fatal. In that case (as in a kernel panic) contents of registers and code surrounding the address where the problem happened is written to the console, and also logged.






          share|improve this answer












          When a userland program crashes, it can leave a core file behind, containig a copy of the contents of the memory when it went down (the core name comes from the prehistory of computing, when memory was core). This is controlled by the ulimit(1) command, it is normally disabled as the core files are large and tend to confuse newbies. A core file can be analyzed by e.g. a debugger, together with the executable and symbol table, to find out what happened.



          When the kernel crashes, it normally triggers a kernel panic. If the kernel has found some critical inconsistency, it really isn't wise to count on it bahaving sanely to write out anything. So no core gets generated, and the system goes down. Contents of registers and code surrounding the address where the problem happened is written to the console. It is a good idea to save this (e.g. take a picture) for possible later analysis.



          A similar situation is the kernel Oops, when the kernel detects an inconsistency that isn't considered fatal. In that case (as in a kernel panic) contents of registers and code surrounding the address where the problem happened is written to the console, and also logged.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 1 '13 at 13:26









          vonbrand

          14.1k22444




          14.1k22444












          • In my case the kernel version is 2.4.20 and it does not have the proc/sys/kernel/core_pattern file to specify my own path to dump the core file. Whenever I build the kernel(along with the application) and load the bin in my embedded system the current directory is always / and hence it is not able to generate the core dump when my application crashes,maybe due to the permissions issue. Is there any way that I can change the location of the core dump file or change the permissions of the / dir or change the current dir / to other dir say /tmp. Also there is no sysctl.conf file.
            – foo_l
            Mar 11 '13 at 6:37












          • The simplest may be to move the current working directory of the bin. If you can control how it starts, then first cd to a directory other than / and start it from there. Otherwise, have the bin call chdir("/tmp") (or other dir) if you can. Changing permissions on / is possible, but may be unwise for security reasons.
            – ash
            Aug 28 '13 at 13:02


















          • In my case the kernel version is 2.4.20 and it does not have the proc/sys/kernel/core_pattern file to specify my own path to dump the core file. Whenever I build the kernel(along with the application) and load the bin in my embedded system the current directory is always / and hence it is not able to generate the core dump when my application crashes,maybe due to the permissions issue. Is there any way that I can change the location of the core dump file or change the permissions of the / dir or change the current dir / to other dir say /tmp. Also there is no sysctl.conf file.
            – foo_l
            Mar 11 '13 at 6:37












          • The simplest may be to move the current working directory of the bin. If you can control how it starts, then first cd to a directory other than / and start it from there. Otherwise, have the bin call chdir("/tmp") (or other dir) if you can. Changing permissions on / is possible, but may be unwise for security reasons.
            – ash
            Aug 28 '13 at 13:02
















          In my case the kernel version is 2.4.20 and it does not have the proc/sys/kernel/core_pattern file to specify my own path to dump the core file. Whenever I build the kernel(along with the application) and load the bin in my embedded system the current directory is always / and hence it is not able to generate the core dump when my application crashes,maybe due to the permissions issue. Is there any way that I can change the location of the core dump file or change the permissions of the / dir or change the current dir / to other dir say /tmp. Also there is no sysctl.conf file.
          – foo_l
          Mar 11 '13 at 6:37






          In my case the kernel version is 2.4.20 and it does not have the proc/sys/kernel/core_pattern file to specify my own path to dump the core file. Whenever I build the kernel(along with the application) and load the bin in my embedded system the current directory is always / and hence it is not able to generate the core dump when my application crashes,maybe due to the permissions issue. Is there any way that I can change the location of the core dump file or change the permissions of the / dir or change the current dir / to other dir say /tmp. Also there is no sysctl.conf file.
          – foo_l
          Mar 11 '13 at 6:37














          The simplest may be to move the current working directory of the bin. If you can control how it starts, then first cd to a directory other than / and start it from there. Otherwise, have the bin call chdir("/tmp") (or other dir) if you can. Changing permissions on / is possible, but may be unwise for security reasons.
          – ash
          Aug 28 '13 at 13:02




          The simplest may be to move the current working directory of the bin. If you can control how it starts, then first cd to a directory other than / and start it from there. Otherwise, have the bin call chdir("/tmp") (or other dir) if you can. Changing permissions on / is possible, but may be unwise for security reasons.
          – ash
          Aug 28 '13 at 13:02


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Unix & Linux Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f66511%2fcore-dump-linux%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Morgemoulin

          Scott Moir

          Souastre