Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib: fix affinity map duplicate #15317

Merged
merged 1 commit into from
Feb 7, 2024

Conversation

louis-6wind
Copy link
Contributor

Fix duplicate definition of frr_affinity_map_cli_info in libfrr.so.0 and libmgmt_be_nb.so.0

=================================================================
==3860488==ERROR: AddressSanitizer: odr-violation (0x7f12c98c4d20):
[1] size=296 'frr_affinity_map_cli_info' lib/affinitymap_cli.c:77:35
[2] size=296 'frr_affinity_map_cli_info' lib/affinitymap_cli.c:77:35
These globals were registered at these points:
[1]:
#0 0x7f12c9a36f40 in __asan_register_globals ../../../../src/libsanitizer/asan/asan_globals.cpp:341
#1 0x7f12c9585b7d in _sub_I_00099_1 (/lib/libfrr.so.0+0x185b7d)
#2 0x7f12ca437fe1 in call_init elf/dl-init.c:72

[2]:
#0 0x7f12c9a36f40 in __asan_register_globals ../../../../src/libsanitizer/asan/asan_globals.cpp:341
#1 0x7f12c93824ed in _sub_I_00099_1 (/lib/libmgmt_be_nb.so.0+0x6f4ed)
#2 0x7f12ca437fe1 in call_init elf/dl-init.c:72

==3860488==HINT: if you don't care about these errors you may set ASAN_OPTIONS=detect_odr_violation=0
SUMMARY: AddressSanitizer: odr-violation: global 'frr_affinity_map_cli_info' at lib/affinitymap_cli.c:77:35
==3860488==ABORTING

Fixes: dc6ff4c ("lib: convert affinity-map to mgmtd")

Copy link
Contributor

@choppsv1 choppsv1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the actual problem is that we are linking affinitymap_cli.c into mgmtd twice, once directly into the mgmtd library and once in the libfrr library.

Copy link
Contributor

@idryzhov idryzhov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chris is right about the actual problem. Let's not move CLI-related code from _cli.c to _northbound.c, please. The correct fix is to remove linking of lib/affinitymap_cli.c from mgmtd/subdir.am.

@choppsv1
Copy link
Contributor

choppsv1 commented Feb 7, 2024

The change should just be:

modified   mgmtd/subdir.am
@@ -19,7 +19,6 @@ mgmtd_libmgmt_be_nb_la_SOURCES = \
 	zebra/zebra_cli.c \
 	# end
 nodist_mgmtd_libmgmt_be_nb_la_SOURCES = \
-	lib/affinitymap_cli.c \
 	# end
 mgmtd_libmgmt_be_nb_la_CFLAGS = $(AM_CFLAGS) -DINCLUDE_MGMTD_CMDDEFS_ONLY
 mgmtd_libmgmt_be_nb_la_CPPFLAGS = $(AM_CPPFLAGS) -DINCLUDE_MGMTD_CMDDEFS_ONLY

Can you update this PR with this change @louis-6wind ?

Fix duplicate definition of frr_affinity_map_cli_info in libfrr.so.0 and
libmgmt_be_nb.so.0

> =================================================================
> ==3860488==ERROR: AddressSanitizer: odr-violation (0x7f12c98c4d20):
>   [1] size=296 'frr_affinity_map_cli_info' lib/affinitymap_cli.c:77:35
>   [2] size=296 'frr_affinity_map_cli_info' lib/affinitymap_cli.c:77:35
> These globals were registered at these points:
>   [1]:
>     #0 0x7f12c9a36f40 in __asan_register_globals ../../../../src/libsanitizer/asan/asan_globals.cpp:341
>     #1 0x7f12c9585b7d in _sub_I_00099_1 (/lib/libfrr.so.0+0x185b7d)
>     #2 0x7f12ca437fe1 in call_init elf/dl-init.c:72
>
>   [2]:
>     #0 0x7f12c9a36f40 in __asan_register_globals ../../../../src/libsanitizer/asan/asan_globals.cpp:341
>     #1 0x7f12c93824ed in _sub_I_00099_1 (/lib/libmgmt_be_nb.so.0+0x6f4ed)
>     #2 0x7f12ca437fe1 in call_init elf/dl-init.c:72
>
> ==3860488==HINT: if you don't care about these errors you may set ASAN_OPTIONS=detect_odr_violation=0
> SUMMARY: AddressSanitizer: odr-violation: global 'frr_affinity_map_cli_info' at lib/affinitymap_cli.c:77:35
> ==3860488==ABORTING

Fixes: dc6ff4c ("lib: convert affinity-map to mgmtd")
Signed-off-by: Louis Scalbert <[email protected]>
@github-actions github-actions bot added size/XS and removed size/M labels Feb 7, 2024
@ton31337 ton31337 added this to the 10.0 milestone Feb 7, 2024
@ton31337 ton31337 merged commit acd7b69 into FRRouting:master Feb 7, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants