[Bugs] [Bug 1636570] Cores due to SIGILL during multiplex regression tests

bugzilla at redhat.com bugzilla at redhat.com
Mon Nov 26 08:21:53 UTC 2018


Nithya Balachandran <nbalacha at redhat.com> changed:

           What    |Removed                     |Added
                 CC|                            |nbalacha at redhat.com

--- Comment #1 from Nithya Balachandran <nbalacha at redhat.com> ---

in posix_fini:
    if (priv->health_check_active) {
        priv->health_check_active = _gf_false;
        pthread_cancel(priv->health_check);    <--- this is not synchronous, so
posix_fini will continue after calling this. From the man page:
"the return status of pthread_cancel() merely informs the caller whether the
cancellation request was successfully queued."
        priv->health_check = 0;

In posix_health_check_thread_proc ()

    while (1) {
        /* aborting sleep() is a request to exit this thread, sleep()
         * will normally not return when cancelled */
        ret = sleep(interval);
        if (ret > 0)
        /* prevent thread errors while doing the health-check(s) */
        pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);  
   <---- if the pthread_cancel is sent here, the thread will continue running
until the cancel state is enabled again or it hits a cancellation point.
        /* Do the health-check.*/
        ret = posix_fs_health_check(this);
        if (ret < 0 && priv->health_check_active)
            goto abort;
        if (!priv->health_check_active)
            goto out;
        pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);

posix_fini needs to wait for the thread to exit before it cleans up priv. The
thread is a detached thread so one easy way to solve this is to change that to
a joinable thread and wait until it returns before proceeding with the fini.

You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.

More information about the Bugs mailing list