brho / akaros

Akaros Operating System
http://akaros.cs.berkeley.edu/
Other
314 stars 61 forks source link

pthread_mutex_init crashes with NULL attr #40

Closed dvyukov closed 7 years ago

dvyukov commented 7 years ago
#include <pthread.h>
int main()
{
    pthread_mutex_t mu;
    pthread_mutex_init(&mu, 0);
    return 0;
}

crashes with NULL deref on first instruction of pthread_mutex_init which tries to dereference the attr.

POSIX explicitly allows NULL attr: http://pubs.opengroup.org/onlinepubs/7908799/xsh/pthread_mutex_init.html

akaros is on 6344ed04e307ba30df879d1d407b10a1b3236784.