Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 227793 - dev-libs/dietlibc-[0.30-r2|0.31] mmap() problem
Summary: dev-libs/dietlibc-[0.30-r2|0.31] mmap() problem
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo VPS Team (OBSOLETE)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 227429
  Show dependency tree
 
Reported: 2008-06-17 12:18 UTC by Luca Lesinigo
Modified: 2008-11-16 22:01 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
test case (diet-mmap-test.tgz,1.03 KB, application/octet-stream)
2008-06-17 12:19 UTC, Luca Lesinigo
Details
patch to fix on HPPA (dietlibc-hppa_mmap.diff,425 bytes, patch)
2008-11-02 20:11 UTC, Luca Lesinigo
Details | Diff
ebuild to apply the fix on HPPA only (dietlibc-0.32_pre20080829.ebuild,1.58 KB, text/plain)
2008-11-02 20:17 UTC, Luca Lesinigo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Luca Lesinigo 2008-06-17 12:18:29 UTC
The mmap() function of dietlibc-0.30-r2 (stable in portage) and -0.31 (bug #227429) will always fail with ENODEV in some circumstances.

The mmap_test.c included with the lib could be used as a test case but it must be compiled with LargeFile support. The bug will not show up without LargeFile.

So far I found this only on hppa, changing or removing CFLAGS doesn't make any difference. daniel_hozac of #vserver/OFTC (thanks for help) says other archs should be unaffected since parisc is the only one with different syscall functions.

Tested so far, with bug:
dietlibc-0.30-r1 gcc-4.1.1 HPPA
dietlibc-0.30-r1 gcc-4.1.2 HPPA
dietlibc-0.31    gcc-4.1.2 HPPA

Tested so far, without bug:
dietlibc-0.31    gcc-3.4.6 x86_64/hardenedtoolchain
dietlibc-0.29-8  gcc-4.0?  i386 (ubuntu 6.06.2 precompiled deb)
Comment 1 Luca Lesinigo 2008-06-17 12:19:26 UTC
Created attachment 157255 [details]
test case

This is a quick script that'll use dietlibc's mmap_test.c to check for the issue.
Comment 2 Luca Lesinigo 2008-09-16 20:09:47 UTC
dev-libs/dietlibc-0.32_pre20080829 still uncorrected
Comment 3 Luca Lesinigo 2008-11-02 20:11:40 UTC
Created attachment 170570 [details, diff]
patch to fix on HPPA
Comment 4 Luca Lesinigo 2008-11-02 20:17:08 UTC
Created attachment 170572 [details]
ebuild to apply the fix on HPPA only

the included ebuild will apply the patch only when compiling on HPPA to fix the mmap() issue. Many thanks to Bertl of #vserver @ OFTC for providing the fix.

The patch will probably mess up other archs so in the ebuild I only apply it when USE=hppa.

Upstream (fefe.de) has already been informed of this but I think we'll have to fix the problem by ourselves for some time before a properly fixed dietlibc will come out.
Comment 5 Guy Martin (RETIRED) gentoo-dev 2008-11-15 14:00:14 UTC
vserver guys ? Anyone please to commit this simple fix ?

Do you want me to commit it ?
I'd really like to get this fixed on hppa.

Thanks
Comment 6 Benedikt Böhm (RETIRED) gentoo-dev 2008-11-16 14:14:32 UTC
i have merged the latest changes from upstream and the mmap patch into 0.32_pre20081116, please give it a try
Comment 7 Luca Lesinigo 2008-11-16 19:59:35 UTC
dev-libs/dietlibc-0.32_pre20081116 compiles fine on HPPA with:
 CFLAGS="-pipe -O2 -march=2.0"
 MAKEOPTS="-j3"
 glibc-2.7-r2
 both gcc-4.2.4 and gcc-4.3.2

the mmap() issue of this bug is solved as proved by the attached test case.
it still suffers bug #221961

as example of a working application, after putting in place the workaround for #221961 (symlink) sys-cluster/util-vserver will compile and run fine.

please note that if you used the patch I included in this report, it'll probably mess up other archs, so you'll need to test it on non-hppa systems to be sure. that's why I conditionally included the patch from the ebuild only on hppa.

thanks.
Comment 8 Benedikt Böhm (RETIRED) gentoo-dev 2008-11-16 22:01:51 UTC
(In reply to comment #7)
> please note that if you used the patch I included in this report, it'll
> probably mess up other archs, so you'll need to test it on non-hppa systems to
> be sure. that's why I conditionally included the patch from the ebuild only on
> hppa.

i added #ifdef __hppa__ around the syscall, so it only applies for hppa