10000 unix/unix_mphal: Properly initialize struct sigaction. · micropython/micropython@3db2b23 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3db2b23

Browse files
author
Paul Sokolovsky
committed
unix/unix_mphal: Properly initialize struct sigaction.
This solves long-standing non-deterministic bug, which manifested itself on x86 32-bit (at least of reported cases) - segfault on Ctrl+C (i.e. SIGINT).
1 parent 02fa8df commit 3db2b23

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

unix/unix_mphal.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ void mp_hal_set_interrupt_char(char c) {
5353
#ifndef _WIN32
5454
// enable signal handler
5555
struct sigaction sa;
56+
memset(&sa, 0, sizeof(sa));
5657
sa.sa_handler = sighandler;
5758
sigemptyset(&sa.sa_mask);
5859
sigaction(SIGINT, &sa, NULL);

0 commit comments

Comments
 (0)
0