|
From: Felix v. L. <fel...@fe...> - 2004-02-05 01:00:19
|
I just found valgrind 2.1 and saw that my 2.0 epoll diff no longer applies cleanly, so I mad a new one: http://www.fefe.de/diffs/valgrind-2.1-epoll.diff.bz2 Felix |
|
From: Nicholas N. <nj...@ca...> - 2004-02-05 09:51:30
Attachments:
epoll.patch
|
On Thu, 5 Feb 2004, Felix von Leitner wrote: > I just found valgrind 2.1 and saw that my 2.0 epoll diff no longer > applies cleanly, so I mad a new one: > > http://www.fefe.de/diffs/valgrind-2.1-epoll.diff.bz2 I took your old version and made a few changes, it's currently bouncing its way around the valgrind-developers list, and will hopefully be committed soon. I attach it for your perusal. There are a few differences to your patch, namely: - I have a POST(epoll_create), because it creates an fd which needs to be tracked for --track-fds=yes - I introduced "struct vki_epoll_event" into vg_kerneliface.h so that the size arg in epoll_ctl's SYSCALL_TRACK isn't done in terms of 32-bit words, which makes it more in line with the other syscall wrappers, and also to avoid #including <sys/epoll.h> which is a 2.6-only header file. - In POST(epoll_wait), I check if the result is > 0 before doing the SYSCALL_TRACK, and the size argument relies on the result, rather than arg3. Let me know if you think any of these changes are wrong. N |
|
From: Jeremy F. <je...@go...> - 2004-02-05 10:09:11
|
On Thu, 2004-02-05 at 01:51, Nicholas Nethercote wrote: > - In POST(epoll_wait), I check if the result is > 0 before doing the > SYSCALL_TRACK, and the size argument relies on the result, rather than > arg3. The check is redundant - POST(x) is never called if the syscall didn't succeed. J |
|
From: Nicholas N. <nj...@ca...> - 2004-02-05 10:27:19
|
On Thu, 5 Feb 2004, Jeremy Fitzhardinge wrote: > > - In POST(epoll_wait), I check if the result is > 0 before doing the > > SYSCALL_TRACK, and the size argument relies on the result, rather than > > arg3. > > The check is redundant - POST(x) is never called if the syscall didn't > succeed. It can succeed and still return 0; if it does, we don't want to to call post_mem_write because nothing has been written (and the size arg would be 0). N |
|
From: Jeremy F. <je...@go...> - 2004-02-05 10:31:15
|
On Thu, 2004-02-05 at 02:21, Nicholas Nethercote wrote: > On Thu, 5 Feb 2004, Jeremy Fitzhardinge wrote: > > > > - In POST(epoll_wait), I check if the result is > 0 before doing the > > > SYSCALL_TRACK, and the size argument relies on the result, rather than > > > arg3. > > > > The check is redundant - POST(x) is never called if the syscall didn't > > succeed. > > It can succeed and still return 0; if it does, we don't want to to call > post_mem_write because nothing has been written (and the size arg would be > 0). Ah, OK. J |
|
From: Nicholas N. <nj...@ca...> - 2004-02-05 21:50:28
|
On Thu, 5 Feb 2004, Jeremy Fitzhardinge wrote: > The check is redundant - POST(x) is never called if the syscall didn't > succeed. Jeremy, can you take a look at the patch and tell me whether the fd_allowed() call is needed in POST(epoll_create)? Thanks. N |
|
From: Jeremy F. <je...@go...> - 2004-02-05 23:31:28
|
On Thu, 2004-02-05 at 13:50, Nicholas Nethercote wrote: > On Thu, 5 Feb 2004, Jeremy Fitzhardinge wrote: > > > The check is redundant - POST(x) is never called if the syscall didn't > > succeed. > > Jeremy, can you take a look at the patch and tell me whether the > fd_allowed() call is needed in POST(epoll_create)? Thanks. fd_allowed is to check FDs as they're passed into syscalls; it shouldn't be necessary for FDs created by a syscall (ie, they should always be in a PRE(x)). J |