History log of /libevent-2.1.12/event.c (Results 1 – 25 of 411)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: release-2.2.1-alpha, release-2.1.12-stable
# 2e9ceb16 04-Feb-2020 chenguolong <[email protected]>

event_base_once: fix potential null pointer threat

supposing if base is null, EVBASE_ACQUIRE_LOCK and EVBASE_RELEASE_LOCK
would get a coredump, so we add a guard for protection.

Signed-off-by: chen

event_base_once: fix potential null pointer threat

supposing if base is null, EVBASE_ACQUIRE_LOCK and EVBASE_RELEASE_LOCK
would get a coredump, so we add a guard for protection.

Signed-off-by: chenguolong <[email protected]>
(cherry picked from commit 968bbd5c918568eb95b493af05c464ddfc36671b)

show more ...


# 71f5c0d3 29-Aug-2019 Azat Khuzhin <[email protected]>

Revert "Warn if forked from the event loop during event_reinit()"

Thinking about this more and realizing that this was a mistake, so
should be reverted.

In a nut shell I guess most of the apps call

Revert "Warn if forked from the event loop during event_reinit()"

Thinking about this more and realizing that this was a mistake, so
should be reverted.

In a nut shell I guess most of the apps calls event_reinit() from the
loop (see [1] for example), and this should be totally fine (the bit
with the signals [2] handled in event_reinit() gracefully)

[1]: https://archives.seul.org/libevent/users/Aug-2019/msg00009.html
[2]: https://github.com/libevent/libevent/pull/833#issuecomment-501834453

This reverts commit 497ef904d544ac51de43934549dbeccce8e6e8f8.

Reported-by: [email protected]
Backport-to: 2.1
(cherry picked from commit ddacaef59ab6808a0801007d0a681f2415af4871)

show more ...


# 8ccd8f56 22-Aug-2019 Jan Kasiak <[email protected]>

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 c

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)

show more ...


Revision tags: release-2.1.11-stable
# b75922ae 01-Jul-2019 Azat Khuzhin <[email protected]>

Warn if forked from the event loop during event_reinit()

Calling fork() from the event loop is not a great idea, since at least
it shares some internal pipes (for handling signals) before
event_rein

Warn if forked from the event loop during event_reinit()

Calling fork() from the event loop is not a great idea, since at least
it shares some internal pipes (for handling signals) before
event_reinit() call

Closes: #833
(cherry picked from commit 497ef904d544ac51de43934549dbeccce8e6e8f8)

show more ...


# 18104973 31-Jul-2019 Azat Khuzhin <[email protected]>

Revert "Protect min_heap_push_ against integer overflow."

This patch breaks the ABI compatibility, due to min_heap_idx expansion
[1]

And since major distros did not updated to 2.1.10 yet, this patc

Revert "Protect min_heap_push_ against integer overflow."

This patch breaks the ABI compatibility, due to min_heap_idx expansion
[1]

And since major distros did not updated to 2.1.10 yet, this patch will
be reverted:
- debian: https://packages.debian.org/search?keywords=libevent-dev
- ubuntu: https://packages.ubuntu.com/search?keywords=libevent-dev
- fedora: https://apps.fedoraproject.org/packages/libevent-devel

Also there is one that upgraded already:
- archlinux: https://www.archlinux.org/packages/?q=libevent
But archlinux is for developers, so it should be fine I guess.

[1]: https://abi-laboratory.pro/index.php?view=objects_report&l=libevent&v1=2.1.9&v2=2.1.10

- struct event_base
Change: Size of this type has been changed from 672 bytes to 664 bytes.
Effect: The fields or parameters of such data type may be incorrectly initialized or accessed by old client applications.

abi-compliance-checker diff with 2.1.9 before this patch:
Binary compatibility: 69.2%
Source compatibility: 100%
Total binary compatibility problems: 1, warnings: 1
Total source compatibility problems: 0, warnings: 0

after:
Binary compatibility: 100%
Source compatibility: 100%
Total binary compatibility problems: 0, warnings: 0
Total source compatibility problems: 0, warnings: 0

