morningman commented on code in PR #66399:
URL: https://github.com/apache/doris/pull/66399#discussion_r3733146044


##########
be/src/service/CMakeLists.txt:
##########
@@ -49,6 +49,24 @@ if (${MAKE_TEST} STREQUAL "OFF" AND ${BUILD_BENCHMARK} 
STREQUAL "OFF")
     # This permits libraries loaded by dlopen to link to the symbols in the 
program.
     set_target_properties(doris_be PROPERTIES ENABLE_EXPORTS 1)
 
+    # ...but not the symbols of the RocksDB we link statically. Exporting 
those makes this
+    # executable the definition every later-loaded library binds to, and a JNI 
library that
+    # carries its own RocksDB then runs half on ours: the fluss scanner 
bundles frocksdbjni,
+    # whose librocksdbjni.so defines 2576 rocksdb symbols under names 
identical to ours but
+    # was built against the pre-C++11 libstdc++ string ABI. Objects laid out 
by one and used
+    # by the other yield a garbage length, an std::bad_alloc that escapes the 
JNI frame, and
+    # an aborted BE. Hiding this archive lets that library bind to its own 
copy.
+    #
+    # Scoped to the archive rather than dropping ENABLE_EXPORTS: what needs 
the exports is
+    # native UDFs (runtime/user_function_cache.cpp dlopens them), and those 
use the Doris UDF
+    # ABI, which has nothing to do with RocksDB. Crash stacks do not need it 
either -- they are
+    # symbolized from debug info, which is why they name even 
anonymous-namespace functions.
+    #
+    # The same library also duplicates zstd, lz4, snappy, bzip2 and zlib 
symbols. Those are C
+    # ABIs, stable across versions and layout-free, so they are left alone 
until something
+    # shows otherwise -- unlike RocksDB, whose C++ objects are what actually 
corrupt.
+    target_link_options(doris_be PRIVATE "-Wl,--exclude-libs,librocksdb.a")

Review Comment:
   Confirmed, and the CI log says it verbatim — `ld: unknown options: 
--exclude-libs` while linking `doris_be` in **BE UT (macOS)**. Worth noting for 
anyone reading this later that the `MAKE_TEST STREQUAL "OFF"` guard around that 
block does not spare the check: `be-ut-mac.yml` runs `./build.sh --be`, and 
build.sh configures with `-DMAKE_TEST=OFF`, so that job really does reach the 
link.
   
   Fixed in 6922ab5bb42, which gates the option to non-Darwin. macOS does not 
need an equivalent: dyld’s two-level namespace already binds each loaded 
library to the copy it was linked against, so a JNI library carrying its own 
RocksDB never resolves to ours in the first place.



##########
fe/fe-connector/fe-connector-fluss/src/main/resources/META-INF/services/org.apache.doris.connector.spi.ConnectorProvider:
##########
@@ -0,0 +1 @@
+org.apache.doris.connector.fluss.FlussConnectorProvider

Review Comment:
   Fixed in 78263874870. It was the only one of the ten connector service 
descriptors without a header — the other nine carry the same `#`-comment block, 
so this one is now byte-identical to them. `#` is a comment in the 
ServiceLoader format, and `FlussConnectorProviderTest` already asserts the 
provider still resolves through `ServiceLoader`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to