"rwxp" permissions for pthread stack and guard pages "---p" leak on ARM

Ravi Sankar ravisankar.g@gmail.com
Tue Oct 6 16:41:00 GMT 2009


Hello,

Using glibc-2.5, Linux 2.6.24 on ARM Cortex -A8.

I create a ntpl thread with attributes as "detached", and upon
finishing the start routine of the thread it just "returns". (no
pthread_exit call). Sometimes I observe that thread stack and its
guard pages are still visible using /proc/pid/maps entry even after
the thread exited. So in due course of time, as we keep on creating
such threads the process runs out of VM.

I would like to know,

1) Even though the thread was created as "detached" state, what makes
the kernel?, pthread? to keep the thread stack and resources even
after thread exit.
2) Why thread stack should have "rwx" permissions instead of "rw"?

Please let me know for any missing information.

--,
BR,
Ravi Sankar Guntur.



More information about the Binutils mailing list