Skip to content
  • Deucе's avatar
    4fc3e1db
    Fix egregious race/infinite loop bug for FreeBSD and NetBSD · 4fc3e1db
    Deucе authored
    The allocator has a loop trying to map an aligned page, and there's
    an obvious (and commented-on) race condition in it.  The purpose
    is apparently to get an aligned allocation using mmap().
    
    For FreeBSD and NetBSD, we can simply pass the desired alignment
    to mmap() and we're good.
    
    Other platforms are still hosed though.
    
    This generally didn't happen, but something about FreeBSD 14.2 on
    a many core (16+HT) system causes it to park in the loop and stay
    there, adding new threads to to fun as it goes along.
    
    This uses MAP_ALLOCED() if defined avoid the loop completely.
    We'll see if it works soon enough.
    4fc3e1db
    Fix egregious race/infinite loop bug for FreeBSD and NetBSD
    Deucе authored
    The allocator has a loop trying to map an aligned page, and there's
    an obvious (and commented-on) race condition in it.  The purpose
    is apparently to get an aligned allocation using mmap().
    
    For FreeBSD and NetBSD, we can simply pass the desired alignment
    to mmap() and we're good.
    
    Other platforms are still hosed though.
    
    This generally didn't happen, but something about FreeBSD 14.2 on
    a many core (16+HT) system causes it to park in the loop and stay
    there, adding new threads to to fun as it goes along.
    
    This uses MAP_ALLOCED() if defined avoid the loop completely.
    We'll see if it works soon enough.
Loading