Skip to content

dym: use fn_addr_eq for function pointer comparison#44654

Merged
agrawroh merged 1 commit into
envoyproxy:mainfrom
ovadiagal:govadia/fix-set-factory-once
Apr 24, 2026
Merged

dym: use fn_addr_eq for function pointer comparison#44654
agrawroh merged 1 commit into
envoyproxy:mainfrom
ovadiagal:govadia/fix-set-factory-once

Conversation

@ovadiagal
Copy link
Copy Markdown
Contributor

@ovadiagal ovadiagal commented Apr 24, 2026

Small fix to rust dynamic modules SDK.

Came across this issue when trying to bump dynamic-modules-examples to 1.38.0:

error: function pointer comparisons do not produce meaningful results since their addresses are not guaranteed to be unique
  --> src/lib.rs:66:1
   |
66 | / declare_all_init_functions!(init,
67 | |     http: new_http_filter_config_fn,
68 | |     network: new_network_filter_config_fn,
69 | |     udp_listener: new_udp_listener_filter_config_fn
70 | | );
   | |_^
   |
   = note: the address of the same function can vary between different codegen units
   = note: furthermore, different functions could have the same address after being merged together
   = note: for more information visit <https://doc.rust-lang.org/nightly/core/ptr/fn.fn_addr_eq.html>
   = note: this error originates in the macro `envoy_proxy_dynamic_modules_rust_sdk::set_factory_once` which comes from the expansion of the macro `declare_all_init_functions` (in Nightly builds, run with -Z macro-backtrace for more info)

Commit Message: dym: use fn_addr_eq for function pointer comparison
Additional Description:
Risk Level: Low
Testing: N/A
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]

@repokitteh-read-only
Copy link
Copy Markdown

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #44654 was opened by ovadiagal.

see: more, trace.

@ovadiagal ovadiagal changed the title fix: use fn_addr_eq for function pointer comparison in set_factory_once dym: use fn_addr_eq for function pointer comparison Apr 24, 2026
Signed-off-by: Gal Ovadia <ggalovadia@gmail.com>
@ovadiagal ovadiagal force-pushed the govadia/fix-set-factory-once branch from d280b37 to 08cc6ac Compare April 24, 2026 19:54
@ovadiagal ovadiagal marked this pull request as ready for review April 24, 2026 19:55
@agrawroh agrawroh self-assigned this Apr 24, 2026
@agrawroh agrawroh merged commit b218c0b into envoyproxy:main Apr 24, 2026
29 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.

2 participants