[lkml]   [2001]   [Sep]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRE: Different old_mmap behavior between 2.4.5 and 2.4.8
> On Mon, Sep 10, 2001 at 06:30:55PM -0700, Bao C. Ha wrote:
> > Is this supposed to be the correct behavior? What changes
> > make the newer kernels to return different pointers? We
> > are running on the sh4 architecture but I think these calls
> > come from malloc() which should be arch-independent.
> The result from earlier kernels is wrong. If your code
> requires that the same address is returned as was specified
> then you need to pass in the MAP_FIXED flag.

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

In function pthread_allocate_stack(), file manager.c:
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,
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.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:03    [W:0.037 / U:0.576 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site