FreeBSD Bugzilla – Attachment 235951 Details for
Bug 265889
sys.kern.basic_signal.trap_signal_test crashes bhyve in i386 VM
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
reproduce code
trap_signal_test.c (text/plain), 820 bytes, created by
Li-Wen Hsu
on 2022-08-16 21:59:50 UTC
(
hide
)
Description:
reproduce code
Filename:
MIME Type:
Creator:
Li-Wen Hsu
Created:
2022-08-16 21:59:50 UTC
Size:
820 bytes
patch
obsolete
>#include <stdio.h> >#include <signal.h> > >#include <machine/psl.h> >#define SET_TRACE_FLAG(ucp) (ucp)->uc_mcontext.mc_eflags |= PSL_T >#define CLR_TRACE_FLAG(ucp) (ucp)->uc_mcontext.mc_eflags &= ~PSL_T > >static volatile sig_atomic_t trap_signal_fired = 0; > >static void >trap_sig_handler(int signo, siginfo_t *info __unused, void *_ucp) >{ > ucontext_t *ucp = _ucp; > > if (trap_signal_fired < 9) { > SET_TRACE_FLAG(ucp); > } else { > CLR_TRACE_FLAG(ucp); > } > trap_signal_fired++; >} > >int main() { > struct sigaction sa = { > .sa_sigaction = trap_sig_handler, > .sa_flags = SA_SIGINFO, > }; > > sigemptyset(&sa.sa_mask); > sigaction(SIGTRAP, &sa, NULL); > > raise(SIGTRAP); > > printf("test\n"); >} >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 265889
: 235951