2011/1/8, Eric B Munson <emun...@mgebm.net>: > On Fri, 07 Jan 2011, jia zhang wrote: > >> [V2 PATCH] an alignment bug when both LD_PRELOAD and >> HUGETLB_FORCE_ELFMAP are enabled >> >> If program header's p_vaddr is aligned with hpage size, >> hugetlb_slice_end(vaddr) >> returns vaddr-1, and thus such a error appears, >> >> INFO: Segment 2's aligned memsz is too small: 0x485d4 < 0xffffffff >> >> slice_end should point to the correct end address of next slice. >> >> Signed-off-by: Lans Zhang <jia.zhang2...@gmail.com> > > On what architecture are you using FORCE_PRELOAD with segement remapping?
On x86_32. > > Have you tested that this does not break remapping in the supported method? Yes. Actually libhugetlbfs works well with normal remapping method. I just tried to use LD_PRELOAD+HUGETLB_FORCE_ELFMAP and see what happens :) I just concern (unsinged long)(slice_end - vaddr) returns -1(0xffffffff). Thanks, lz > > Eric >> --- >> elflink.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> --- a/elflink.c >> +++ b/elflink.c >> @@ -765,14 +765,14 @@ >> */ >> vaddr = hugetlb_next_slice_start(info->dlpi_phdr[i].p_vaddr); >> gap = vaddr - info->dlpi_phdr[i].p_vaddr; >> - slice_end = hugetlb_slice_end(vaddr); >> + slice_end = hugetlb_slice_end(vaddr + 1); >> /* >> * we should stop remapping just before the slice >> * containing the end of the memsz portion (taking away >> * the gap of the memsz) >> */ >> memsz = info->dlpi_phdr[i].p_memsz; >> - if (memsz < gap) { >> + if (memsz <= gap) { >> INFO("Segment %d's unaligned memsz is too small: " >> "%#0lx < %#0lx\n", >> i, memsz, gap); >> >> ------------------------------------------------------------------------------ >> Gaining the trust of online customers is vital for the success of any >> company >> that requires sensitive data to be transmitted over the Web. Learn how >> to >> best implement a security strategy that keeps consumers' information >> secure >> and instills the confidence they need to proceed with transactions. >> http://p.sf.net/sfu/oracle-sfdevnl >> _______________________________________________ >> Libhugetlbfs-devel mailing list >> Libhugetlbfs-devel@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/libhugetlbfs-devel >> > ------------------------------------------------------------------------------ Gaining the trust of online customers is vital for the success of any company that requires sensitive data to be transmitted over the Web. Learn how to best implement a security strategy that keeps consumers' information secure and instills the confidence they need to proceed with transactions. http://p.sf.net/sfu/oracle-sfdevnl _______________________________________________ Libhugetlbfs-devel mailing list Libhugetlbfs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libhugetlbfs-devel