Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 Oct 2015 07:36:33 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   [Bug 203852] emulators/qemu-user-static: mmap may return NULL instead of MAP_FAILED to indicate error
Message-ID:  <bug-203852-13@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=203852

            Bug ID: 203852
           Summary: emulators/qemu-user-static: mmap may return NULL
                    instead of MAP_FAILED to indicate error
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: Individual Port(s)
          Assignee: nox@FreeBSD.org
          Reporter: eugen@grosbein.net
             Flags: maintainer-feedback?(nox@FreeBSD.org)
          Assignee: nox@FreeBSD.org

While using qemu-mips-static to build packages for MIPS32 platform, I have
found the following problem:

1) mmap(2) system call returns NULL (0) instead of MAP_FAILED (-1) when len==0.
2) install(1) system utility tries to use mmap() to read source file if it
resides on UFS of CD9660 file system and its size is less than 8 megabytes
3) install checks for MAP_FAILED mmap result but not for NULL. Then is passes
NULL pointer to write(2) system call and it fails with EFAULT, breaking
install(1).
4) print/texinfo is needed to build gmake using HEAD world and texinfo calls
install(1) for zero length file. So, install fails and package build fails.

How-to-Repeat: use UFS and command "touch file && install file newfile" using
qemu-mips-static

-- 
You are receiving this mail because:
You are the assignee for the bug.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-203852-13>