coredump

coredump
ulimit -c

ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 61384
max locked memory (kbytes, -l) 65536
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 61384
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited

ulimit -c unlimited

gcc main.c -g -O2 -o main

ll /var/crash

gdb main /var/crash/core.main.173823

g++ -fPIC -I"$JAVA_HOME/include" -I"$JAVA_HOME/include/linux" -shared -o libhello.so HelloJNI.cpp

gcc -fPIC -I"$JAVA_HOME/include" -I"$JAVA_HOME/include/linux" -shared -o libmyjni.so HelloJNI.c

javac -h . TestJNIPrimitiveArray.java

java HelloJNI
or
java -Djava.library.path=. HelloJNI

gcc -fPIC -I"$JAVA_HOME/include" -I"$JAVA_HOME/include/linux" -shared -o libTestJNIPrimitiveArray.so TestJNIPrimitiveArray.c -g
javac -h . TestJNIPrimitiveArray.java
java -Djava.library.path=. TestJNIPrimitiveArray

cat /proc/sys/kernel/core_pattern
|/usr/share/apport/apport -p%p -s%s -c%c -d%d -P%P -u%u -g%g -- %E

sudo bash -c 'echo "/var/crash/core.%e.%p" >/proc/sys/kernel/core_pattern'

gdb $JAVA_HOME/bin/java ./core.java.10349
/var/crash$

https://www3.ntu.edu.sg/home/ehchua/programming/java/JavaNativeInterface.html

一名醫生、一名土木工程師和一名計算機科學家在一起爭論什麼是這個世界上最古老的職業。
醫生說:“在聖經中,上帝用亞當的一根肋骨創建了夏娃。這顯然需要外科手術,所以我當然可以宣稱我的職業是世界上最古老的職業。”
土木工程師打斷道:“但是在‘創世紀’中更早的部分,描述了上帝從混沌中創造了天堂和人間的秩序。這是首次應用土木工程,也是土木工程最偉大的應用。
因此,親愛的醫生,您錯了,我的職業纔是世界上最古老的職業。”
計算機科學家斜靠在她的椅子上,微笑着,然後充滿自信地說:“啊哈,但是,你們覺得是誰創造了那片混沌?”

A physician, a civil engineer, and a computer scientist were arguing about
what was the oldest profession in the world. The physician remarked,
“Well, in the Bible, it says that God created Eve from a rib taken out of
Adam. This clearly required surgery, and so I can rightly claim that mine is
the oldest profession in the world.” The civil engineer interrupted, and
said, “But even earlier in the book of Genesis, it states that God created
the order of the heavens and the earth from out of the chaos. This was the
first and certainly the most spectacular application of civil engineering.
Therefore, fair doctor, you are wrong: mine is the oldest profession in the
world.” The computer scientist leaned back in her chair, smiled, and then
said confidently, “Ah, but who do you think created the chaos?”

posted @ 2022-10-24 10:44  BruceWayne09  阅读(32)  评论(0)    收藏  举报