Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 218320 - splice with SPLICE_F_NONBLOCK returns -1 EAGAIN on writeable pipes
Summary: splice with SPLICE_F_NONBLOCK returns -1 EAGAIN on writeable pipes
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: 6
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Kernel Maintainer List
QA Contact: Brian Brock
Depends On:
Blocks: 427887
TreeView+ depends on / blocked
Reported: 2006-12-04 17:33 UTC by James Antill
Modified: 2008-02-08 04:28 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2008-02-08 04:28:59 UTC

Attachments (Terms of Use)
Test splice call and flags. (deleted)
2006-12-04 17:33 UTC, James Antill
no flags Details

Description James Antill 2006-12-04 17:33:17 UTC
Description of problem:
 Although there is no documentation on splice() I assume that SPLICE_F_NONBLOCK
is supposed to be the same as having a nonblocking flag on the pipe ... this
isn't so, with the SPLICE_F_NONBLOCK flag splice() can return -1 EAGAIN when
poll() says the pipe is ready to accept data.

poll([{fd=4, events=POLLOUT, revents=POLLOUT}, {fd=6, events=POLLOUT,
revents=POLLOUT}], 2, -1) = 2
SYS_313(0x7, 0, 0x4, 0, 0x3d060000)     = -1 EAGAIN (Resource temporarily
SYS_313(0x9, 0, 0x6, 0, 0x618e000)      = -1 EAGAIN (Resource temporarily

...I've included a test program.
 Note that even if I'm wrong in my assumption of what SPLICE_F_NONBLOCK does,
the only other thing I could imagine is that it is doing a real nonblock on the
page cache too ... and I've included readahead() calls which should "fix" that
(although not having a working poll() would make that definition much less useful).

Version-Release number of selected component (if applicable):
% uname -a                                        ~/glibc-tst-rpms
Linux 2.6.18-1.2849.fc6 #1 SMP Fri Nov 10 12:45:28 EST 2006 i686
athlon i386 GNU/Linux

...note that although the syscall is in glibc FC6, it's broken (fixed in
rawhide) if you have a rawhide/test glibc and want to make sure it's not that
just change the LOCAL_SPLICE define -- I've done this in my testing.

How reproducible:

Additional info:
 See the attached splice test application. Note that if you change
USE_O_NONBLOCK_R from 0 to 1 and USE_SPLICE_NONBLOCK_R from 1 to 0, the test
program will use fcntl() O_NONBLOCK instead of the SPLICE_F_NONBLOCK flag which
does the exected thing.

 Use it like:

./splicetst /tmp/big_1GB /tmp/o1 /tmp/big_100MB /tmp/o2

Comment 1 James Antill 2006-12-04 17:33:18 UTC
Created attachment 142752 [details]
Test splice call and flags.

Comment 2 Jon Stanley 2008-01-08 01:50:49 UTC
(This is a mass-update to all current FC6 kernel bugs in NEW state)


I'm reviewing this bug list as part of the kernel bug triage project, an attempt
to isolate current bugs in the Fedora kernel.

I am CC'ing myself to this bug, however this version of Fedora is no longer

Please attempt to reproduce this bug with a current version of Fedora (presently
Fedora 8). If the bug no longer exists, please close the bug or I'll do so in a
few days if there is no further information lodged.

Thanks for using Fedora!

Comment 3 Jon Stanley 2008-02-08 04:28:59 UTC
Per the previous comment in this bug, I am closing it as INSUFFICIENT_DATA,
since no information has been lodged for over 30 days.

Please re-open this bug or file a new one if you can provide the requested data,
and thanks for filing the original report!

Note You need to log in before you can comment on or make changes to this bug.