Bug 189762 - epoll_create syscall not handled
Summary: epoll_create syscall not handled
Status: RESOLVED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: sgcheck (show other bugs)
Version: 3.4.1
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: wanted3.5.0
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-16 01:07 UTC by Robert Hancock
Modified: 2012-08-10 14:04 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Hancock 2009-04-16 01:07:13 UTC
Looks like ptrcheck doesn't handle the epoll_create system call:

sysno == 254

exp-ptrcheck: the 'impossible' happened:
   unhandled syscall
==7181==    at 0x3800EB9B: report_and_quit (m_libcassert.c:140)
==7181==    by 0x3800EC5A: panic (m_libcassert.c:215)
==7181==    by 0x3800ECC1: vgPlain_tool_panic (m_libcassert.c:230)
==7181==    by 0x38003E4E: h_post_syscall (h_main.c:2486)
==7181==    by 0x3802F73B: vgPlain_post_syscall (syswrap-main.c:1178)
==7181==    by 0x3802FC77: vgPlain_client_syscall (syswrap-main.c:1090)
==7181==    by 0x3802D986: vgPlain_scheduler (scheduler.c:824)
==7181==    by 0x38030BBE: run_a_thread_NORETURN (syswrap-linux.c:89)

sched status:
  running_tid=1

Thread 1: status = VgTs_Runnable
==7181==    at 0x82E5E2: epoll_create (in /lib/tls/libc-2.3.4.so)
==7181==    by 0x4643DB0: MCON_FDConn_Handler_EPoll::default_instance() (mcon_fdconn_handler_epoll.C:155)

(rest of stack trace is our code)

running on:
Linux daudc1 2.6.9-42.ELsmp #1 SMP Sat Aug 12 09:39:11 CDT 2006 i686 i686 i386 GNU/Linux
Comment 1 Nick Black 2009-07-14 00:31:57 UTC
Just a heads-up: there's also now epoll_create1(), which interprets the single integer parameter as a flags argument (ala accept4() and friends):

--607-- WARNING: unhandled syscall: 291
--607-- You may be able to write your own handler.
--607-- Read the file README_MISSING_SYSCALL_OR_IOCTL.
--607-- Nevertheless we consider this a bug.  Please report
--607-- it at http://valgrind.org/support/bug_reports.html.

code:

#ifdef EPOLL_CLOEXEC
        {
                int trueflags = 0;

                if(flags & LIBDANK_EVHANDLER_CLOEXEC){
                        trueflags |= EPOLL_CLOEXEC;
                }
                if(flags & LIBDANK_EVHANDLER_NONBLOCK){
                        trueflags |= EPOLL_NONBLOCK;
                }
                if((fd = epoll_create1(trueflags)) < 0){
                        moan("Couldn't create epoll fd with flags %x\n",flags);
                        return NULL;
                }
        }
#else
Comment 2 Tom Hughes 2009-07-14 00:45:57 UTC
Support for epoll_create1 in the core (not ptrcheck) was added a few days ago in r10427.
Comment 3 Tom Hughes 2009-07-27 16:22:47 UTC
Support for epoll_create and epoll_create1 in ptrcheck committed as r10635.