无法在Solaris上生成核心

时间:2015-10-15 16:42:24

标签: solaris core

我正在尝试使用abort生成核心文件,但不成功。

abtest.c:

#include<stdlib.h>
#include <stdio.h>

int main() {
  printf("callign abort...\n");
  abort();
  printf(".. shouldn't get here\n");
  return 0;
}

节目输出:

callign abort...
Abort

但是我可以使用gcore转储核心文件。它是在当前目录中生成的。 我的coreadm输出:

     global core file pattern:
     global core file content: default
       init core file pattern: core
       init core file content: default
            global core dumps: disabled
       per-process core dumps: enabled
      global setid core dumps: disabled
 per-process setid core dumps: disabled
     global core dump logging: disabled

1 个答案:

答案 0 :(得分:1)

我发现核心文件实际上是指向/ var / core而不是当前目录。不知道为什么,因为coreadm没有表明这一点。另外,如上所述,gcore在我当前的目录中生成了核心文件。 无论如何,因为/ var / core不可写(对我而言)没有生成核心文件。使它可写并且核心文件没问题。