_dl_pagesize and _dl_dprintf();

Filippo ARCIDIACONO filippo.arcidiacono at st.com
Thu Jul 15 07:31:06 UTC 2010


 

> -----Original Message-----
> From: uclibc-bounces at uclibc.org 
> [mailto:uclibc-bounces at uclibc.org] On Behalf Of Rob Landley
> Sent: Wednesday, July 14, 2010 1:58 AM
> To: uClibc
> Subject: _dl_pagesize and _dl_dprintf();
> 
> The _dl_dprintf() code in ldso/ldso/dl-elf.c is checking the 
> fmt argument against _dl_pagesize, but _dl_pagesize is initialized in
> _dl_get_ready_to_run() and that's called from the _end_ of 
> DL_START(), which I think means most of the DL_DEBUG calls 
> are bounds checking using random garbage out of an 
> uninitialized variable.
> 
> Can anybody confirm this?
No. I cannot. After initializing the _dl_pagesize the _dl_debug_early is called.
It uses the _dl_dprintf.

Note that in DL_START func all macros (SEND_EARLY_STDERR_DEBUG, SEND_STDERR_DEBUG ...) 
Used for printing messages are done by means of _dl_write syscall. No _dl_dprintf is called!

> 
> (I hit this because when I switched on DL_DEBUG I got 
> "overflow" for no obvious
> reason.)

IMO you should check if the _dl_pagesize is correctly set by
"_dl_pagesize = (auxvt[AT_PAGESZ].a_un.a_val) ? (size_t) auxvt[AT_PAGESZ].a_un.a_val : PAGE_SIZE;"
In _dl_get_ready_to_run() func.

> 
> Rob

Regards,
Filippo.
> --
> GPLv3: as worthy a successor as The Phantom Meanace, as 
> timely as Duke Nukem Forever, and as welcome as New Coke.
> _______________________________________________
> uClibc mailing list
> uClibc at uclibc.org
> http://lists.busybox.net/mailman/listinfo/uclibc
> 


More information about the uClibc mailing list