Bug #101231 | Min required Protobuf version not properly detected | ||
---|---|---|---|
Submitted: | 19 Oct 2020 16:56 | Modified: | 10 Nov 2020 8:37 |
Reporter: | Georgi Sotirov | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Compiling | Severity: | S3 (Non-critical) |
Version: | 8.0 | OS: | Linux (Slackware) |
Assigned to: | CPU Architecture: | x86 |
[19 Oct 2020 16:56]
Georgi Sotirov
[19 Oct 2020 17:24]
Georgi Sotirov
Just to confirm that MySQL 8.0.22 builds without problem (i.e. without compilation errors) with system Protobuf 3.11.4 in otherwise the same environment, which confirms that 3.11.x is now the minimum required version. The relevant lines form the log: ... -- WITH_PROTOBUF=system -- Found Protobuf: /usr/lib/libprotobuf.so;-lpthread (found version "3.11.4") -- PROTOBUF_VERSION_NUMBER is #define GOOGLE_PROTOBUF_VERSION 3011004 -- PROTOBUF_INCLUDE_DIR /usr/include -- PROTOBUF_LIBRARY /usr/lib/libprotobuf.so -- PROTOBUF_LITE_LIBRARY /usr/lib/libprotobuf-lite.so -- PROTOBUF_PROTOC_EXECUTABLE /usr/bin/protoc -- Found CURL: /usr/lib/libcurl.so (found version "7.73.0") ...
[21 Oct 2020 14:10]
MySQL Verification Team
Hi Mr. Sotirov, Thank you for your bug report. We have tried the same setup and finished with the same error. Verified as reported.
[21 Oct 2020 14:11]
MySQL Verification Team
Setting correct version.
[3 Nov 2020 11:17]
Tor Didriksen
Posted by developer: I downloaded and built: https://github.com/protocolbuffers/protobuf/releases/tag/v3.2.0 (note, there is no 3.2.1 release) wget https://github.com/protocolbuffers/protobuf/releases/download/v3.2.0/protobuf-cpp-3.2.0.ta... and installed it to /tmp/proto320 Checking one of your missing symbols: nm /tmp/proto320/lib/libprotoc.so.12 | grep _ZNK6google8protobuf8compiler13CodeGenerator11GenerateAllERKSt6vectorIPKNS0_14FileDescriptorESaIS6_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPNS1_16GeneratorContextEPSG_ 000000000009ba90 T _ZNK6google8protobuf8compiler13CodeGenerator11GenerateAllERKSt6vectorIPKNS0_14FileDescriptorESaIS6_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPNS1_16GeneratorContextEPSG_ 0000000000083c76 t _ZNK6google8protobuf8compiler13CodeGenerator11GenerateAllERKSt6vectorIPKNS0_14FileDescriptorESaIS6_EERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPNS1_16GeneratorContextEPSG_.cold To me it seems something is wrong with your system protobuf.
[3 Nov 2020 12:30]
MySQL Verification Team
Thank you , Tor.
[3 Nov 2020 12:51]
Georgi Sotirov
There is of course version 3.2.1 of Protobuf (see https://github.com/protocolbuffers/protobuf/releases/tag/v3.2.1), which I'm building like this: autoreconf -vif ./configure --prefix=/usr \ --libdir=/usr/lib \ --docdir=/usr/doc/protobuf-3.2.1 \ --enable-shared=yes \ --enable-static=no \ --enable-silent-rules \ --with-zlib make V=1 -j4 && make install This gives me the following when searching for the first undefined symbol: $ nm /usr/lib/libprotoc.so.12.0.0 | grep WriteStringMaybeAliased U _ZN6google8protobuf8internal14WireFormatLite23WriteStringMaybeAliasedEiRKSsPNS0_2io17CodedOutputStreamE Why is that I cannot say, because I'm not that familiar with Protobuf library, but I definitely do not have this problem with Protobuf 3.11.2 built in the same way. Wasn't this already verified? Please, check MySQL Verification Team's comment from 2020-10-21, which states "We have tried the same setup and finished with the same error." - how did they got to the same error as me?
[3 Nov 2020 13:05]
Tor Didriksen
nm /tmp/proto321/lib/libprotobuf.so | grep WriteStringMaybeAliased 00000000000ead90 T _ZN6google8protobuf8internal14WireFormatLite23WriteStringMaybeAliasedEiRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPNS0_2io17CodedOutputStreamE 00000000000c8fde t _ZN6google8protobuf8internal14WireFormatLite23WriteStringMaybeAliasedEiRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPNS0_2io17CodedOutputStreamE.cold
[3 Nov 2020 13:15]
MySQL Verification Team
Hi, MySQL verification team has run with this problem with version 3.2.1. Since downgrading that library, the problems have gone.
[3 Nov 2020 13:18]
Tor Didriksen
the difference seems to be: std::__cxx11::basic_string<char,<char> vs std::basic_string<char, std::char_traits<char> MySQl is built -std=c++14 which will use cxx11 strings
[3 Nov 2020 18:45]
Georgi Sotirov
OK. That's an excellent clue. Thanks. These are the flags for my compilation of 8.0.21: -- CMAKE_CXX_FLAGS: -std=c++14 -fno-omit-frame-pointer -ffp-contract=off -ftls-model=initial-exec -O3 -march=i586 -mtune=i686 -fPIC -Wall -Wextra -Wformat-security -Wvla -Wundef -Woverloaded-virtual -Wcast-qual -Wimplicit-fallthrough=2 -Wstringop-truncation -Wlogical-op And these are for 8.0.22: -- CMAKE_CXX_FLAGS: -std=c++14 -fno-omit-frame-pointer -ffp-contract=off -ftls-model=initial-exec -O3 -march=i586 -mtune=i686 -fPIC -Wall -Wextra -Wformat-security -Wvla -Wundef -Woverloaded-virtual -Wcast-qual -Wimplicit-fallthrough=2 -Wstringop-truncation -Wsuggest-override -Wlogical-op Clearly -std=c++14 is present in both, but I only encountered the reported problem when trying to build MySQL 8.0.22. There is a subtle difference (flag -Wsuggest-override added for 8.0.22), which I do not think is related. I checked my build log for Protobuf 3.2.1 (with GCC 5.5.0) and it indicates that it was done with -std=c++11 flag, but it's not something I enforced. In the build for Protobuf 3.11.4 (with GCC 9.3.0) there is no -std flag, but C++14 is the default in GCC from 6.1 to 10 (see https://gcc.gnu.org/projects/cxx-status.html#cxx14). This rather explains why my build with Protobuf 3.11.4 is OK, but I'm still not sure how until MySQL 8.0.21 there was no problem when building with Protobuf 3.2.1. Anyway, I think it's clear now that the problem was into my build environment (Protobuf and MySQL built with different compilation flags), so please, close the bug. P.S. I would however continue building MySQL with the same Protobuf version that is shipped in the source archive (i.e. 3.11.4).
[10 Nov 2020 8:37]
Terje Røsten
Thanks for your feedback! Closing bug as requested.
[10 Nov 2020 12:19]
MySQL Verification Team
Thank you, Terje .......