This reverts commit 0b46bb8cc9c0337b5fa0186d9cb031ff4f4ceb9a

show more ...


Revision tags: release-2.1.10-stable
# 0b46bb8c 16-Apr-2019 Tobias Stoeckmann <[email protected]>

Protect min_heap_push_ against integer overflow.

Converting unsigned to size_t for size of memory objects allows
proper handling of very large heaps on 64 bit systems.

Signed-off-by: Tobias Stoeckm

Protect min_heap_push_ against integer overflow.

Converting unsigned to size_t for size of memory objects allows
proper handling of very large heaps on 64 bit systems.

Signed-off-by: Tobias Stoeckmann <[email protected]>
Closes: #799 (cherry-picked)
(cherry picked from commit 176fd5665512db95b1cf38fc647a7c706d80c14d)

show more ...


Revision tags: release-2.1.9-beta, release-2.0.23-beta, release-2.1.8-stable, release-2.1.7-rc, release-2.1.6-beta, release-2.0.22-stable, release-1.4.15-stable, release-2.1.5-beta
# 3f893f0a 10-Dec-2014 John Ohl <[email protected]>

Add support for EV_TIMEOUT to event_base_active_by_fd

Closes: #194 (cherry-pick)
(cherry picked from commit 62df1301ca943011fa9c398323049bcddca2694d)


# a8155c62 09-Dec-2018 Azat Khuzhin <[email protected]>

Do not check O_NONBLOCK for invalid fds

Fixes: 6f988ee1 ("Merge branch 'check-O_NONBLOCK-in-debug'")
(cherry picked from commit 9d3a415a99bbc6a7e0f0b12ae3c6c5c7e4613cf1)


# ca69a10f 13-Nov-2018 Azat Khuzhin <[email protected]>

event: add some debug information into loop for event_base_free_queues_()

