[Bug 223165] Crash with pthread_condattr_destroy(NULL) on freebsd-11

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sun Oct 22 11:16:37 UTC 2017


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=223165

            Bug ID: 223165
           Summary: Crash with pthread_condattr_destroy(NULL) on
                    freebsd-11
           Product: Base System
           Version: 11.0-STABLE
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: kern
          Assignee: freebsd-bugs at FreeBSD.org
          Reporter: rajendra.sy at gmail.com

Below program crashes on FreeBSD-11.

$ cat test.c
#include <pthread.h>
int main(int argc, char *argv[]) {
        pthread_condattr_destroy(NULL);
        return 0;
}
$ clang -o test test.c -lpthread
test.c:3:31: warning: null passed to a callee that requires a non-null argument
[-Wnonnull]
        pthread_condattr_destroy(NULL);
                                 ~~~~^
1 warning generated.

syrajendra@[bm64-fbsd11] # ./test
Segmentation fault (core dumped)


The "pthread_condattr_destroy" has a argument which has _Nonnull quilifier but
the function implementation properly handles the NULL value by returning
"EINVAL" if argument is NULL.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list