Skip to content

Conversation

@maxime-leroy
Copy link
Collaborator

Didn't have time to reproduce the crash. But it fixes a real bug for sure.

The zebra dplane shutdown logic has two steps. First,
zebra_dplane_pre_finish() is called with early == true.
In this phase, the dataplane thread and its event loop are still running,
and event_cancel_async() must be used to safely cancel timers.

Later, zebra_dplane_shutdown() is called with early == false. At this
point, the dataplane thread has exited, its event loop has been freed,
and its pointer has been set to NULL.

Calling event_cancel_async() in the second phase dereferences a NULL
pointer, causing a SIGSEGV. This commit ensures that event_cancel_async()
is only called during the early shutdown phase.

The second timer (dg_t_zebra_update) runs on the main thread. It is
canceled in the early phase using event_cancel(), which is safe from the
main context. There's no need to cancel it again in the final phase.

Signed-off-by: Maxime Leroy <[email protected]>
@vjardin
Copy link
Contributor

vjardin commented May 28, 2025

LGTM. Very good analysis from the commit log.

@rjarry rjarry merged commit 66529dd into DPDK:main May 29, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants