diff --git a/arch/arm64/kernel/coredump.c b/arch/arm64/kernel/coredump.c index 9ed2dd98..1820838b 100644 --- a/arch/arm64/kernel/coredump.c +++ b/arch/arm64/kernel/coredump.c @@ -8,7 +8,8 @@ #define align32(x) ((((x) + 3) / 4) * 4) -void arch_fill_prstatus(struct elf_prstatus64 *prstatus, struct thread *thread, void *regs0) +void arch_fill_prstatus(struct elf_prstatus64 *prstatus, + struct thread *thread, void *regs0, int sig) { struct pt_regs *regs = regs0; struct elf_prstatus64 tmp_prstatus; @@ -38,6 +39,9 @@ void arch_fill_prstatus(struct elf_prstatus64 *prstatus, struct thread *thread, if (thread->proc->parent) { prstatus->pr_ppid = thread->proc->parent->pid; } + + prstatus->pr_info.si_signo = sig; + prstatus->pr_cursig = sig; } int arch_get_thread_core_info_size(void) diff --git a/arch/x86_64/kernel/coredump.c b/arch/x86_64/kernel/coredump.c index 6cab6fa3..9e6a039e 100644 --- a/arch/x86_64/kernel/coredump.c +++ b/arch/x86_64/kernel/coredump.c @@ -2,7 +2,8 @@ #include #include -void arch_fill_prstatus(struct elf_prstatus64 *prstatus, struct thread *thread, void *regs0) +void arch_fill_prstatus(struct elf_prstatus64 *prstatus, + struct thread *thread, void *regs0, int sig) { struct x86_user_context *uctx = regs0; struct x86_basic_regs *regs = &uctx->gpr; @@ -31,6 +32,9 @@ void arch_fill_prstatus(struct elf_prstatus64 *prstatus, struct thread *thread, prstatus->pr_ppid = thread->proc->parent->pid; } + prstatus->pr_info.si_signo = sig; + prstatus->pr_cursig = sig; + prstatus->pr_reg[0] = _r15; prstatus->pr_reg[1] = _r14; prstatus->pr_reg[2] = _r13; diff --git a/kernel/gencore.c b/kernel/gencore.c index 6590b63c..d519db3a 100644 --- a/kernel/gencore.c +++ b/kernel/gencore.c @@ -91,7 +91,7 @@ int get_prpsinfo_size(void) * \param proc A pointer to the current process structure. * \param regs0 A pointer to a ihk_mc_user_context_t structure. */ -void fill_prstatus(struct note *head, struct thread *thread) +void fill_prstatus(struct note *head, struct thread *thread, int sig) { void *name; struct elf_prstatus64 *prstatus; @@ -103,7 +103,7 @@ void fill_prstatus(struct note *head, struct thread *thread) memcpy(name, "CORE", sizeof("CORE")); prstatus = (struct elf_prstatus64 *)(name + align32(sizeof("CORE"))); - arch_fill_prstatus(prstatus, thread, thread->coredump_regs); + arch_fill_prstatus(prstatus, thread, thread->coredump_regs, sig); } /** @@ -212,14 +212,14 @@ int get_note_size(struct process *proc) * \param regs A pointer to a ihk_mc_user_context_t structure. */ -void fill_note(void *note, struct process *proc, char *cmdline) +void fill_note(void *note, struct process *proc, char *cmdline, int sig) { struct thread *thread_iter; struct mcs_rwlock_node lock; mcs_rwlock_reader_lock_noirq(&proc->threads_lock, &lock); list_for_each_entry(thread_iter, &proc->threads_list, siblings_list) { - fill_prstatus(note, thread_iter); + fill_prstatus(note, thread_iter, sig); note += get_prstatus_size(); arch_fill_thread_core_info(note, thread_iter, @@ -272,7 +272,7 @@ void fill_note(void *note, struct process *proc, char *cmdline) */ int gencore(struct process *proc, struct coretable **coretable, int *chunks, - char *cmdline) + char *cmdline, int sig) { int error = 0; struct coretable *ct = NULL; @@ -386,7 +386,7 @@ int gencore(struct process *proc, struct coretable **coretable, int *chunks, goto fail; } memset(note, 0, alignednotesize); - fill_note(note, proc, cmdline); + fill_note(note, proc, cmdline, sig); /* prgram header for NOTE segment is exceptional */ ph[0].p_type = PT_NOTE; diff --git a/kernel/include/elfcore.h b/kernel/include/elfcore.h index d9f78168..a37f5782 100644 --- a/kernel/include/elfcore.h +++ b/kernel/include/elfcore.h @@ -108,7 +108,8 @@ struct note { /* functions */ struct thread; -extern void arch_fill_prstatus(struct elf_prstatus64 *prstatus, struct thread *thread, void *regs0); +extern void arch_fill_prstatus(struct elf_prstatus64 *prstatus, + struct thread *thread, void *regs0, int sig); extern int arch_get_thread_core_info_size(void); extern void arch_fill_thread_core_info(struct note *head, struct thread *thread, void *regs); diff --git a/kernel/mem.c b/kernel/mem.c index 65c7ff82..64b05161 100644 --- a/kernel/mem.c +++ b/kernel/mem.c @@ -958,7 +958,7 @@ static struct ihk_mc_interrupt_handler query_free_mem_handler = { }; int gencore(struct process *proc, struct coretable **coretable, - int *chunks, char *cmdline); + int *chunks, char *cmdline, int sig); void freecore(struct coretable **); struct siginfo; typedef struct siginfo siginfo_t; @@ -1093,7 +1093,8 @@ int coredump(struct thread *thread, void *regs, int sig) goto skip; } - if ((ret = gencore(proc, &coretable, &chunks, proc->saved_cmdline))) { + if ((ret = gencore(proc, &coretable, &chunks, + proc->saved_cmdline, sig))) { kprintf("%s: ERROR: gencore returned %d\n", __func__, ret); goto out; } diff --git a/test/issues/1340/C1340.sh b/test/issues/1340/C1340.sh new file mode 100755 index 00000000..6e08257f --- /dev/null +++ b/test/issues/1340/C1340.sh @@ -0,0 +1,223 @@ +#!/bin/sh + +USELTP=0 +USEOSTEST=0 + +. ../../common.sh + +arch=`uname -p` +if [ -f "./${arch}_config" ]; then + . ./${arch}_config +else + echo "$1 is unexpected arch" + exit 1 +fi + +# clean corefils +rm ./mccore* ./core.* + +ulimit_c_bk=`ulimit -Sc` +# set ulimit -c unlimited to dump core +ulimit -c unlimited + + +issue=1340 + +tid=01 +tname=`printf "C${issue}T%02d" ${tid}` +echo "*** ${tname} start *******************************" +signum=11 +if [ "${arch}" = "x86_64" ]; then + signame=11 +elif [ "${arch}" = "aarch_64" ]; then + signame=SEGV +fi + +echo "** Check signal in coredump. GPE" +${MCEXEC} ./segv + +# Find mccore* +CORE=`ls -1 | grep "^mccore"` + +if [ ! -z $CORE ]; then + echo "[ OK ] core for McKernel process found" +else + echo "[ NG ] core for McKernel process not found" + exit 1 +fi + +gdb ./segv --core=./${CORE} -x ./cmd/C${issue}.cmd 2>/dev/null \ +| tee ./${tname}.txt + +num=`grep "Program terminated with signal ${signame}" ./${tname}.txt | wc -l` + +if [ ${num} -eq 1 ]; then + echo "*** ${tname} PASSED ******************************" +else + echo "*** ${tname} FAILED ******************************" +fi +# clean corefils +rm ./mccore* ./core.* +let tid++ +echo "" + +idx=0 +for signum in ${SIG_LIST[@]} +do + tname=`printf "C${issue}T%02d" ${tid}` + echo "*** ${tname} start *******************************" + echo "** Check signal in coredump. raise ${signum}" + ${MCEXEC} ./raise_sig ${signum} + + # Find mccore* + CORE=`ls -1 | grep "^mccore"` + + if [ ! -z $CORE ]; then + echo "[ OK ] core for McKernel process found" + else + echo "[ NG ] core for McKernel process not found" + exit 1 + fi + + gdb ./segv --core=./${CORE} -x ./cmd/C${issue}.cmd 2>/dev/null \ + | tee ./${tname}.txt + + num=`grep "Program terminated with signal ${NAME_LIST[${idx}]}" ./${tname}.txt | wc -l` + + if [ ${num} -eq 1 ]; then + echo "*** ${tname} PASSED ******************************" + else + echo "*** ${tname} FAILED ******************************" + fi + # clean corefils + rm ./mccore* ./core.* + let tid++ + echo "" + let idx++ +done + +exit 0 + + +tid=03 +echo "*** C${issue}T${tid} start *******************************" +echo "** Check signal in coredump. raise SIGILL" +signum=4 +${MCEXEC} ./raise_sig ${signum} + +# Find mccore* +CORE=`ls -1 | grep "^mccore"` + +if [ ! -z $CORE ]; then + echo "[ OK ] core for McKernel process found" +else + echo "[ NG ] core for McKernel process not found" + exit 1 +fi + +gdb ./segv --core=./${CORE} -x ./cmd/C${issue}.cmd 2>/dev/null \ +| tee ./C${issue}T${tid}.txt + +num=`grep "Program terminated with signal ${signum}" ./C${issue}T${tid}.txt | wc -l` + +if [ ${num} -eq 1 ]; then + echo "*** C${issue}T${tid} PASSED ******************************" +else + echo "*** C${issue}T${tid} FAILED ******************************" +fi +# clean corefils +rm ./mccore* ./core.* +echo "" + +tid=04 +echo "*** C${issue}T${tid} start *******************************" +echo "** Check signal in coredump. raise SIGABRT" +signum=6 +${MCEXEC} ./raise_sig ${signum} + +# Find mccore* +CORE=`ls -1 | grep "^mccore"` + +if [ ! -z $CORE ]; then + echo "[ OK ] core for McKernel process found" +else + echo "[ NG ] core for McKernel process not found" + exit 1 +fi + +gdb ./segv --core=./${CORE} -x ./cmd/C${issue}.cmd 2>/dev/null \ +| tee ./C${issue}T${tid}.txt + +num=`grep "Program terminated with signal ${signum}" ./C${issue}T${tid}.txt | wc -l` + +if [ ${num} -eq 1 ]; then + echo "*** C${issue}T${tid} PASSED ******************************" +else + echo "*** C${issue}T${tid} FAILED ******************************" +fi +# clean corefils +rm ./mccore* ./core.* +echo "" + +tid=05 +echo "*** C${issue}T${tid} start *******************************" +echo "** Check signal in coredump. raise SIGFPE" +signum=8 +${MCEXEC} ./raise_sig ${signum} + +# Find mccore* +CORE=`ls -1 | grep "^mccore"` + +if [ ! -z $CORE ]; then + echo "[ OK ] core for McKernel process found" +else + echo "[ NG ] core for McKernel process not found" + exit 1 +fi + +gdb ./segv --core=./${CORE} -x ./cmd/C${issue}.cmd 2>/dev/null \ +| tee ./C${issue}T${tid}.txt + +num=`grep "Program terminated with signal ${signum}" ./C${issue}T${tid}.txt | wc -l` + +if [ ${num} -eq 1 ]; then + echo "*** C${issue}T${tid} PASSED ******************************" +else + echo "*** C${issue}T${tid} FAILED ******************************" +fi +# clean corefils +rm ./mccore* ./core.* +echo "" + +tid=06 +echo "*** C${issue}T${tid} start *******************************" +echo "** Check signal in coredump. raise SIGSEGV" +signum=11 +${MCEXEC} ./raise_sig ${signum} + +# Find mccore* +CORE=`ls -1 | grep "^mccore"` + +if [ ! -z $CORE ]; then + echo "[ OK ] core for McKernel process found" +else + echo "[ NG ] core for McKernel process not found" + exit 1 +fi + +gdb ./segv --core=./${CORE} -x ./cmd/C${issue}.cmd 2>/dev/null \ +| tee ./C${issue}T${tid}.txt + +num=`grep "Program terminated with signal ${signum}" ./C${issue}T${tid}.txt | wc -l` + +if [ ${num} -eq 1 ]; then + echo "*** C${issue}T${tid} PASSED ******************************" +else + echo "*** C${issue}T${tid} FAILED ******************************" +fi +# clean corefils +rm ./mccore* ./core.* +echo "" + +# restore ulimit -c +ulimit -c ${ulimit_c_bk} diff --git a/test/issues/1340/Makefile b/test/issues/1340/Makefile new file mode 100644 index 00000000..7cf68c02 --- /dev/null +++ b/test/issues/1340/Makefile @@ -0,0 +1,11 @@ +CFLAGS=-g +LDFLAGS= + +TARGET=segv raise_sig + +all: $(TARGET) + +test: all + ./C1340.sh +clean: + rm -f $(TARGET) *.o mccore* core.* *.txt diff --git a/test/issues/1340/README b/test/issues/1340/README new file mode 100644 index 00000000..326aa4b9 --- /dev/null +++ b/test/issues/1340/README @@ -0,0 +1,39 @@ +【Issue#1340 動作確認】 +□ テスト内容 +1. coredumpに契機となったシグナル情報が含まれていることを確認 + +C1340T01: プログラム中でSEGVが発生した場合 + gdbでcoredumpを読み込んだ際、下記が出力されることを確認 + Program terminated with signal 11 + +C1340T02: raise() で自身にシグナル3 (SIGQUIT) を送信した場合 + gdbでcoredumpを読み込んだ際、下記が出力されることを確認 + Program terminated with signal 3 + +C1340T03: raise() で自身にシグナル4 (SIGILL) を送信した場合 + gdbでcoredumpを読み込んだ際、下記が出力されることを確認 + Program terminated with signal 4 + +C1340T04: raise() で自身にシグナル6 (SIGABRT) を送信した場合 + gdbでcoredumpを読み込んだ際、下記が出力されることを確認 + Program terminated with signal 6 + +C1340T05: raise() で自身にシグナル8 (SIGFPE) を送信した場合 + gdbでcoredumpを読み込んだ際、下記が出力されることを確認 + Program terminated with signal 8 + +C1340T06: raise() で自身にシグナル11 (SIGSEGV) を送信した場合 + gdbでcoredumpを読み込んだ際、下記が出力されることを確認 + Program terminated with signal 11 + +□ 実行手順 +$ make test + +McKernelのインストール先や、OSTEST, LTPの配置場所は、 +$HOME/.mck_test_config を参照している +.mck_test_config は、McKernelをビルドした際に生成されるmck_test_config.sample ファイルを +$HOMEにコピーし、適宜編集する + +□ 実行結果 +result_x86_64.log および result_aarch64.log 参照。 +すべての項目をPASSしていることを確認。 diff --git a/test/issues/1340/aarch64_config b/test/issues/1340/aarch64_config new file mode 100644 index 00000000..5deb38da --- /dev/null +++ b/test/issues/1340/aarch64_config @@ -0,0 +1,3 @@ +SIG_LIST=(3 4 6 8 11) +NAME_LIST=(SIGQUIT SIGILL SIGABRT SIGFPE SIGSEGV) + diff --git a/test/issues/1340/cmd/C1340.cmd b/test/issues/1340/cmd/C1340.cmd new file mode 100644 index 00000000..3db49b3a --- /dev/null +++ b/test/issues/1340/cmd/C1340.cmd @@ -0,0 +1,2 @@ +quit + diff --git a/test/issues/1340/raise_sig.c b/test/issues/1340/raise_sig.c new file mode 100644 index 00000000..f0406505 --- /dev/null +++ b/test/issues/1340/raise_sig.c @@ -0,0 +1,15 @@ +#include +#include +#include + +int main(int argc, char **argv) +{ + int sig = 0; + + sig = atoi(argv[1]); + raise(sig); + + printf("Send sig %d to self\n", sig); + + return 0; +} diff --git a/test/issues/1340/result_aarch64.log b/test/issues/1340/result_aarch64.log new file mode 100644 index 00000000..987e75c9 --- /dev/null +++ b/test/issues/1340/result_aarch64.log @@ -0,0 +1,168 @@ +*** C1340T01 start ******************************* +** Check signal in coredump. GPE +Terminate by signal 11 +./C1340.sh: line 37: 18499 Segmentation fault (core dumped) ${MCEXEC} ./segv +[ OK ] core for McKernel process found +GNU gdb (GDB) Red Hat Enterprise Linux 8.2-3.el8 +Copyright (C) 2018 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later +This is free software: you are free to change and redistribute it. +There is NO WARRANTY, to the extent permitted by law. +Type "show copying" and "show warranty" for details. +This GDB was configured as "aarch64-redhat-linux-gnu". +Type "show configuration" for configuration details. +For bug reporting instructions, please see: +. +Find the GDB manual and other documentation resources online at: + . + +For help, type "help". +Type "apropos word" to search for commands related to "word"... +Reading symbols from ./segv...done. +[New LWP 18499] +Core was generated by `'. +Program terminated with signal SIGSEGV, Segmentation fault. +#0 0x00000000004005fc in main (argc=1, argv=0x3ffffffffe08) at segv.c:8 +8 *ptr = 0xdead; +*** C1340T01 PASSED ****************************** +rm: cannot remove './core.*': No such file or directory + +*** C1340T02 start ******************************* +** Check signal in coredump. raise 3 +Terminate by signal 3 +./C1340.sh: line 65: 18535 Quit (core dumped) ${MCEXEC} ./raise_sig ${signum} +[ OK ] core for McKernel process found +GNU gdb (GDB) Red Hat Enterprise Linux 8.2-3.el8 +Copyright (C) 2018 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later +This is free software: you are free to change and redistribute it. +There is NO WARRANTY, to the extent permitted by law. +Type "show copying" and "show warranty" for details. +This GDB was configured as "aarch64-redhat-linux-gnu". +Type "show configuration" for configuration details. +For bug reporting instructions, please see: +. +Find the GDB manual and other documentation resources online at: + . + +For help, type "help". +Type "apropos word" to search for commands related to "word"... +Reading symbols from ./segv...done. +[New LWP 18535] +Core was generated by `'. +Program terminated with signal SIGQUIT, Quit. +#0 0x0000100000036d0c in raise () from /usr/lib64/libc.so.6 +*** C1340T02 PASSED ****************************** +rm: cannot remove './core.*': No such file or directory + +*** C1340T03 start ******************************* +** Check signal in coredump. raise 4 +Terminate by signal 4 +./C1340.sh: line 65: 18571 Illegal instruction (core dumped) ${MCEXEC} ./raise_sig ${signum} +[ OK ] core for McKernel process found +GNU gdb (GDB) Red Hat Enterprise Linux 8.2-3.el8 +Copyright (C) 2018 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later +This is free software: you are free to change and redistribute it. +There is NO WARRANTY, to the extent permitted by law. +Type "show copying" and "show warranty" for details. +This GDB was configured as "aarch64-redhat-linux-gnu". +Type "show configuration" for configuration details. +For bug reporting instructions, please see: +. +Find the GDB manual and other documentation resources online at: + . + +For help, type "help". +Type "apropos word" to search for commands related to "word"... +Reading symbols from ./segv...done. +[New LWP 18571] +Core was generated by `'. +Program terminated with signal SIGILL, Illegal instruction. +#0 0x0000100000036d0c in raise () from /usr/lib64/libc.so.6 +*** C1340T03 PASSED ****************************** +rm: cannot remove './core.*': No such file or directory + +*** C1340T04 start ******************************* +** Check signal in coredump. raise 6 +Terminate by signal 6 +./C1340.sh: line 65: 18606 Aborted (core dumped) ${MCEXEC} ./raise_sig ${signum} +[ OK ] core for McKernel process found +GNU gdb (GDB) Red Hat Enterprise Linux 8.2-3.el8 +Copyright (C) 2018 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later +This is free software: you are free to change and redistribute it. +There is NO WARRANTY, to the extent permitted by law. +Type "show copying" and "show warranty" for details. +This GDB was configured as "aarch64-redhat-linux-gnu". +Type "show configuration" for configuration details. +For bug reporting instructions, please see: +. +Find the GDB manual and other documentation resources online at: + . + +For help, type "help". +Type "apropos word" to search for commands related to "word"... +Reading symbols from ./segv...done. +[New LWP 18606] +Core was generated by `'. +Program terminated with signal SIGABRT, Aborted. +#0 0x0000100000036d0c in raise () from /usr/lib64/libc.so.6 +*** C1340T04 PASSED ****************************** +rm: cannot remove './core.*': No such file or directory + +*** C1340T05 start ******************************* +** Check signal in coredump. raise 8 +Terminate by signal 8 +./C1340.sh: line 65: 18641 Floating point exception(core dumped) ${MCEXEC} ./raise_sig ${signum} +[ OK ] core for McKernel process found +GNU gdb (GDB) Red Hat Enterprise Linux 8.2-3.el8 +Copyright (C) 2018 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later +This is free software: you are free to change and redistribute it. +There is NO WARRANTY, to the extent permitted by law. +Type "show copying" and "show warranty" for details. +This GDB was configured as "aarch64-redhat-linux-gnu". +Type "show configuration" for configuration details. +For bug reporting instructions, please see: +. +Find the GDB manual and other documentation resources online at: + . + +For help, type "help". +Type "apropos word" to search for commands related to "word"... +Reading symbols from ./segv...done. +[New LWP 18641] +Core was generated by `'. +Program terminated with signal SIGFPE, Arithmetic exception. +#0 0x0000100000036d0c in raise () from /usr/lib64/libc.so.6 +*** C1340T05 PASSED ****************************** +rm: cannot remove './core.*': No such file or directory + +*** C1340T06 start ******************************* +** Check signal in coredump. raise 11 +Terminate by signal 11 +./C1340.sh: line 65: 18676 Segmentation fault (core dumped) ${MCEXEC} ./raise_sig ${signum} +[ OK ] core for McKernel process found +GNU gdb (GDB) Red Hat Enterprise Linux 8.2-3.el8 +Copyright (C) 2018 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later +This is free software: you are free to change and redistribute it. +There is NO WARRANTY, to the extent permitted by law. +Type "show copying" and "show warranty" for details. +This GDB was configured as "aarch64-redhat-linux-gnu". +Type "show configuration" for configuration details. +For bug reporting instructions, please see: +. +Find the GDB manual and other documentation resources online at: + . + +For help, type "help". +Type "apropos word" to search for commands related to "word"... +Reading symbols from ./segv...done. +[New LWP 18676] +Core was generated by `'. +Program terminated with signal SIGSEGV, Segmentation fault. +#0 0x0000100000036d0c in raise () from /usr/lib64/libc.so.6 +*** C1340T06 PASSED ****************************** +rm: cannot remove './core.*': No such file or directory diff --git a/test/issues/1340/result_x86_64.log b/test/issues/1340/result_x86_64.log new file mode 100644 index 00000000..2df97eaf --- /dev/null +++ b/test/issues/1340/result_x86_64.log @@ -0,0 +1,126 @@ +*** C1340T01 start ******************************* +** Check signal in coredump. GPE +Terminate by signal 11 +./C1340.sh: line 37: 14591 Segmentation fault (core dumped) ${MCEXEC} ./segv +[ OK ] core for McKernel process found +GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-94.el7 +Copyright (C) 2013 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later +This is free software: you are free to change and redistribute it. +There is NO WARRANTY, to the extent permitted by law. Type "show copying" +and "show warranty" for details. +This GDB was configured as "x86_64-redhat-linux-gnu". +For bug reporting instructions, please see: +... +Reading symbols from /home/satoken/mck_srcs/kyokaIII/mckernel/test/issues/1340/segv...done. +[New LWP 14591] +Core was generated by `'. +Program terminated with signal 11, Segmentation fault. +#0 0x0000000000400504 in main (argc=1, argv=0x547ffffffd08) at segv.c:8 +8 *ptr = 0xdead; +*** C1340T01 PASSED ****************************** + +*** C1340T02 start ******************************* +** Check signal in coredump. raise 3 +Terminate by signal 3 +./C1340.sh: line 65: 14633 Quit (core dumped) ${MCEXEC} ./raise_sig ${signum} +[ OK ] core for McKernel process found +GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-94.el7 +Copyright (C) 2013 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later +This is free software: you are free to change and redistribute it. +There is NO WARRANTY, to the extent permitted by law. Type "show copying" +and "show warranty" for details. +This GDB was configured as "x86_64-redhat-linux-gnu". +For bug reporting instructions, please see: +... +Reading symbols from /home/satoken/mck_srcs/kyokaIII/mckernel/test/issues/1340/segv...done. +[New LWP 14633] +Core was generated by `'. +Program terminated with signal 3, Quit. +#0 0x00002aaaaaa50277 in raise () from /lib64/libc.so.6 +*** C1340T02 PASSED ****************************** + +*** C1340T03 start ******************************* +** Check signal in coredump. raise 4 +Terminate by signal 4 +./C1340.sh: line 65: 14675 Illegal instruction (core dumped) ${MCEXEC} ./raise_sig ${signum} +[ OK ] core for McKernel process found +GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-94.el7 +Copyright (C) 2013 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later +This is free software: you are free to change and redistribute it. +There is NO WARRANTY, to the extent permitted by law. Type "show copying" +and "show warranty" for details. +This GDB was configured as "x86_64-redhat-linux-gnu". +For bug reporting instructions, please see: +... +Reading symbols from /home/satoken/mck_srcs/kyokaIII/mckernel/test/issues/1340/segv...done. +[New LWP 14675] +Core was generated by `'. +Program terminated with signal 4, Illegal instruction. +#0 0x00002aaaaaa50277 in raise () from /lib64/libc.so.6 +*** C1340T03 PASSED ****************************** + +*** C1340T04 start ******************************* +** Check signal in coredump. raise 6 +Terminate by signal 6 +./C1340.sh: line 65: 14717 Aborted (core dumped) ${MCEXEC} ./raise_sig ${signum} +[ OK ] core for McKernel process found +GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-94.el7 +Copyright (C) 2013 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later +This is free software: you are free to change and redistribute it. +There is NO WARRANTY, to the extent permitted by law. Type "show copying" +and "show warranty" for details. +This GDB was configured as "x86_64-redhat-linux-gnu". +For bug reporting instructions, please see: +... +Reading symbols from /home/satoken/mck_srcs/kyokaIII/mckernel/test/issues/1340/segv...done. +[New LWP 14717] +Core was generated by `'. +Program terminated with signal 6, Aborted. +#0 0x00002aaaaaa50277 in raise () from /lib64/libc.so.6 +*** C1340T04 PASSED ****************************** + +*** C1340T05 start ******************************* +** Check signal in coredump. raise 8 +Terminate by signal 8 +./C1340.sh: line 65: 14759 Floating point exception(core dumped) ${MCEXEC} ./raise_sig ${signum} +[ OK ] core for McKernel process found +GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-94.el7 +Copyright (C) 2013 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later +This is free software: you are free to change and redistribute it. +There is NO WARRANTY, to the extent permitted by law. Type "show copying" +and "show warranty" for details. +This GDB was configured as "x86_64-redhat-linux-gnu". +For bug reporting instructions, please see: +... +Reading symbols from /home/satoken/mck_srcs/kyokaIII/mckernel/test/issues/1340/segv...done. +[New LWP 14759] +Core was generated by `'. +Program terminated with signal 8, Arithmetic exception. +#0 0x00002aaaaaa50277 in raise () from /lib64/libc.so.6 +*** C1340T05 PASSED ****************************** + +*** C1340T06 start ******************************* +** Check signal in coredump. raise 11 +Terminate by signal 11 +./C1340.sh: line 65: 14801 Segmentation fault (core dumped) ${MCEXEC} ./raise_sig ${signum} +[ OK ] core for McKernel process found +GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-94.el7 +Copyright (C) 2013 Free Software Foundation, Inc. +License GPLv3+: GNU GPL version 3 or later +This is free software: you are free to change and redistribute it. +There is NO WARRANTY, to the extent permitted by law. Type "show copying" +and "show warranty" for details. +This GDB was configured as "x86_64-redhat-linux-gnu". +For bug reporting instructions, please see: +... +Reading symbols from /home/satoken/mck_srcs/kyokaIII/mckernel/test/issues/1340/segv...done. +[New LWP 14801] +Core was generated by `'. +Program terminated with signal 11, Segmentation fault. +#0 0x00002aaaaaa50277 in raise () from /lib64/libc.so.6 +*** C1340T06 PASSED ****************************** diff --git a/test/issues/1340/segv.c b/test/issues/1340/segv.c new file mode 100644 index 00000000..88748a4f --- /dev/null +++ b/test/issues/1340/segv.c @@ -0,0 +1,11 @@ +#include +#include + +int main(int argc, char **argv) +{ + int *ptr = NULL; + + *ptr = 0xdead; + + return 0; +} diff --git a/test/issues/1340/x86_64_config b/test/issues/1340/x86_64_config new file mode 100644 index 00000000..ac20748f --- /dev/null +++ b/test/issues/1340/x86_64_config @@ -0,0 +1,3 @@ +SIG_LIST=(3 4 6 8 11) +NAME_LIST=(3 4 6 8 11) +