apache / trafficserver

Apache Traffic Server™ is a fast, scalable and extensible HTTP/1.1 and HTTP/2 compliant caching proxy server.
https://trafficserver.apache.org/
Apache License 2.0
1.78k stars 790 forks source link

AddressSanitizer: odr-violation: global 'DbgCtl::_config_mode' #11269

Closed masaori335 closed 2 months ago

masaori335 commented 3 months ago

ATS: 10.0.x

traffic_server[13596]: =================================================================
traffic_server[13596]: ==13596==ERROR: AddressSanitizer: odr-violation (0x7fcdb696de40):
traffic_server[13596]: [1] size=4 'DbgCtl::_config_mode' /src/tsutil/DbgCtl.cc
traffic_server[13596]: [2] size=4 'DbgCtl::_config_mode' /src/tsutil/DbgCtl.cc
traffic_server[13596]: These globals were registered at these points:
traffic_server[13596]: [1]:
traffic_server[13596]: #0 0x560c276d32f6  (traffic_server+0x5652f6) (BuildId: 418b7e70c189268d136aaa6c3a244ee763ad0e18)
traffic_server[13596]: #1 0x7fce5e3d29c2  (/lib64/ld-linux-x86-64.so.2+0xf9c2) (BuildId: 62c449974331341bb08dcce3859560a22af1e172)
traffic_server[13596]: #2 0x7fff2298ef88  ([stack]+0x20f88)
traffic_server[13596]: [2]:
traffic_server[13596]: #0 0x560c276d32f6  (traffic_server+0x5652f6) (BuildId: 418b7e70c189268d136aaa6c3a244ee763ad0e18)
traffic_server[13596]: #1 0x560c27797aac  (traffic_server+0x629aac) (BuildId: 418b7e70c189268d136aaa6c3a244ee763ad0e18)
traffic_server[13596]: ==13596==HINT: if you don't care about these errors you may set ASAN_OPTIONS=detect_odr_violation=0
traffic_server[13596]: SUMMARY: AddressSanitizer: odr-violation: global 'DbgCtl::_config_mode' at /src/tsutil/DbgCtl.cc
traffic_server[13596]: ==13596==ABORTING
ywkaras commented 3 months ago

It looks like that variable is getting defined in 3 core plugins as well as the core executable:

wkaras ~/TSX/TS
O$ nm -C -A $(find . -name traffic_server -o -name \*.so ) | grep ' [^U] DbgCtl::_config_mode'
./bin/traffic_server:00000000010793c8 B DbgCtl::_config_mode
./libexec/trafficserver/s3_auth.so:0000000000080090 B DbgCtl::_config_mode
./libexec/trafficserver/access_control.so:0000000000071788 B DbgCtl::_config_mode
./libexec/trafficserver/maxmind_acl.so:00000000000c4498 B DbgCtl::_config_mode
wkaras ~/TSX/TS
O$ nm -C -A $(find . -name traffic_server -o -name \*.so ) | grep ' U DbgCtl::_config_mode' | head
./lib/libtscppapi.so:                 U DbgCtl::_config_mode
./libexec/trafficserver/authproxy.so:                 U DbgCtl::_config_mode
./libexec/trafficserver/background_fetch.so:                 U DbgCtl::_config_mode
./libexec/trafficserver/cache_promote.so:                 U DbgCtl::_config_mode
./libexec/trafficserver/cache_range_requests.so:                 U DbgCtl::_config_mode
./libexec/trafficserver/cachekey.so:                 U DbgCtl::_config_mode
./libexec/trafficserver/certifier.so:                 U DbgCtl::_config_mode
./libexec/trafficserver/compress.so:                 U DbgCtl::_config_mode
./libexec/trafficserver/conf_remap.so:                 U DbgCtl::_config_mode
./libexec/trafficserver/escalate.so:                 U DbgCtl::_config_mode
wkaras ~/TSX/TS
O$ 

Can you give more details of the context in which you saw this error?

ywkaras commented 3 months ago

As a result of this, we probably can't get debug output in those 3 plugins.

masaori335 commented 3 months ago

I got this report right after starting ASan build of ATS 10.0.x branch. FWIW, we have s3_auth and access_control plugin.

bryancall commented 2 months ago

This PR fixed the issue: #11283