Open
Description
Currently, the core dump file doesn't give much useful information. For example, the following code in enclave:
int get_number() {
int *p = reinterpret_cast<int*>(0xdeadbeef);
return *p;
}
If you run with sgx-gdb
, that's fine, you can see the line number:
(gdb) r
Starting program: ./app
...
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff5800515 in get_number () at Enclave/Enclave.cpp:6
6 return *p;
(gdb) bt
#0 0x00007ffff5800515 in get_number () at Enclave/Enclave.cpp:6
#1 0x00007ffff58004f7 in sgx_get_number (pms=0x7fffffffdee0) at Enclave/Enclave_t.c:31
#2 0x00007ffff5800b30 in do_ecall ()
#3 0x00007ffff5800988 in enter_enclave ()
#4 0x00007ffff5801976 in enclave_entry ()
#5 0x00007ffff7bbe2a2 in __morestack () from /usr/lib/libsgx_urts.so
#6 0x00007ffff7bc364e in do_ecall(int, void const*, void const*, CTrustThread*) () from /usr/lib/libsgx_urts.so
#7 0x00007ffff7bc07e9 in CEnclave::ecall(int, void const*, void*) () from /usr/lib/libsgx_urts.so
#8 0x00007ffff7bc19d8 in sgx_ecall () from /usr/lib/libsgx_urts.so
#9 0x00000000004007a4 in get_number (eid=2, retval=0x7fffffffdf18) at App/Enclave_u.c:19
#10 0x000000000040088b in main (argc=1, argv=0x7fffffffe418) at App/App.cpp:21
But if you run it then look into the core dump file, you can only get:
Core was generated by `./app'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 __GI_raise (sig=<optimized out>) at ../sysdeps/unix/sysv/linux/raise.c:58
58 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0 __GI_raise (sig=<optimized out>) at ../sysdeps/unix/sysv/linux/raise.c:58
#1 0x00007fc975ee3492 in sig_handler(int, siginfo_t*, void*) () from /usr/lib/libsgx_urts.so
#2 <signal handler called>
#3 0x00007fc975ede2ed in __morestack () from /usr/lib/libsgx_urts.so
#4 0x00007fc975ee364e in do_ecall(int, void const*, void const*, CTrustThread*) () from /usr/lib/libsgx_urts.so
#5 0x00007fc975ee07e9 in CEnclave::ecall(int, void const*, void*) () from /usr/lib/libsgx_urts.so
#6 0x00007fc975ee19d8 in sgx_ecall () from /usr/lib/libsgx_urts.so
#7 0x00000000004007a4 in get_number (eid=2, retval=0x7ffda235faa8) at App/Enclave_u.c:19
#8 0x000000000040088b in main (argc=1, argv=0x7ffda235ffa8) at App/App.cpp:21
Is there any chance to enhance the core dump file support? Thanks!