[odb-users] Internal compiler error linked to spdlog

Sten Kultakangas ratkaisut at gmail.com
Sun May 3 11:15:59 EDT 2020


Hi. How did you build ODB ? Try to build it using these commands. And then
make sure to remove it from /usr/local or a similar location
It's not a good idea to install ODB to /usr/local or to the same directory
as build2.
Also it's not a good idea to build ODB when you have some junk in
CPATH, LIBRARY_PATH or LD_LIBRARY_PATH environment variables.
We maintain strict isolation between ODB, build2, distribution-provided
development packages and non-distribution-provided packages and there are
no issues with ABI compatibility.

mkdir build2-build
cd build2-build
wget https://download.build2.org/0.12.0/build2-install-0.12.0.sh
chmod +x build2-install-0.12.0.sh
./build2-install-0.12.0.sh /opt/build2
cd ..

export PATH=/opt/build2/bin:$PATH
bpkg create -d odb-gcc-8 cc config.cxx=g++ config.cc.coptions=-O3
config.install.root=/opt/odb
cd odb-gcc-8
bpkg build odb at https://pkg.cppget.org/1/beta
bpkg test odb
bpkg install odb

export PATH=/opt/odb/bin:$PATH

cd ..
bpkg create -d libodb-gcc-8 config.cxx=g++ config.cc.coptions=-O3
config.install.root=/opt/odb
cd libodb-gcc-8
bpkg add https://pkg.cppget.org/1/beta
bpkg fetch
bpkg build libodb
bpkg build libodb-mysql
bpkg build libodb-mssql
bpkg build libodb-boost
bpkg install --all --recursive

After that make sure your development environment has the following
environment variables
export PATH=/opt/odb/bin:$PATH
export CPATH=/opt/odb/include:$CPATH
export LD_LIBRARY_PATH=/opt/odb/lib:$LD_LIBRARY_PATH
export LIBRARY_PATH=/opt/odb/lib:$LIBRARY_PATH


On Sun, May 3, 2020 at 5:00 PM Sean Clarke <sean.clarke at sec-consulting.co.uk>
wrote:

> Hi,
>    a few may recall I have had some previous issues with ODB and compiler
> seg faults when using Debian 10 or odb 2.5 on anything other than Devian 9
> (stretch). I tried compiling teh latest version and in teh end gave up and
> removed ODB from that workflow.
>
> Having had some time I have revisited and have identified some sort of
> incompatibility between a logging library and its use of fmt.
>
> It is a bit complex and I have had to change a few things to get it down to
> a small test set - but essentially if I add some logging in one of the ODB
> compiled classes I get an ODB compiler seg fault, remove the logging and it
> is all fine (that statement also means the application runs fine, nit just
> compiles).
>
> The logline is in a simple accessor:
>
> (include):
> //#include <spdlog/spdlog.h>
>
> and accessor statement:
> std::shared_ptr<Address> const& address() const {
> //    if (m_short_code == "PRIVATE") {
> //        auto log = spdlog::get("main");
> //        log->error("Customer::address : Customer address of PRIVATE
> customer cannot be accessed");
> //    }
>     return m_address;
> }
>
> The logging library is spdlog:
> libspdlog-dev - Very fast, header only, C++ logging library
>
> Interestingly the problem was more prominent with the later version that is
> packaged in Debian 10 (Buster),
>
> Debian 10 version is 1:1.3.1-1, Debian 9 is 1:0.11.0-2
>
> I do not believe (I may be wrong) that the issue is directly related to the
> logging library, I believe this, as I have had a similar seg fault when
> using an anonymous function inline in a database class that did nothing
> more than string manipulation in the standard library.
>
> Stack trace from the above code looks like:
>
> [  1%] Generating src/types/odb_gen/MyClass-odb.cxx
> *** WARNING *** there are active plugins, do not report this as a bug
> unless
> you can reproduce it without enabling any plugins.
> Event                            | Plugins
> PLUGIN_START_UNIT                | odb
> PLUGIN_PRAGMAS                   | odb
> PLUGIN_OVERRIDE_GATE             | odb
> In file included from /usr/include/spdlog/fmt/bundled/format.h:3545:0,
>                  from /usr/include/spdlog/fmt/fmt.h:21,
>                  from /usr/include/spdlog/common.h:28,
>                  from /usr/include/spdlog/spdlog.h:12,
>                  from src/types/More_of_my_classes.hpp:3,
>                  from src/types/Another_one_of_my_classes.hpp:4,
>                  from src/types/MyClass.hpp:3:
> /usr/include/spdlog/fmt/bundled/format-inl.h: In function 'int
> fmt::v5::{anonymous}::safe_strerror(int, char*&, std::size_t)':
> /usr/include/spdlog/fmt/bundled/format-inl.h:99:5: internal compiler error:
> Segmentation fault
>  int safe_strerror(
>      ^~~~~~~~~~~~~
> Please submit a full bug report,
> with preprocessed source if appropriate.
> See <file:///usr/share/doc/gcc-6/README.Bugs> for instructions.
>
> Has anyone else seen anything similar?
>
> Regards
> Sean Clarke
>


More information about the odb-users mailing list