Comments (14)
all leaked file descriptor number can be find from the strace call, all open by openat(AT_FDCWD, "/etc/resolv.conf|/etc/nsswitch.conf". (after one week , there is around 36000 leaked fd, reach the ulimit then app no response)
from curl.
Is this the same as #13341 ?
You mention c-ares, which version?
from curl.
I am not sure they are related to #13341
Test confirm with c-ares 1.28.1
and 1.28
.
beside the file descriptor leak problem, I want to skip the c-ares openat(AT_FDCWD, "/etc/resolv.conf|/etc/nsswitch.conf") step, to verify if them still leak. (not sure how to do this)
from curl.
Please explain how to reproduce this problem. I cannot make it happen and this is not a known issue.
I've reproduced my tests from #13341 with c-ares 1.28.1 and I see no leaks whatsoever.
from curl.
I am working on a minimal test case. before that, I try with http://ip without CURLOPT_RESOLVE, but use CURLOPT_HTTPHEADER to set the hostname.
It is http with ip ( no ssl).
Why I still get this syscall:
open("/etc/resolv.conf", O_RDONLY|O_LARGEFILE) = 29
lseek(29, 0, SEEK_END) = 21
lseek(29, 0, SEEK_CUR) = 21
lseek(29, 0, SEEK_SET) = 0
readv(29, [{iov_base="nameserver 8.8.8.8", iov_len=20}, {iov_base="\n", iov_len=1024}], 2) = 21
close(29) = 0
open("/etc/nsswitch.conf", O_RDONLY|O_LARGEFILE) = 29
lseek(29, 0, SEEK_END) = 494
lseek(29, 0, SEEK_CUR) = 494
lseek(29, 0, SEEK_SET) = 0
readv(29, [{iov_base="# /etc/nsswitch.conf\n#\n# Example"..., iov_len=493}, {iov_base="\n", iov_len=1024}], 2) = 494
close(29) = 0
open("/etc/netsvc.conf", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/etc/svc.conf", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
getrandom("\xa0\x1e\xf2\x03\xe2\x51\x13\x5b\x95\x2d\xf5\xd6\x18\xbf\x7b\x84\x5d\x64\x2f\xe1\x83\xba\x61\x8d\x7a\x2c\x15\x40\x17\x60\x3b\x41"..., 256, 0) = 256
uname({sysname="Linux", nodename="test1", ...}) = 0
rt_sigaction(SIGPIPE, NULL, {sa_handler=SIG_IGN, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x350f27}, 8) = 0
rt_sigaction(SIGPIPE, {sa_handler=SIG_IGN, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x350f27}, NULL, 8) = 0
poll([{fd=33, events=POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND}], 1, 0) = 0 (Timeout)
from curl.
Why I still get this syscall:
Your list shows several syscalls. Which one are you asking about?
from curl.
all of t syscalls before rt_sigaction.
Because when I connect a IP without ssl, they are not needed.
from curl.
Those are name server config files so I would presume they are loaded by c-ares. Probably done unconditionally of the name resolve. Hardly relevant for this issue though...
from curl.
-
the app send 39692 request every minute. for each request there is 16 syscall unnecessary.
-
all leaked fd is related to those fd open by "/etc/resolv.conf|/etc/nsswitch.conf", I want to test if there still leaked fd without them
tail -n 1000000 app_log.json | grep '2024-04-11T19:10'|wc
39692 158768 27688591
from curl.
tail -n 100000 app_log.json | grep '2024-04-11T19:15'|wc
38398 153592 26739507
for every sec, 10239 syscall unnecessary. (I start 2 stand alone app, app use single thread)
from curl.
Those are name server config files so I would presume they are loaded by c-ares. Probably done unconditionally of the name resolve. Hardly relevant for this issue though...
In my case, no DNS is needed since I use IP as url address. so I want to know if we can skip the c-ares related call from curl side.
from curl.
tail -n 100000 app_log.json | grep '2024-04-11T19:15'|wc 38398 153592 26739507for every sec, 10239 syscall unnecessary. (I start 2 stand alone app, app use single thread)
This is wrong number. after I count the syscall call from strace, I think they are called for every new connection. (not every request)
from curl.
We will welcome your optimizations, thank you.
In the mean time, this issue is about a file descriptor leak I have not managed to reproduce.
from curl.
after more test I confirm the fd leaked problem is not a curl issue. sorry for the miss report.
from curl.
Related Issues (20)
- version 8.7.1 fails to compile for IOS SDK 17.2 HOT 5
- Version 8.6.0 and 8.7.1 fails to compile for CentOS 7 HOT 2
- Please consider --ca-native for OpenSSL by default on Windows HOT 2
- version 8.7.0 and 8.7.1 don't compile against OpenSSL 1.1.0h on Linux HOT 3
- Change in behaviour for duplicate "Transfer-Encoding = chunked" headers HOT 3
- Please update tiny-curl HOT 1
- SOCKS problem with 8.7.0+ HOT 22
- test 345 fails on AppVeyor HOT 2
- Unable to upload file with curl when --limit-rate is set to specific value HOT 3
- GitHub actions major outage/problem HOT 2
- `git clone` hangs with curl-8.7.1 HOT 7
- wolfSSL HTTP/3 peer verification is lacking HOT 4
- Ambiguous error message when decompressing brotli stream HOT 2
- CURL_VERSION_GSSAPI is not display on curl tool. HOT 4
- Bug in Debian (curl-8.7.1) leads to Failed writing received data to disk/application HOT 10
- Error 451 when transfering certain files using FTPS\TLS1.3 HOT 1
- Fail during configure if perl is missing but required HOT 5
- Windows DNS resolution: Curl crash when GetAddrInfoExW callback invoked on shutdown HOT 7
- CURLOPT_SSLVERSION: C++20 deprecation warning when values of two enums are combined HOT 1
- Sign the un-preprocessed `git archive` .tar.gz
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from curl.