Unfortunately, it is the linuxthreads code that is broken
on the sh4 platform. It seems that the pointers are moved
due to cache aliasing. I am trying to raise awareness that
this is breaking pthreads applications on sh4-linux.
Following is the relevant segment of linuxthreads that is
broken:
In function pthread_allocate_stack(), file manager.c:
.......
# ifdef _STACK_GROWS_DOWN
new_thread = default_new_thread;
new_thread_bottom = (char *) (new_thread + 1) - stacksize;
map_addr = new_thread_bottom - guardsize;
res_addr = mmap(map_addr, stacksize + guardsize,
PROT_READ | PROT_WRITE | PROT_EXEC,
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (res_addr != map_addr)
{
/* Bad luck, this segment is already mapped. */
if (res_addr != MAP_FAILED)
munmap (res_addr, stacksize + guardsize);
return -1;
}
.......
We resort to patching the MAP_FIXED back to linuxthreads
until we get a resolution on this problem.
Thanks.
Bao
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/