Refs: 7c8d0152dda18ecc52d3099fea235b04ddb850d9 ("Free event queues even
for recursive finalizers")

(cherry picked from comm

event: add some debug information into loop for event_base_free_queues_()

Refs: 7c8d0152dda18ecc52d3099fea235b04ddb850d9 ("Free event queues even
for recursive finalizers")

(cherry picked from commit f2da6198401e2ef6763e5acc5d4e51a9928b9dde)

show more ...


# a39898f3 03-Nov-2018 Azat Khuzhin <[email protected]>

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: nmathew

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)

show more ...


# ca4b6404 30-Oct-2018 Azat Khuzhin <[email protected]>

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 f

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)

show more ...


# d9d1c09e 23-Apr-2018 Azat Khuzhin <[email protected]>

Notify event base if there are no more events, so it can exit without delay

Fixes: #623
(cherry picked from commit 23c2914f6b430f2c2d74c267c13ffab3dda1b325)


# 4f0f40e3 27-Feb-2018 Azat Khuzhin <[email protected]>

Fix base unlocking in event_del() if event_base_set() runned in another thread

Image next situation:
T1: T2:
event_del_()
lock the event.ev_base.th_b

Fix base unlocking in event_del() if event_base_set() runned in another thread

Image next situation:
T1: T2:
event_del_()
lock the event.ev_base.th_base_lock
event_del_nolock_() event_set_base()
unlock the event.ev_base.th_base_lock

In this case we will unlock the wrong base after event_del_nolock_()
returns, and deadlock is likely to happens, since event_base_set() do
not check any mutexes (due to it is possible to do this only if event is
not inserted anywhere).

So event_del_() has to cache the base before removing the event, and
cached base.th_base_lock after.

(cherry picked from commit 08a0d366073eacf800027725891c2f668f2f0144)

show more ...


# f45543e2 27-Feb-2018 Azat Khuzhin <[email protected]>

Convert event_debug_*() helpers from macros to static functions

(cherry picked from commit f0fd92f2c41fd5bf3b270ee338089dd9329d0354)


# 27dee54d 09-Dec-2017 yongqing.jiao <[email protected]>

If precise_time is false, we should not set EVENT_BASE_FLAG_PRECISE_TIMER

Fixes: 630f077c296de61c7b99ed83bf30de11e75e2740 ("Simple unit tests for
monotonic timers")

(cherry picked from commit 6cce7

If precise_time is false, we should not set EVENT_BASE_FLAG_PRECISE_TIMER

Fixes: 630f077c296de61c7b99ed83bf30de11e75e2740 ("Simple unit tests for
monotonic timers")

(cherry picked from commit 6cce7458d0f94e320f201eb5be94866e6918d66c)

show more ...


# 43d92a6d 07-Aug-2017 James Synge <[email protected]>

Fix race in access to ev_res from event loop with event_active()

Detected using ThreadSanitizer, resolved by capturing the value
of ev_res in a local variable while the event is locked, then
passing

Fix race in access to ev_res from event loop with event_active()

Detected using ThreadSanitizer, resolved by capturing the value
of ev_res in a local variable while the event is locked, then
passing that captured variable to the callback.

TSAN report:
I0728 14:35:09.822118 WARNING: ThreadSanitizer: data race (pid=815501)
I0728 14:35:09.822186 Write of size 2 at 0x7b2c00001bf2 by thread T80 (mutexes: write M1110835549570434736):
I0728 14:35:09.822248 #0 event_active_nolock_ libevent/event.c:2893:14 (0a2b90577e830d775300664df77d0b91+0x1fdab28)
I0728 14:35:09.822316 #1 event_active libevent/event.c:2858:2 (0a2b90577e830d775300664df77d0b91+0x1fdd10e)
I0728 14:35:09.822379 #2 Envoy::Event::TimerImpl::enableTimer(std::chrono::duration<long, std::ratio<1l, 1000l> > const&) envoy/source/common/event/timer_impl.cc:24:5 (0a2b90577e830d775300664df77d0b91+0x459fa0)
...

I0728 14:35:09.824146 Previous read of size 2 at 0x7b2c00001bf2 by main thread:
I0728 14:35:09.824232 #0 event_process_active_single_queue libevent/event.c:1646:33 (0a2b90577e830d775300664df77d0b91+0x1fdf83d)
I0728 14:35:09.824350 #1 event_process_active libevent/event.c (0a2b90577e830d775300664df77d0b91+0x1fd9ad8)
I0728 14:35:09.824445 #2 event_base_loop libevent/event.c:1961 (0a2b90577e830d775300664df77d0b91+0x1fd9ad8)
I0728 14:35:09.824550 #3 Envoy::Event::DispatcherImpl::run(Envoy::Event::Dispatcher::RunType) envoy/source/common/event/dispatcher_impl.cc:166:3 (0a2b90577e830d775300664df77d0b91+0x4576d9)
...

Fixes: #543 (pull-request)
(cherry picked from commit 27934f0b39991172dcfdad23faea9874dd386f10)

show more ...


# 876c7ac7 13-Apr-2015 José Luis Millán <[email protected]>

Return from event_del() after the last event callback termination

Delete the event from the queue before blocking for the current
event callback termination.

Ensures that no callback is being execu

Return from event_del() after the last event callback termination

Delete the event from the queue before blocking for the current
event callback termination.

Ensures that no callback is being executed when event_del() returns,
hence making this function a secure mechanism to access data which is
handled in the event callack.

Fixes: #236
Fixes: #225
Refs: 6b4b77a
Fixes: del_wait
(cherry picked from commit 0b4b0efdb8ee710ccae5bad320fc24843fd428e5)

show more ...


# 27a2ef5c 24-Mar-2017 Azat Khuzhin <[email protected]>

Make event_count macros cleaner

Fixes: #489
(cherry picked from commit 177e2171cb44e3929fbb0ec43b1bffb325b0e8ed)


# 9806b126 13-Mar-2017 Azat Khuzhin <[email protected]>

Merge branch 'cmake-missing-bits'

This patchset adds next missing things (in compare to autotools):
- pkgconfig
- event_pthreads/event_openssl
- compile shared/static libraries always

And some fixe

Merge branch 'cmake-missing-bits'

This patchset adds next missing things (in compare to autotools):
- pkgconfig
- event_pthreads/event_openssl
- compile shared/static libraries always

And some fixes, because it will not build after fixing other things:
- export missing symbols for cmake (-fvisibility=hidden)

* cmake-missing-bits:
cmake: support visibility for AppleClang too
cmake: fix export absolute path and relative path and cleanup a bit
cmake: generate and install pkgconfig files
cmake: build SHARED and STATIC libraries (like autoconf does)
cmake: add missing event_openssl/event_pthreads libraries
Export symbols for -fvisibility=hidden (under cmake)

Refs: #246
(cherry picked from commit 489991a2b2628ba1ff4e6879b9f67ec35d224c38)

show more ...


# 40da44bd 29-Jan-2017 Azat Khuzhin <[email protected]>

Fix -Werror=implicit-fallthrough (fixes gcc-7)

Fixes: #447
(cherry picked from commit 94e7dcebc320bf496ff6b613d8e4b771fa0a161c)


# 88640aa1 26-Dec-2015 Nicholas Marriott <@nicm>

event_reinit: make signals works after fork() without evsig_add()

event_reinit() removes the event, but only evsig_add puts it back. So any
signals set up before event_reinit will be ignored until a

event_reinit: make signals works after fork() without evsig_add()

event_reinit() removes the event, but only evsig_add puts it back. So any
signals set up before event_reinit will be ignored until another signal is
added.

Fixes: #307

show more ...


# ad0c237b 26-Dec-2015 Nicholas Marriott <@nicm>

event_reinit: always re-init signal's socketpair

Before this patch event_reinit() only closes the signal socketpair fds and
recreates them if signals have been added, but this is wrong, since socket

event_reinit: always re-init signal's socketpair

Before this patch event_reinit() only closes the signal socketpair fds and
recreates them if signals have been added, but this is wrong, since socketpair
fds created on backend init, and if we will not re-create them bad things in
child/parent signal handling will happens (and indeed this is what happens for
non-reinit backends like select).

Fixes: #307

show more ...


# 7c8d0152 30-Oct-2015 Azat Khuzhin <[email protected]>

Free event queues even for recursive finalizers

For finalizers we can register yet another finalizer out from finalizer, and
iff finalizer will be in active_later_queue we can add finalizer to
activ

Free event queues even for recursive finalizers

For finalizers we can register yet another finalizer out from finalizer, and
iff finalizer will be in active_later_queue we can add finalizer to
activequeues, and we will have events in activequeues after event_base_free()
returns, which is not what we want (we even have an assertion for this).

A simple case is bufferevent with underlying (i.e. filters) in inactive queue.

Fixes: regress bufferevent/bufferevent_socket_filter_inactive

show more ...


# f337296a 04-Oct-2015 Azat Khuzhin <[email protected]>

Fix checking for make_base_notifiable()

Fixes: a068f2e5 ("event_debug_created_threadable_ctx_: fix compilation without
debug mode")
Found-after: 3e56da23 ("travis: add builds without debug mode into

Fix checking for make_base_notifiable()

Fixes: a068f2e5 ("event_debug_created_threadable_ctx_: fix compilation without
debug mode")
Found-after: 3e56da23 ("travis: add builds without debug mode into matrix")

show more ...


# a068f2e5 29-Sep-2015 Azat Khuzhin <[email protected]>

event_debug_created_threadable_ctx_: fix compilation without debug mode

The following command failed before:
$ ./configure --disable-debug-mode

Fixes: dcfb19a27b7760299bc9e7291c9abd88c59fd91a ("Deb

event_debug_created_threadable_ctx_: fix compilation without debug mode

The following command failed before:
$ ./configure --disable-debug-mode

Fixes: dcfb19a27b7760299bc9e7291c9abd88c59fd91a ("Debug mode option to error on
evthread init AFTER other event calls.")

show more ...


12345678910>>...17