|
a03f0f8a
|
2020-07-05T11:59:32
|
|
test: fix leak in dns/getaddrinfo_cancel_stress
Some requests may get response (evutil_addrinfo) from gaic_server_cb,
in case of cancel_event (10000ms) will not be fast enough.
(cherry picked from commit 90bcf2d660b9b43cb8e747421d4938f08f935bd7)
|
|
777cc2b6
|
2020-07-05T11:45:56
|
|
test: fix UB in evbuffer/empty_reference_prepend_buffer
UBSAN reports:
test/regress_buffer.c:2360:2: runtime error: null pointer passed as argument 1, which is declared to never be null
/usr/include/string.h:140:33: note: nonnull attribute specified here
(cherry picked from commit ba19b356bf8a9be2a5bddfa264dee61ffc9573a7)
|
|
82ae28e1
|
2020-07-05T11:14:18
|
|
test: really disable bufferevent_pair_release_lock under ASAN (and fix gcc)
(cherry picked from commit 7b9ba3b717af109abdf3fb5fc99c288dc8024ef5)
|
|
ff67e8c2
|
2020-07-05T11:08:05
|
|
test-closed: fix leak
(cherry picked from commit e2f938c04f9a72f6fd6ca9b7a8219ca9cb409d69)
|
|
4d3ff29c
|
2020-06-26T10:35:44
|
|
test: add getaddrinfo(AI_ADDRCONFIG) test (off by default)
(cherry picked from commit 0ac3cfc0b70edc2cfb429712d6aaf1b3a63d2d1a)
|
|
ccd67243
|
2020-06-25T21:56:31
|
|
test: fix memory leaks for https (add BEV_OPT_CLOSE_ON_FREE)
- http/https_filter_basic
- http/https_filter_chunk_out
(cherry picked from commit ec94a6bb3f9d950101d07b2a2e092b675d5aa3f0)
|
|
3c2c856d
|
2020-06-25T21:40:40
|
|
test: "fix" (with a quirk) leak in ssl/bufferevent_wm (w/o defer callbacks)
(cherry picked from commit cdbb2373f4d13f7a5eb69daaf0a172779ccc0040)
|
|
66341e84
|
2020-06-25T21:25:51
|
|
test: disable bufferevent/bufferevent_pair_release_lock under ASAN (too tricky)
And cannot be suppressed with suppressions due to setup routines.
(cherry picked from commit 3b13a64789b3942608f04c31455668bebe224a40)
|
|
19a68bd1
|
2020-06-25T21:01:53
|
|
test: detect test failures if atexit handler calls _exit(!0) (sanitizers)
tinytest uses another way of detecting test failures, it uses pipe
between child and parent, and if the test function in child returns OK
it writes OK flag into pipe, and reads it in parent.
However sanitizers uses atexit handlers to detect leaks, and this will
not detect failures in case of exit() will be called from the atexit
handlers, fix this by checking status after waitpid().
(cherry picked from commit 6754740f15e8200a12605a2e707fc6d3e6754d6a)
|
|
5b063049
|
2020-06-25T10:15:01
|
|
buffer: do not pass NULL to memcpy() from evbuffer_pullup()
UBSAN reports:
evbuffer/remove_buffer_with_empty3: ../buffer.c:1443:3: runtime error: null pointer passed as argument 2, which is declared to never be null
#0 0x7ffff6cd0410 in evbuffer_pullup ../buffer.c:1443
#1 0x5555556d68b9 in test_evbuffer_remove_buffer_with_empty3 ../test/regress_buffer.c:408
#2 0x5555557b95ee in testcase_run_bare_ ../test/tinytest.c:173
#3 0x5555557ba048 in testcase_run_one ../test/tinytest.c:333
#4 0x5555557bc0f8 in tinytest_main ../test/tinytest.c:527
#5 0x555555787702 in main ../test/regress_main.c:528
#6 0x7ffff606c001 in __libc_start_main (/usr/lib/libc.so.6+0x27001)
#7 0x55555569436d in _start (/src/le/libevent/.cmake-debug/bin/regress+0x14036d)
(cherry picked from commit a0c642ac04487d8cda809bd6e233b0fbd043806d)
|
|
a91abd0e
|
2020-06-25T09:59:35
|
|
test: do not pass NULL to memcmp() in evbuffer_datacmp() helper
Fixes:
runtime error: null pointer passed as argument 2, which is declared to never be null
(cherry picked from commit 6f152befb4523fd2e57c1a937e590f8ff87b7f15)
|
|
6b8d02a7
|
2020-06-25T08:45:34
|
|
http: fix undefined-shift in EVUTIL_IS*_ helpers
evutil.c:2559:1: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
#0 0x4f2be0 in EVUTIL_ISXDIGIT_ libevent/evutil.c:2559:1
#1 0x4bd689 in regname_ok libevent/http.c:4838:7
#2 0x4bc16b in parse_authority libevent/http.c:4958:9
#3 0x4bb8b5 in evhttp_uri_parse_with_flags libevent/http.c:5103:7
#4 0x4bb762 in evhttp_uri_parse libevent/http.c:5050:9
#5 0x4b8f41 in evhttp_parse_query_impl libevent/http.c:3505:9
#6 0x4b8ed7 in evhttp_parse_query libevent/http.c:3569:9
Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=23291
Report: https://oss-fuzz.com/testcase-detail/5670743106125824
(cherry picked from commit 37dbb3508099d49748453166c1ee9ef1603fcf3a)
|
|
fb5fa12a
|
2020-06-02T10:01:31
|
|
test/regress_testutils: use inet_addr()
(cherry picked from commit 8b5a4d61f6eb7180c0800f38549c20776c6d1cd9)
|
|
65a002a8
|
2020-05-25T02:06:32
|
|
test: http/autofree_connection cleanup
(cherry picked from commit e8c8951029a0a084dd73b27e6dc3b637a7c914db)
|
|
8dc6468e
|
2020-05-19T01:05:50
|
|
test: cleanup http/autofree_connection
(cherry picked from commit 70f69194eb3b19b5e41b52b17a820e1e91512560)
|
|
ab130875
|
2020-05-19T00:52:01
|
|
test: fix http/autofree_connection
Refs: #182
(cherry picked from commit 1cc94feab81e7387041edc32be9843f66847072d)
|
|
c2972453
|
2020-05-18T14:10:28
|
|
evdns: Add additional validation for values of dns options
(cherry picked from commit 8fe35c7614802fa13d144cceea9b079d5a131891)
|
|
141e37c8
|
2020-05-07T21:14:13
|
|
test: Fix test_simpleclose for Windows platform
Replace close with evutil_closesocket
Caught with PR #1006
(cherry picked from commit 06a11929511bebaaf40c52aaf91de397b1782ba2)
|
|
1df324d4
|
2020-05-05T00:21:18
|
|
Fix EV_CLOSED detection/reporting (epoll only)
- EV_CLOSED is EPOLLRDHUP in epoll
- EPOLLRDHUP reported w/o EPOLLHUP if the socket closed with shutdown(SHUT_WR)
- EPOLLRDHUP reported w/ EPOLLHUP if the socket closed with close()
so in this case epoll backend will detect this event as error
(EV_READ|EV_WRITE), since the epoll_ctl() will return EPOLLRDHUP with
EPOLLHUP set, but this is not correct, let's fix this.
Fixes: #984
(cherry picked from commit 972b456bf60e9a2f550ec45a14921c06e252c793)
|
|
db2efdf5
|
2020-05-05T00:05:49
|
|
Merge branch 'EV_CLOSED-and-EV_ET-fixes'
* EV_CLOSED-and-EV_ET-fixes:
Avoid triggering wrong events with EV_ET set
epoll: handle EV_ET for EV_CLOSED too
test: cover EV_CLOSED with lots of possible scenarious
test: rename simpleclose to simpleclose_rw (since it works via write/read)
(cherry picked from commit c10cde4c617979e951352775a9685a47bf9c6acd)
|
|
1fce771d
|
2020-04-16T12:08:02
|
|
bench: Allow backend method selection
-l list available methods
-m <name> use method
(cherry picked from commit 5caffa7a5b3ce67e074e2ee99fc553c1cac0712c)
|
|
29e2c7f2
|
2020-03-01T14:54:36
|
|
test-time: enable debug mode if EVENT_DEBUG_LOGGING_ALL env set
(cherry picked from commit a11edbfa369f7a99886359b3f4baa69686dc275f)
|
|
6f8e0e97
|
2020-02-27T16:59:45
|
|
evdns: fix a crash when evdns_base with waiting requests is freed
Fix undefined behaviour and application crash that might take
place in some rare cases after calling evdns_base_free when
there are requests in the waiting queue.
Current cleanup procedure in evdns_base_free_and_unlock
function includes 2 steps:
1. Finish all inflight requests.
2. Finish all waiting requests.
During the first step we iterate over each list in req_heads
structure and finish all requests in these lists. With current
logic finishing an inflight request (function request_finished)
removes it from the inflight requests container and forces
a wating connection to be sent (by calling
evdns_requests_pump_waiting_queue). When these new requests are
sent it is possible that they will be inserted to the list in
req_heads that we've already cleaned.
So in some cases container of the inflight requests is not empty
after this procedure and some requests are not finished and
deleted. When timeouts for these requests expire
evdns_request_timeout_callback is called but corresponding
evdns_base has been already deleted which causes undefined
behaviour and possible applicaton crash.
It is interesting to note that in old versions of libevent such
situation was not possible. This bug was introduced by the commit
14f84bbdc77d90b1d936076661443cdbf516c593. Before this commit
nameservers were deleted before finishing the requests. Therefore
it was not possible that requests from the waiting queue be sent
while we finish the inflight requests.
(cherry picked from commit 4da9f87ccbe71edb3b3aaf74b8b64d7e9c41dcaf)
|
|
9e993c3c
|
2020-02-11T14:33:15
|
|
test-ratelim: add missing free
(cherry picked from commit 5fbe6313ae7e81cde3e056b29171a6346c54aa0b)
|
|
e41a1969
|
2020-03-01T15:47:40
|
|
test-time: do not use deprecated API
- event_init() -> event_base_new()
- event_set() -> event_new()
- check return value of event_base_dispatch()
- use EXIT_SUCCESS/EXIT_FAILURE
(cherry picked from commit 4e5a41ca0f668da1a18832e5cb02b4afeae074ff)
|
|
0ef87f5f
|
2020-01-14T21:45:01
|
|
test: move thread into realtime class even on EVENT__DISABLE_THREAD_SUPPORT
(cherry picked from commit ca2b72c546d80dfb4fa255b20ef4a829ed102a70)
|
|
5a400c1f
|
2020-01-14T10:20:12
|
|
test: fix compilation without thread support (EVENT__DISABLE_THREAD_SUPPORT=ON)
(cherry picked from commit d0adbc05654eca27384b6496cfd8a22ed4dfb4fb)
|
|
1121ebed
|
2020-01-14T02:14:16
|
|
test: fix bufferevent/bufferevent_connect_fail_eventcb* under osx/freebsd
For OSX the socket should be closed, otherwise the "connection refused"
will not be triggered.
And freebsd can return error from the connect().
(cherry picked from commit 30fe125041ab38045487bd3af60d2f564dffc81c)
|
|
d5d18a56
|
2020-01-14T00:38:06
|
|
test: fix dst thread in move_pthread_to_realtime_scheduling_class (osx)
Fixes the following tests on osx:
- del_wait
- no_events
Refs: #940
(cherry picked from commit 10504fcab927e8b226ef2e988b1b3f175c3e9f71)
|
|
265cbe10
|
2020-01-14T00:27:21
|
|
test: fix compilation under win32 (rearrange thread_setup() code)
(cherry picked from commit 34d51e1bc9c650c4d012fe3024f7777c819ba969)
|
|
8991346d
|
2020-01-14T00:41:48
|
|
test: use THREAD_* wrappers over pthread* in del_notify
(cherry picked from commit 391003e9b78acff0ee5096c592fc4b601a02648d)
|
|
e85afbe3
|
2020-01-13T23:36:40
|
|
Merge branch 'osx-clock'
Moves the thread into real-time scheduling class, as recommended in [1], it
fixes the separate test provided by @ygj6 [2] everywhere (github actions,
travis-ci, appveyor) under osx.
[1]: https://developer.apple.com/library/archive/technotes/tn2169/_index.html
[2]: https://github.com/azat-archive/osx-timers/commit/dde1a6e4d04506d0e0fb193ebb9f49ae25873be6
Although even after this changes the following time-related tests failed
on travis-ci:
- no_events
- del_wait
But anyway I guess #940 can be closed, since this fixes the issue in common.
* osx-clock:
test: Use THREAD_* wrappers in del_notify/del_wait
test: move threads created with THREAD_START() to realtime scheduling class too
test: put thread into real time scheduling class on osx for better latencies
Closes: #940
(cherry picked from commit a6f81aa45455c8afb69980f7026a0e706f4f9387)
|
|
921bdcdd
|
2020-01-05T19:02:22
|
|
Fix compilation without OPENSSL_API_COMPAT
Use the following for openssl 1.1+:
- X509_getm_notBefore over X509_get_notBefore
- X509_getm_notAfter over X509_get_notAfter
- use OPENSSL_VERSION_NUMBER over SSLeay()
- add missing headers
Refs: openssl/openssl@0b7347effee5
(cherry picked from commit 08981f8d752ad23e21887b42944783e843b2e281)
|
|
8ad26d0b
|
2019-11-17T18:13:51
|
|
test-ratelim: calculate timers bias (for slow CPUs) to avoid false-positive
This can be/should be done for regression tests too.
Refs: https://ci.appveyor.com/project/libevent/libevent/builds/28916689/job/kg621aa194a0qbym
Refs: https://github.com/libevent/libevent/pull/917#issuecomment-553811834
v2: EVENT_BASE_FLAG_PRECISE_TIMER
(cherry picked from commit 8a34869984c470fb243fc9587c469b316add2f7e)
|
|
f602211f
|
2019-10-29T15:48:53
|
|
Parse IPv6 scope IDs.
(cherry picked from commit 9fecb59a94ef246088d7f3e0365c2fe80d0df2f4)
|
|
ca92a755
|
2019-10-31T09:18:58
|
|
Relax bufferevent_connect_hostname_emfile
Do not do any assumptions on the error for the EMFILE from
getaddrinfo(), expect just any error.
Fixes: #924
(cherry picked from commit 4436287d1247fb2e9c80560debf852a94657e485)
|
|
794e8f75
|
2019-09-26T21:47:51
|
|
tinytest: support timeout on Windows
(cherry picked from commit 8d5c5650d281019832fa7b5133b85c7ad29f664e)
|
|
a4f0387c
|
2019-09-22T18:44:55
|
|
Merge branch 'upstream/pr/899' (evbuffer_freeze testcase enhancements)
* upstream/pr/899:
improve the description of parameter to evbuffer_read()
regress_buffer: improve testcase for evbuffer_freeze()
(cherry picked from commit a977d6963611c729b75108d31bf74718b7b3e06d)
|
|
9e468c77
|
2019-08-28T11:41:53
|
|
eliminate some C4267 warnings in Windows
(cherry picked from commit 6f970267b6ba68c9dd9090d789c928529745dc68)
|
|
8ccd8f56
|
2019-08-22T16:36:12
|
|
Fix memory corruption in EV_CLOSURE_EVENT_FINALIZE with debug enabled
Call event_debug_note_teardown_ before evcb_evfinalize to avoid possible
UAF (if finalizer free's event).
(cherry picked from commit 445027a5dcfe0acce431b7d4065d2ac1f6b270d7)
|
|
23af76de
|
2019-08-27T01:00:56
|
|
test: prevent duplicate event_enable_debug_mode() for TT_ENABLE_DEBUG_MODE
(cherry picked from commit 70daa93a514075eb0102eec4c6e5002b114264a9)
|
|
0126814f
|
2019-08-26T22:43:35
|
|
test: introduce TT_ENABLE_DEBUG_MODE flag
(cherry picked from commit 6186d3126f124494dd90b14f62c17b47f7a7f484)
|
|
ec52e6af
|
2019-08-06T18:19:15
|
|
Fix typos in comments (sample/test/event-internal.h)
(cherry picked from commit 9c151f3c3413c5ee6bad498aca84be481196bbc7)
|
|
598f247d
|
2019-07-31T10:34:38
|
|
buffer: fix possible NULL dereference in evbuffer_setcb() on ENOMEM
[ @azat:
- add return heredoc for evbuffer_setcb()
- add unit test with event_set_mem_functions()
- look through the report from abi-compliance-checker/abi-dumper
]
Closes: #855
(cherry picked from commit bdcade47224f154052c927aed3c363a18b37112e)
|
|
546a366c
|
2019-06-15T23:18:05
|
|
evdns: add new options -- so-rcvbuf/so-sndbuf
This will allow to customize SO_RCVBUF/SO_SNDBUF for nameservers in this
evdns_base, you may want to adjust them if the kernel starts dropping
udp packages.
(cherry picked from commit 538141eb7e590bc94c043b43b5e5483b13bc9c5e)
|
|
2fea04b3
|
2019-05-16T10:25:50
|
|
Merge branch 'evbuffer-fixes-806-v2'
* evbuffer-fixes-806-v2:
evbuffer: fix last_with_datap after prepend with empty chain
test: regression for evbuffer_expand_fast_() with invalid last_with_datap
test: cover adjusting of last_with_datap in evbuffer_prepend()
Fixes: #806
(cherry picked from commit 3b1864b625ec37c3051512845982f347f4cc5621)
|
|
87fa93a8
|
2019-04-30T08:43:27
|
|
Merge remote-tracking branch 'official/pr/804'
* official/pr/804:
Added test for evmap slot validations.
Prevent endless loop in evmap_make_space.
Enforce limit of NSIG signals.
(cherry picked from commit c6becb26cad8dab2668fe3d913e5ee757bade2fd)
|
|
89932001
|
2019-04-03T07:26:21
|
|
Disable logging for tests that assume printing warnings
To avoid possible confusion
But there is still one test that has some messages on windows:
main/methods
Because this test needs >1 of avaiable methods, otherwise it will warn.
(cherry picked from commit 47d348a63130c91f2a6aadef291ff5687275df72)
|
|
58e81106
|
2019-04-01T01:47:00
|
|
evdns: add DNS_OPTION_NAMESERVERS_NO_DEFAULT/EVDNS_BASE_NAMESERVERS_NO_DEFAULT
- DNS_OPTION_NAMESERVERS_NO_DEFAULT
Do not "default" nameserver (i.e. "127.0.0.1:53") if there is no nameservers
in resolv.conf, (iff DNS_OPTION_NAMESERVERS is set)
- EVDNS_BASE_NAMESERVERS_NO_DEFAULT
If EVDNS_BASE_INITIALIZE_NAMESERVERS isset, do not add default
nameserver if there are no nameservers in resolv.conf (just set
DNS_OPTION_NAMESERVERS_NO_DEFAULT internally)
Fixes: #569
(cherry picked from commit e5b8f4c1925867d8e4cd7dc0390e5141d7ef1106)
|
|
22380996
|
2019-03-25T01:40:46
|
|
Link test/regress with event_core/event_extra over event
Due to regress linked with event and event_core (both of them includes
evthread.c) there will be two different evthread_id_fn_ variables under
mingw64:
evthread_id_fn_: &0x5294f20a8
evthread_id_fn_: &0x4ba0030a8
And because of this evthread_use_pthreads() can/will set one copy of
variables while evthread*() functions will access another, which will
break a lot of things (for example main/del_notify test).
Fixes: #792
(cherry picked from commit 2ae875ed1216a8896d8af0414cb4efbcb907bae5)
|
|
75d7e1ff
|
2019-03-24T20:36:16
|
|
tinytest: fix parsing --timeout argument
Fixes: 15b2f41d ("tinytest: implement per-test timeout (via alarm() under !win32 only)")
(cherry picked from commit 8a674243b444da9e0742ac837334aaf38e6a703a)
|
|
b64dbfb6
|
2019-03-24T16:44:56
|
|
tinytest: implement per-test timeout (via alarm() under !win32 only)
(cherry picked from commit 15b2f41d748643393b9f95b790d32e6bbbf38062)
|
|
b6724b60
|
2019-03-16T16:52:05
|
|
bench: suppress int conversion warnings
(cherry picked from commit efcc18442b338d931f6dfe71d5ebaff3c6fa2b03)
|
|
3f893f0a
|
2014-12-09T21:43:18
|
|
Add support for EV_TIMEOUT to event_base_active_by_fd
Closes: #194 (cherry-pick)
(cherry picked from commit 62df1301ca943011fa9c398323049bcddca2694d)
|
|
6a3dd717
|
2019-03-03T18:58:57
|
|
Merge branch 'evbuffer-empty-chain-handling'
* evbuffer-empty-chain-handling:
buffer: do not rely on ->off in advance_last_with_data()
buffer: fix evbuffer_remove_buffer() with empty chain in front
test: verify content of the buffer in evbuffer/remove_buffer_with_empty*
(cherry picked from commit b69524c004fb68bcd9475e7aa61f5a7cdb45d304)
|
|
a45f6733
|
2019-02-24T17:25:31
|
|
Revert "test: avoid regress hanging in macOS"
After we started to use kill() over raise() everything should work just
fine.
This reverts commit a86f89d333d870e6714bd28c695ba1774df3d7f5.
Fixed-in: 728c5dc1 ("Use kill() over raise() for raising the signal (fixes osx 10.14 with kqueue)")
Fixes: #747
(cherry picked from commit 14eb903ba31987d24357abd05923677d194fedae)
|
|
3db5296b
|
2019-02-24T17:07:18
|
|
Use kill() over raise() for raising the signal (fixes osx 10.14 with kqueue)
On OSX 10.14+ the raise() uses pthread_kill() (verified with dtruss) and
by some reason signals that has been raised with pthread_kill() do not
received by kqueue EVFILT_SIGNAL.
While on OSX 10.11 the raise()/pthread_kill() uses plain kill() and
everything work just fine (linux also does the same, but instead of
kill() it uses tgkill())
Here is a simple reproducer that installs alarm to show that the signal
does not received by the kqueue backend:
https://gist.github.com/azat/73638b8e3b0fa563a20dadcca9e652a1
Refs: #747
Fixes: #765
(cherry picked from commit 728c5dc11f55b4ba5f518812833eab5a2cc3d550)
|
|
e0e5d53b
|
2019-02-04T22:34:10
|
|
test/dns: in solaris under EMFILE devpoll does not dispatch
(cherry picked from commit 3ce38f6d2d74edcacfe17d612c611ae35e97acfc)
|
|
5a26e7bd
|
2019-02-03T18:54:00
|
|
test/dns: in solaris under EMFILE the error is EAI_FAIL
(cherry picked from commit d234902da713cb722596f6bf66bb0dde8a3842dc)
|
|
ce4e2b7b
|
2019-02-03T18:47:14
|
|
test/ssl/bufferevent_wm: explicitly break the loop once client/server received enough
There can be tricky cases (that can be reproduced by reducing
SO_RCVBUF/SO_SNDBUF to 6144, on linux, and be aware, since linux doubles
this const), when there is still write event pending, although we read
enough.
This should be fixed in a more sophisticated way, but to backport the
patch, let's simply break the loop manually.
The ssl/bufferevent_wm originally failed on solaris.
(cherry picked from commit ae9b285d2d7c9b898049072c157d50769d8014ea)
|
|
e66078a0
|
2019-01-29T21:12:33
|
|
Eliminate fd conversion warnings and introduce EVUTIL_INVALID_SOCKET (windows)
windows has intptr_t instead of regular int.
Also tt_fd_op() had been introduced, since we cannot use tt_int_op() for
comparing fd, since it is not always int.
(cherry picked from commit b29207dceee33832bb28ab103a833df6a2fd29d3)
|
|
283da047
|
2019-01-29T21:06:37
|
|
test/et/et: use evutil_socket_t* over int* for pointer to the pair
Next code will not work correctly under win x64:
evutil_socket_t very_long_pair_name[2];
int *pair = very_long_pair_name; // <-- accessing the second word of the first element
Because sizeof(evutil_socket_t) == sizeof(intptr_t) == 8
P.S. in the 5334762f another test had been fixed instead of the one that
really fails.
Fixes: 5334762f ("test/et/et: fix it by using appropriate type for the SOCKET (evutil_socket_t)")
Refs: #750
(cherry picked from commit 0791a17204ff70bbea92520352a0c6e8d185fa4b)
|
|
aee0fcd5
|
2019-01-29T10:54:39
|
|
Merge branch 'win64-fixes'
* win64-fixes:
test/et/et: fix it by using appropriate type for the SOCKET (evutil_socket_t)
test/et/et: verify return codes
appveyor: switch to new VS/MinGW and x64
(cherry picked from commit 97a3e7f5802ce1baa3c959905e312cab2bebf4bf)
|
|
eb7b472b
|
2019-01-29T01:18:39
|
|
Merge branch 'http-EVHTTP_CON_READ_ON_WRITE_ERROR-fixes-v2'
* http-EVHTTP_CON_READ_ON_WRITE_ERROR-fixes-v2:
http: try to read existing data in buffer under EVHTTP_CON_READ_ON_WRITE_ERROR
test: add logging for http/read_on_write_error and rearrange code
http: do not call deferred readcb if readcb is not set
Refs: #749
(cherry picked from commit 7bfe93886d7fccad2d9a6c76cf47c47d3668f9d1)
|
|
170debc7
|
2019-01-26T18:52:33
|
|
test: adjust expecting error for getaddrinfo() under EMFILE
When getaddrinfo() cannot allocate file descriptor glibc/musl-libc on
linux report EAI_SYSTEM error. But this is not true for freebsd libc [1]
(and hence apple libc [2]), they report EAI_NONAME error instead, so
adjust expectation.
[1]: https://github.com/freebsd/freebsd/blob/master/lib/libc/net/getaddrinfo.c
[2]: https://opensource.apple.com/source/Libc/
Refs: #749
Refs: https://github.com/libevent/libevent/issues/749#issuecomment-457838159
(cherry picked from commit 4ffc7116177230ad2b8b94d51bbf89a14dc83687)
|
|
982a7e88
|
2019-01-12T13:58:50
|
|
test/nonpersist_readd: use assert helpers
To debug failure under win32 in appveyor:
https://ci.appveyor.com/project/nmathewson/libevent/builds/21559140/job/dn16qdo1j6sr497t#L1620
(cherry picked from commit 91a2f1346e80c67526261ba81c8f3b3736107bcb)
|
|
f9c5d17b
|
2018-12-08T17:35:53
|
|
test-fdleak: fix memory leaks
Fixes: #726
(cherry picked from commit e5ec52d100ee94af14753513f4b4594e94eb02e1)
|
|
f9b592aa
|
2018-11-23T00:42:46
|
|
test: add TT_RETRIABLE for http/cancel_by_host_no_ns
Could fail from time to time in travis-ci:
https://travis-ci.org/libevent/libevent/jobs/458554097#L1702
Follow-up-for: fe5b0719 ("Mark a lot of flacky tests with TT_RETRIABLE (for linux/win32 only)")
(cherry picked from commit 1d2ef90032bc842bc2e295ee4adce3408b6d85da)
|
|
6ea1ec68
|
2018-11-21T00:10:43
|
|
Merge branch 'TT_RETRIABLE'
* TT_RETRIABLE:
Mark a lot of flacky tests with TT_RETRIABLE (for linux/win32 only)
regress: introduce TT_RETRIABLE
Fixes: #704
(cherry picked from commit 4d2f013b5d20e674b22e5a8244f7fa63172dbdbf)
|
|
241780bd
|
2018-11-20T06:20:51
|
|
regress_http: fix compilation with !EVENT__HAVE_OPENSSL
Fixes: 811c63f7 ("regress: test for HTTP/HTTPS with IOCP enabled")
(cherry picked from commit 3036f15a176b038f42d3896463c39058c6bac943)
|
|
018ac6fd
|
2018-11-13T23:20:10
|
|
regress_bufferevent: add TT_IOCP_LEGACY/TT_IOCP
(cherry picked from commit f8d510f61777bcb194b945163b84047969a46cef)
|
|
77b587b3
|
2018-11-13T23:30:51
|
|
t/bench_http: disable buffering (win32 do not show anything otherwise)
Refs: #255
(cherry picked from commit 903c6acea52a2a2922b5cd43faec1e64631c3da8)
|
|
6bfac964
|
2018-11-13T22:47:43
|
|
Merge branch 'iocp-fixes'
* iocp-fixes:
regress: test for HTTP/HTTPS with IOCP enabled
bev_async: trigger/run only deferred callbacks
bev_async: do not initialize timeouts multiple times
bev_async: set "ok" on setfd if fd>=0 (like we do during creation)
bev_async: ignore ERROR_INVALID_PARAMETER on .setfd for iocp
Closes: #709
Refs: nmathewson/Libevent#160
(cherry picked from commit 3d815cf22074792f31274fd6d810a94984661dbf)
|
|
91bb15e6
|
2018-11-13T09:25:13
|
|
regress: add EVENT_NO_FILE_BUFFERING, to disable buffering for stdout/stderr
Useful for win32
(cherry picked from commit b2d4fb4176c645b45b8514e4a5a942228ea4e6a9)
|
|
3bc602c2
|
2018-11-08T00:36:07
|
|
regress_ssl: fix ssl/bufferevent_wm_filter for non defered callbacks
Even after referenced patch there is still possible recursive callbacks
from evbuffer_drain(bev_input), i.e.:
wm_transfer() -> evbuffer_drain() -> wm_transfer()
inc(ctx->get)
But if we will increment ctx->get before drain that we will not add more
data to buffer.
Refs: 54c6fe3c ("regress_ssl: make ssl/bufferevent_wm_filter more fault-tolerance")
CI: https://ci.appveyor.com/project/nmathewson/libevent/build/job/f0rv299i71wnuxdq#L2546
(cherry picked from commit 1fc1c7ef1dabbbb358b99b893712bccc5761f82d)
|
|
98d0f923
|
2018-11-05T22:25:15
|
|
regress_ssl: make ssl/bufferevent_wm_filter more fault-tolerance
Due to inplace callbacks (i.e. no BEV_OPT_DEFER_CALLBACKS) we cannot be
sure that wm_transfer() will not be called recursively and indeed it
still happens sometimes, and the referenced patch increase amount of
this times, especially for linux/poll.
Fixes: 66304a23cf748714159c988e78f35401c5352827 ("Fix
ssl/bufferevent_wm_filter when bev does not reach watermark on break")
(cherry picked from commit 54c6fe3c06cb5342130467ecf0f78e3f6d854a36)
|
|
35ca9643
|
2018-11-05T21:33:54
|
|
regress_http: disable http/read_on_write_error under win32
EVHTTP_CON_READ_ON_WRITE_ERROR works only if an error already read from
the socket, but if we already got EPIPE on write we cannot read from the
socket anymore, and win32 does not guarantee that read will happens
before (although it happens from time to time).
In the referenced patch I just replaced callback with not expecting 417,
but like I already wrote, this is not always true (i.e. it is flacky).
Fixes: 3b581693ac1967f7f8d98491cb772a1b415eb4cd ("test/http:
read_on_write_error: fix it for win32")
(cherry picked from commit 9040707fb176040acf250b09a223d6b4400f4086)
|
|
30020a35
|
2018-11-04T21:41:20
|
|
Merge branch 'ssl_bufferevent_wm_filter-fix'
* ssl_bufferevent_wm_filter-fix:
Fix ssl/bufferevent_wm_filter when bev does not reach watermark on break
regress_ssl: cover watermarks with deferred callbacks
regress_ssl: improve bufferevent_wm/bufferevent_wm_filter logging
(cherry picked from commit 9d93fbe77968da5ca5b2dbe8973e6f3c3045c5ba)
|
|
6594bfb4
|
2018-11-02T23:43:57
|
|
regress_http: make https_basic non time dependent
Fixes: #454
(cherry picked from commit e29afd4b9428631444b208edfe3a4ba6ce4423af)
|
|
a39898f3
|
2018-11-04T01:21:48
|
|
Merge branch 'check-O_NONBLOCK-in-debug'
* check-O_NONBLOCK-in-debug:
regress: use non blocking descriptors whenever it is possible
assert that fds are nonblocking in debug mode
Closes: nmathewson/Libevent#90
(cherry picked from commit 6f988ee161680925fc3308f17d293c680e3ac916)
|
|
ca4b6404
|
2018-10-31T01:22:30
|
|
Merge branch 'event-ET-#636-v2'
* event-ET-#636-v2:
Preserve ET bit for backends with changelist
Epoll ET setting lost with multiple events for same fd
Cover ET with multiple events for same fd
Add ET flag into event_base_dump_events()
Fixes: #636
(cherry picked from commit 33053cdd8a9e1a7330b47759dee9cb209bed8f1b)
|
|
349081e1
|
2018-10-28T19:48:37
|
|
Merge branch 'win32-visibility-event_debug_logging_mask_'
* win32-visibility-event_debug_logging_mask_:
Introduce EVENT_VISIBILITY_WANT_DLLIMPORT
regress_http: use TT_BLAZER() over event_debug()
Fixes: #702
(cherry picked from commit fb8666453ce8bb1d599a68636bed5db5ef4a7a57)
|
|
2ad11022
|
2018-10-28T02:00:16
|
|
bench_cascase: include getopt.h only for _WIN32 (like in other places)
Fixes: #561
(cherry picked from commit fb42e0fac60d31e081cce4c19df6061bcb56df20)
|
|
f895e17e
|
2018-10-27T19:34:52
|
|
regress_ssl: reset static variables on test setup/cleanup and eliminate leaks
One tricky bit is reply to the BIO_C_GET_FD command, since otherwise it
will try to close(0) and accepted bev in ssl/bufferevent_connect_sleep
will leak. Other seems more or less trivial.
This was done to make sure that for at least generic cases does not
leak (tricky cases was listed here nmathewson/Libevent#83).
And this will allow run ssl/.. with --no-fork
(cherry picked from commit 9fe952a0aea25474de3dbc30350b1ffa5abcd65a)
|
|
a9a5cf4d
|
2018-10-27T19:41:52
|
|
test: export basic_test_setup/basic_test_cleanup to extend them
(cherry picked from commit 7cec9b95a3aefb85fcf75610abc8e27e284b251d)
|
|
f3aa6a47
|
2018-10-27T17:36:09
|
|
regress_http: basic evhttp_parse_query_str() coverage
(cherry picked from commit d161ec3842259f2896fc9b15a1e4d5a1ed178bb2)
|
|
b07e43e6
|
2018-10-25T00:50:50
|
|
Merge branch 'evutil_found_ifaddr-dev'
* evutil_found_ifaddr-dev:
Cover evutil_v4addr_is_local_()/evutil_v6addr_is_local_()
Split evutil_found_ifaddr() into helpers (evutil_v{4,6}addr_is_local())
Use INADDR_ANY over 0 in evutil_found_ifaddr()
Replace EVUTIL_V4ADDR_IS_*() macroses with static inline functions
Filter link-local IPv4 addresses in evutil_found_ifaddr()
(cherry picked from commit b2667b76969c2ea382373f885062b45e82d0ac59)
|
|
cdcfbafe
|
2018-10-23T00:12:23
|
|
Merge branch 'http-request-line-parsing'
* http-request-line-parsing:
Fix http https_basic/https_filter_basic under valgrind (increase timeout)
http: cover various non RFC3986 conformant URIs
http: allow non RFC3986 conformant during parsing request-line (http server)
http: do not try to parse request-line if we do not have enough bytes
http: allow trailing spaces (and only them) in request-line (like nginx)
http: cleanup of the request-line parsing
(cherry picked from commit 0ec12bc84cf09307e01dc3b00d08ac1f816b6ff7)
|
|
731053b0
|
2018-10-21T18:31:01
|
|
Simplify bufferevent timeout tests to reduce CPU usage in between start/compare
Between start (setting "started_at") and comparing the time when
timeouts triggered with the start (test_timeval_diff_eq), there is too
much various things that can introduce extra delays and eventually could
fail the test on machine with shortage of CPU.
And this is exactly what happend on:
- travis-ci
- #262
Here is a simple reproducer that I came up with for this issue:
docker run --cpus=0.01 -e LD_LIBRARY_PATH=$PWD/lib -e PATH=/usr/bin:/bin:$PWD/bin -v $PWD:$PWD --rm -it debian:testing regress --no-fork --verbose bufferevent/bufferevent_timeout
Under limited CPU (see reproducer) the test almost always has problems
with that "write_timeout_at" exceed default timeval diff tolerance
(test_timeval_diff_eq() has 50 tolerance), i.e.:
FAIL ../test/regress_bufferevent.c:1040: assert(labs(timeval_msec_diff(((&started_at)), ((&res1.write_timeout_at))) - (100)) <= 50): 101 vs 50
But under some setup write timeout can even not triggered, and the
reason for this is that we write to the bufferevent 1024*1024 bytes, and
hence if evbuffer_write_iovec() will has some delay after writev() and
not send more then one vector at a time [1], it is pretty simple to
trigger, i.e.:
FAIL ../test/regress_bufferevent.c:1040: assert(labs(timeval_msec_diff(((&started_at)), ((&res1.write_timeout_at))) - (100)) <= 50): 1540155888478 vs 50
[1]: https://gist.github.com/azat/b72773dfe7549fed865d439e03de05c1
So this patch just send static small payload for all cases (plus a few
more asserts added).
The outcome of this patch is that all regression tests passed on
travis-ci for linux box [2]. While before it fails almost always [3].
Also reproducer with CPU limiting via docker also survive some
iterations (and strictly speaking it should has less CPU then travis-ci
workers I guess).
[2]: https://travis-ci.org/azat/libevent/builds/444391481
[3]: https://travis-ci.org/libevent/libevent/builds/444336505
(cherry picked from commit 6ac8e775bb3cba49c276c90e288554635d38b466)
|
|
6e759975
|
2018-10-21T03:15:34
|
|
Merge branch 'regress-dns-fixes'
* regress-dns-fixes:
Do not rely on getservbyname() for most of the dns regression tests
Turn off dns/getaddrinfo_race_gotresolve by default
Fix an error for debug locking in dns/getaddrinfo_race_gotresolve
(cherry picked from commit bd2184d8d42f721fa523d01b9a9250c75fedb855)
|
|
3f692fff
|
2018-10-17T23:21:32
|
|
Merge branch 'be-wm-overrun-v2'
* be-wm-overrun-v2:
Fix hangs due to watermarks overruns in bufferevents implementations
test: cover watermarks (with some corner cases) in ssl bufferevent
Fixes: #690
(cherry picked from commit 878bb2d3b9484b27594308da1d0d6a7c9bdf6647)
|
|
e05136c7
|
2018-09-14T02:24:44
|
|
evrpc: avoid NULL dereference on request is not EVHTTP_REQ_POST
Fixes: #660
(cherry picked from commit 8483c5351abdd18766232de8431290165717bd57)
|
|
7d6c88dd
|
2018-08-15T13:57:01
|
|
test: make sure pthread is defined
avoid warnings with any modern C99 compiler due to implicit function
declaration for pthread_create, as shown by the following :
test/regress_dns.c:2226:2: warning: implicit declaration of function
'pthread_create' is invalid in C99 [-Wimplicit-function-declaration]
THREAD_START(thread[0], race_base_run, &rp);
^
test/regress_thread.h:35:2: note: expanded from macro 'THREAD_START'
pthread_create(&(threadvar), NULL, fn, arg)
^
test/regress_dns.c:2226:2: warning: this function declaration is not a prototype
[-Wstrict-prototypes]
test/regress_thread.h:35:2: note: expanded from macro 'THREAD_START'
pthread_create(&(threadvar), NULL, fn, arg)
^
$ clang --version
Apple LLVM version 9.1.0 (clang-902.0.39.2)
Target: x86_64-apple-darwin17.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
Closes: #686 (cherry-picked)
(cherry picked from commit 7af974eeaa7e5cf2f73e3176782c5a788a74f08e)
|
|
d6c293af
|
2018-06-16T17:16:10
|
|
Eliminate compiler warnings (at least for gcc/linux)
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
Closes: #646 # cherry-picked from the PR
(cherry picked from commit be371163027d3988a30620537bf3fcb81fb7f077)
|
|
3237d697
|
2018-08-02T09:29:29
|
|
Merge branch 'evdns_getaddrinfo-race-fix'
* evdns_getaddrinfo-race-fix:
evdns: add regress test for getaddrinfo race
evdns: fix race condition in evdns_getaddrinfo()
Merges: #673
(cherry picked from commit ee12c516cf5766b2c32203dcc20c32b8691a8ebb)
|
|
780eaac8
|
2018-05-15T12:14:05
|
|
test: make regress_dns C89 compatible
Closes: #635 (cherry-picked)
(cherry picked from commit d9ffd2213702bc22c467bd83c230a1a5e97e9e67)
|
|
e2732c90
|
2018-05-07T02:39:44
|
|
Make rpc headers self-compilable
Fixes: #633
(cherry picked from commit c57f5c34903b02c6e7378865f71a2b83a5befb96)
|
|
d9d1c09e
|
2018-04-24T00:59:11
|
|
Notify event base if there are no more events, so it can exit without delay
Fixes: #623
(cherry picked from commit 23c2914f6b430f2c2d74c267c13ffab3dda1b325)
|
|
0d194c4e
|
2018-04-24T14:46:06
|
|
test/dns: install correct RLIMIT_NOFILE in bufferevent_connect_hostname_emfile
Otherwise poll() will fail with EINVAL:
EINVAL The nfds value exceeds the RLIMIT_NOFILE value.
P.S. and cleanup this test a little, with early-return.
CI: https://travis-ci.org/libevent/libevent/jobs/370350426
(cherry picked from commit d1c8993c3c34030b68ecb6079bd9dce8cb3d3604)
|
|
61b95600
|
2018-04-24T02:22:58
|
|
test/http: cover evhttp_connection_get_addr() for incomming connections
Refs: #510
(cherry picked from commit e4edc7fc27bb96b4811f1c24d591f5c5bca69bdd)
|