안녕하세요.
gdb core 생성 관련해서 테스트를 해보는데 의문이 있어서 질문을 올립니다.

-------------------------------------------------------------------------------------------
// ulimit -a를 실행한 결과
-f: file size (blocks) unlimited
-t: cpu time (seconds) unlimited
-d: data seg size (kb) unlimited
-s: stack size (kb) 8192
-c: core file size (blocks) 0
-m: resident set size (kb) unlimited
-l: locked memory (kb) 64
-p: processes 31931
-n: file descriptors 65536
-v: address space (kb) unlimited
-w: locks unlimited
-e: scheduling priority 0

 

구글링을 해보면 core file size가 0으로 설정된 경우는 core를 생성하지 않는다는 내용을 많이 보았습니다.
그런데 테스트로 core를 발생시켜도 core가 발생되네요..

 

Q1. core file size가 0인데도 core 파일이 생성되는 원인이 무엇일까요?

-------------------------------------------------------------------------------------------
core가 발생하였을때 gdb를 통해서 스택프레임을 분석해볼려고 했는데 아래와 같이 나오네요ㅜ

Core was generated by `mbm'.
Program terminated with signal 6, Aborted.
[New process 3034]
[New process 3027]
[New process 2972]
[New process 3037]
[New process 2975]
[New process 3041]
[New process 2980]
[New process 2982]
[New process 3039]
[New process 2981]
[New process 3038]
[New process 3026]
[New process 3035]
[New process 3033]
[New process 3028]
[New process 3040]
[New process 3029]
[New process 3032]
[New process 3030]
#0 0x000000555b132f40 in raise () from /lib64/libc.so.6
(gdb) bt
#0 0x000000555b132f40 in raise () from /lib64/libc.so.6
#1 0x000000555b1349f0 in abort () from /lib64/libc.so.6
#2 0x000000555b1705f4 in ?? () from /lib64/libc.so.6
warning: GDB can't find the start of the function at 0x555b1705f3.

GDB is unable to find the start of the function at 0x555b1705f3
and thus can't determine the size of that function's stack frame.
This means that GDB may be unable to access that stack frame, or
the frames below it.
This problem is most likely caused by an invalid program counter or
stack pointer.
However, if you think GDB should simply search farther back
from 0x555b1705f3 for code which looks like the beginning of a
function, you can increase the range of the search using the `set
heuristic-fence-post' command.

 

Q2. 해석을 하자면 스택프레임을 크기를 결정하지 못해서 0x5551b1705f3 주소를 가지는 함수의 시작을 찾을수 없다고 나오는데요.. 왜 이런 경우가 발생하는 걸까요? 또 이럴 경우에는 어떻게 분석을 해야할까요?

 

고수님들 답변좀 부탁드려요^^

-------------------------------------------------------------------------------------------