Rust fails in
thread.rs as follows:
...........
let mut guardsize = 0;
assert_eq!(libc::pthread_attr_getguardsize(&attr, &mut guardsize), 0);
if guardsize == 0 {
panic!("there is no guard page");
}
...........
Before the patch the guardsize was taken from the pagesize, as in:
*guard = (size_t)sysconf(_SC_PAGESIZE);
After the patch this became:
*guard = pthread__guardsize;
from the global, which is initialized elsewhere in pthread.c:
---
mib[0] = CTL_VM;
mib[1] = VM_THREAD_GUARD_SIZE;
len = sizeof(value);
if (sysctl(mib, __arraycount(mib), &value, &len, NULL, 0) == 0)
pthread__guardsize = value;
else
pthread__guardsize = pthread__pagesize;
---
There is no invocation of pthread_set_guardsize in rustc, so it should be getting the default from the sysctl, i.e. 65536, but for some reason it is getting a zero. I maybe missing something obvious, I couldn't see it by reading only.
Chavdar