Re:Tracking down a segfault that suddenly started happening
by flqn on Monday January 18, 2021 @05:23AM
(#25820262)
I don't think static linking saves you here. This looks to be caused by an ODR violation (the "one definition rule"). The linker has two symbols with the same identifier and has to choose one.
[ Parent
| on HN ]
Re:Tracking down a segfault that suddenly started happening
by mkj on Monday January 18, 2021 @07:37AM
(#25821166)
Static linking would error out with something like
bar.c:(.text+0x0): multiple definition of `socket_send'
at compile time.
(edit: I mean static linking everything including third party libraries)
Re:Tracking down a segfault that suddenly started happening
by DarkmSparks on Monday January 18, 2021 @07:45AM
(#25821231)
it was statically linked.
the issue was caused by another dynamically linked library referencing a different library at run time on a different linux distro than it was built on.
even says as much in the article.
Re:Tracking down a segfault that suddenly started happening
by vardump on Monday January 18, 2021 @06:49AM
(#25820788)
Perhaps this should trigger a warning. Or even an error with an option to provide (or generate with a known good configuration) an exclusion list for those.
Yeah, there are probably a lot of ways this would still cause issues. In any larger project with non-trivial dependencies, C-ABI generates a lot of extra work. At least without decorated (= mangled) function names...