[DragonFlyBSD - Bug #2925] (Closed) sendfile reports success but no data sent in special case

bugtracker-admin at leaf.dragonflybsd.org bugtracker-admin at leaf.dragonflybsd.org
Sun Jul 17 23:27:24 PDT 2016


Issue #2925 has been updated by tautolog.

Status changed from New to Closed
% Done changed from 0 to 100

Turns out my pf referenced "lo" instead of "lo0" for loopback device. The problem was a lack of acks. Thanks to sephe for the help figuring this out. :)

----------------------------------------
Bug #2925: sendfile reports success but no data sent in special case
http://bugs.dragonflybsd.org/issues/2925#change-12936

* Author: tautolog
* Status: Closed
* Priority: Normal
* Assignee: 
* Category: Kernel
* Target version: 4.2.x
----------------------------------------
When I send a small header with send() first, and then send a particular file with sendfile(), sendfile() will report success of all data sent, but not send any data to the socket, seemingly related to send length. I have created a minimal test case which reproduces the issue on my system.

I compile sendfile_case.c with:
$ cc -o sendfile_case sendfile_case.c

In another terminal, I run:
$ netcat -l -p 8089 > feed.log

In the first terminal, I run:
# ./sendfile_case
sbytes = 16275

It exits fine, showing the whole file contents being sent, but netcat will be hung, and only will have printed the header.

This code works fine on Linux and OS X (in my application, with IFDEFs for different sendfile argument semantics, of course). The minimal case only does the DragonFly sendfile() call (and probably FreeBSD). I actually bisected it to find the failure threshold:
16275 failed
16274 failed
4096 failed
2048 failed
1836 failed
1811 failed
1806 failed
1801 failed
1796 failed
1793 failed
1792 failed (multiple times)
1791 succeeded (multiple times)
1786 succeeded
1736 succeeded
1636 succeeded
1536 succeeded
1024 succeeded
100 succeeded

1791 sendfile bytes succeeds, and 1792 sendfile bytes fails. The previously sent header is 79 bytes, so 1870 total bytes succeeds, and 1871 total bytes failed. 

The version I am running is about 2 months old. I searched for changes to the system call since then, and searched here, and didn't see anything related.

$ uname -a
DragonFly fw.benwoolley.org 4.5-DEVELOPMENT DragonFly v4.5.0.954.g7ef02-DEVELOPMENT #6: Sun May 15 22:43:20 PDT 2016     ben at fw.benwoolley.org:/usr/obj/usr/src/sys/X86_64_GENERIC  x86_64

---Files--------------------------------
sendfile_case.data (15.9 KB)
sendfile_case.c (1.26 KB)
dump.bin (74.9 KB)
pf.conf (1.29 KB)


-- 
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://bugs.dragonflybsd.org/my/account



More information about the Bugs mailing list