Skip to content

Commit

Permalink
Fix typo AIXPPCX -> AIXPPC
Browse files Browse the repository at this point in the history
On AIX, this typo disables code that prevents upcall_handler from
collecting thread data when upcall_handler is unregistered. Collecting
data after upcall_handler is unregistered might cause corrupt memory
to be passed through siginfo and lead to crashes.

More context:
On AIX, a signal can can be unavailable to sigpending/sigwait but
not yet have been delivered to a thread. As a result, it is not
guaranteed that SIG_SUSPEND won't be delivered after upcall_handler
is unregistered.

Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
  • Loading branch information
babsingh committed Mar 25, 2024
1 parent b7d9218 commit 1762b07
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions port/unix/omrintrospect.c
Expand Up @@ -743,14 +743,14 @@ upcall_handler(int signal, siginfo_t *siginfo, void *context_arg)
pid_t pid = getpid();
uintptr_t tid = omrthread_get_ras_tid();

#if defined(AIXPPCX)
#if defined(AIXPPC)
struct sigaction handler;

/* altering the signal handler doesn't affect already queued signals on AIX */
if ((-1 == sigaction(SUSPEND_SIG, NULL, &handler)) || (handler.sa_sigaction != upcall_handler)) {
return;
}
#endif /* defined(AIXPPCX) */
#endif /* defined(AIXPPC) */

/* check that this signal was queued by this process. */
if ((SI_QUEUE != siginfo->si_code)
Expand Down

0 comments on commit 1762b07

Please sign in to comment.