Fix unhandled syscall: unix:132 (mkfifo) on OS X. bz#212291.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15242
This commit is contained in:
Rhys Kidd 2015-05-16 14:48:08 +00:00
parent 47679c86e7
commit 0c10aa2460
5 changed files with 40 additions and 3 deletions

2
NEWS
View File

@ -76,6 +76,8 @@ where XXXXXX is the bug number as listed below.
201435 Fix Darwin: -v does not show kernel version
211256 Fixed an outdated comment regarding the default platform.
211926 Avoid compilation warnings in valgrind.h with -pedantic
212291 Fix unhandled syscall: unix:132 (mkfifo) on OS X
== 263119
226609 Crediting upstream authors in man page
231257 Valgrind omits path when executing script from shebang line
254164 OS X task_info: UNKNOWN task message [id 3405, to mach_task_self(),

View File

@ -189,7 +189,7 @@ DECL_TEMPLATE(darwin, getsockopt); // 118
// old truncate
// old ftruncate
// GEN flock 131
// NYI mkfifo 132
DECL_TEMPLATE(darwin, mkfifo); // 132
DECL_TEMPLATE(darwin, sendto); // 133
DECL_TEMPLATE(darwin, shutdown); // 134
DECL_TEMPLATE(darwin, socketpair); // 135

View File

@ -3590,6 +3590,25 @@ POST(accept)
SET_STATUS_from_SysRes(r);
}
PRE(mkfifo)
{
*flags |= SfMayBlock;
PRINT("mkfifo ( %#lx(%s), %ld )",ARG1,(char *)ARG1,(vki_mode_t)ARG2);
PRE_REG_READ2(long, "mkfifo", const char *, path, vki_mode_t, mode);
PRE_MEM_RASCIIZ( "mkfifo(path)", ARG1 );
}
POST(mkfifo)
{
vg_assert(SUCCESS);
if (!ML_(fd_allowed)(RES, "mkfifo", tid, True)) {
VG_(close)(RES);
SET_STATUS_Failure( VKI_EMFILE );
} else {
if (VG_(clo_track_fds))
ML_(record_fd_open_with_given_name)(tid, RES, (Char*)ARG1);
}
}
PRE(sendto)
{
@ -9479,7 +9498,7 @@ const SyscallTableEntry ML_(syscall_table)[] = {
_____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(129)), // old truncate
_____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(130)), // old ftruncate
GENX_(__NR_flock, sys_flock),
// _____(__NR_mkfifo),
MACX_(__NR_mkfifo, mkfifo),
MACX_(__NR_sendto, sendto),
MACX_(__NR_shutdown, shutdown),
MACXY(__NR_socketpair, socketpair),

View File

@ -259,7 +259,10 @@ int main(void)
GO_UNIMP(130, "old ftruncate");
// __NR_flock 131
// __NR_mkfifo 132
GO(__NR_mkfifo, 132, "2s 1m");
SY(__NR_mkfifo, x0, x0); FAIL;
// __NR_sendto 133
// __NR_shutdown 134
// __NR_socketpair 135

View File

@ -384,6 +384,19 @@ Syscall param socketcall.getsockopt(optlen) points to unaddressable byte(s)
-----------------------------------------------------
-----------------------------------------------------
(130): old ftruncate
-----------------------------------------------------
-----------------------------------------------------
x2000084(132): __NR_mkfifo 2s 1m
-----------------------------------------------------
Syscall param mkfifo(mode) contains uninitialised byte(s)
...
by 0x........: main (in ./scalar)
Syscall param mkfifo(path) points to unaddressable byte(s)
...
by 0x........: main (in ./scalar)
Address 0x........ is not stack'd, malloc'd or (recently) free'd
-----------------------------------------------------
-----------------------------------------------------
(141): old getpeername