From finjulhich at gmail.com Mon Oct 1 17:11:40 2018 From: finjulhich at gmail.com (MM) Date: Mon Oct 1 17:20:02 2018 Subject: [odb-users] internal compiler error: cult:compiler::context::no_entry Message-ID: On Thu, 30 Aug 2018 at 15:17, Boris Kolpackov wrote: > MM writes: > > > On Mon, 6 Aug 2018 at 13:13, Boris Kolpackov > wrote: > > > > > MM writes: > > > > > > > odb -d sqlite --sqlite-override-null --std c++14 --profile boost > > > > --omit-drop --generate-query --generate-schema-only --schema-format > sql > > > > --at-once -I/src -I/usr/include --changelog-dir /src/odb > --options-file > > > > /src/vendors/odb/boost-multiarray.options --input-name mydbname > > > > /src/file_1.hpp ... /src/file_n.hpp > > > > > > > > Does the odb compiler use each header file argument separately? or > does > > > > it concatenate all the headers to produce the SQL. > > > > > > Since you have specified the --at-once option, they are effectively > > > concatenated in the order specified on the command line. > > > > Still to try to reduce to a reportable example, 1 more question: > > > > In this resulting concatenated stream of c++ code, what happens to > #include > > directives? They are processed as usual? > > Yes, the files are just concatenated together and compiled as a single > translation unit. You can see the relevant code in odb/odb.cxx starting > at line 801: > > https://git.codesynthesis.com/cgit/odb/odb/tree/odb/odb.cxx I have traced where this exception: > terminate called after throwing an instance of > 'cutl::compiler::context::no_entry' is thrown from: cutl/compiler/context.txx from template X& context::get (std::string const& key); key = "compiler-id-type" internal compiler error: Aborted using nstring = odb::nullable; #pragma db member(prtfelt::strat) virtual(mynamespace::nstring) Is this any indication at all that the data member is missing a id_type pragma? Apologies for not having yet a reproducible case, I have been trying for weeks. Thanks, From dp-odb at dproft.de Tue Oct 2 09:32:47 2018 From: dp-odb at dproft.de (Dennis Proft) Date: Tue Oct 2 09:41:06 2018 Subject: [odb-users] Bug in odb compiler using gcc-8 and boost headers Message-ID: <123462a7-1b0d-9bf5-989c-a1e63dcb1e3a@dproft.de> Hi, i'm currently working on a project using odb together with boost on a debian testing machine (exakt versions of involved packages are attached below). I found a bug in the odb compiler, which crashes with an "internal compiler error: Segmentation fault" (for complete output see below) at a more or less random position in a header file. I tried the 2.4.0-version of odb from debian-testing and the beta 2.5.0-b.9 from a fresh build2-build. The error only occurs as soon as i include some boost headers (in my example i used #include ). Otherwise it compiles the cxx and hxx files fine. Using gdb i traced the error to be a null pointer dereference in the function parser::impl::collect(tree_node*) in odb-2.5.0-b.9/odb/parser.cxx:879. I fixed it by inserting a check for the null pointer and simply returning from the function because it looks like it ran into a dead end during some tree traversal. Below, i included my "simple patch", but i'm not sure if there are negative side effects. In my case it works. Best regards, Dennis -- details -- $ g++ --version g++ (Debian 8.2.0-7) 8.2.0 $ dpkg -l | grep gcc-8 ii gcc-8 8.2.0-7 ii gcc-8-base:amd64 8.2.0-7 ii gcc-8-multilib 8.2.0-7 ii gcc-8-plugin-dev 8.2.0-7 $ dpkg -l | grep libboost-dev ii libboost-dev:amd64 1.62.0.1 (odb compiled using build2 and debug symbols ("b configure config.cxx.coptions=-g")) $ /usr/local/bin/odb --version ODB object-relational mapping (ORM) compiler for C++ 2.5.0-b.9 (Minimal example) $ cat t.hpp #include $ LANG=C /usr/local/bin/odb -d mysql t.hpp *** 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 during IPA pass: *free_lang_data In file included from /usr/local/include/odb/container-traits.hxx:211, from :4: /usr/local/include/odb/std-deque-traits.hxx:66:1: internal compiler error: Segmentation fault } ^ 0x7fb12a03dbc6 parser::impl::collect(tree_node*) /src/odb-build/odb-gcc-8/odb-2.5.0-b.9/odb/parser.cxx:879 0x7fb12a03de1f parser::impl::collect(tree_node*) /src/odb-build/odb-gcc-8/odb-2.5.0-b.9/odb/parser.cxx:943 0x7fb12a041918 parser::impl::parse(tree_node*, cutl::fs::basic_path const&) /src/odb-build/odb-gcc-8/odb-2.5.0-b.9/odb/parser.cxx:795 0x7fb12a041cab parser::parse(tree_node*, cutl::fs::basic_path const&) /src/odb-build/odb-gcc-8/odb-2.5.0-b.9/odb/parser.cxx:2310 0x7fb12a036c1e gate_callback /src/odb-build/odb-gcc-8/odb-2.5.0-b.9/odb/plugin.cxx:229 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See for instructions. $ cat nullptr.diff --- odb-gcc-8/odb-2.5.0-b.9/odb/parser.cxx 2018-05-26 17:16:34.000000000 +0200 +++ odb-gcc-X/odb-2.5.0-b.9/odb/parser.cxx 2018-09-26 22:40:47.577509308 +0200 @@ -876,6 +876,7 @@ collect (tree ns) { cp_binding_level* level = NAMESPACE_LEVEL (ns); + if (level == nullptr) return; tree decl = level->names; // Collect declarations. From boris at codesynthesis.com Thu Oct 4 02:40:23 2018 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Oct 4 02:48:35 2018 Subject: [odb-users] internal compiler error: cult:compiler::context::no_entry In-Reply-To: References: Message-ID: MM writes: > I have traced where this exception: > > > terminate called after throwing an instance of > > 'cutl::compiler::context::no_entry' > > is thrown from: > > cutl/compiler/context.txx from > > template X& context::get (std::string const& key); Can you send the complete stack trace? > key = "compiler-id-type" > > internal compiler error: Aborted > using nstring = odb::nullable; > #pragma db member(prtfelt::strat) virtual(mynamespace::nstring) > > Is this any indication at all that the data member is missing a id_type > pragma? No, I don't see anything wrong with it. What's strange thought is this 'compiler' word in the key. Do you have anything (e.g., a class) in your source code called 'compiler'? From finjulhich at gmail.com Thu Oct 4 13:51:48 2018 From: finjulhich at gmail.com (MM) Date: Thu Oct 4 14:00:20 2018 Subject: [odb-users] internal compiler error: cult:compiler::context::no_entry Message-ID: On Thu, 4 Oct 2018 at 07:40, Boris Kolpackov wrote: > MM writes: > > > I have traced where this exception: > > > > > terminate called after throwing an instance of > > > 'cutl::compiler::context::no_entry' > > > > is thrown from: > > > > cutl/compiler/context.txx from > > > > template X& context::get (std::string const& key); > > Can you send the complete stack trace? Here is the beautified stack trace with c++filt, all in /usr/local/libexec/odb/odb.so 1. std::string& cutl::compiler::context::get(char const*)+0x102 2. std::string context::indirect_value(cutl::compiler::context const&, std::string const&) 3. context::column_type(semantics::data_member&, std::string const&) 4. object_columns_base::column_type[abi:cxx11]() 5. terminate called after throwing an instance of 'usr/local/lib/exec/odb/odb.so( relational::sqlite::model::object_columns::type[abi:cxx11](semantics::data_member&)) cutl::compiler::context::no_entry' 6. relational::model::object_columns::traverse_column(semantics::data_member&, std::string const&, bool) 7. object_columns_base::traverse_member(semantics::data_member&, semantics::type&) 8. relational::model::object_columns::traverse(semantics::data_member&, semantics::type&, std::string const&, std::string const&, semantics::class_*) 9. relational::model::member_create::traverse_container(semantics::data_member&, semantics::type&) 10. object_members_base::member::traverse(semantics::data_member&) 11. relational::model::class_::traverse(semantics::class_&) 12. cutl::compiler::dispatcher::dispatch(semantics::node&) 13. cutl::compiler::dispatcher::dispatch(semantics::edge&) 14. object_members_base::traverse_object(semantics::class_&) 15. relational::model::member_create::traverse_object(semantics::class_&) 16. object_members_base::traverse(semantics::class_&) 17. relational::model::class_::traverse(semantics::class_&) 18. cutl::compiler::dispatcher::dispatch(semantics::node&) > > key = "compiler-id-type" > > > > internal compiler error: Aborted > > using nstring = odb::nullable; > > #pragma db member(prtfelt::strat) virtual(mynamespace::nstring) > > > > Is this any indication at all that the data member is missing a id_type > > pragma? > > No, I don't see anything wrong with it. What's strange though is this > 'compiler' word in the key. Do you have anything (e.g., a class) in your > source code called 'compiler'? Really sorry, I copied wrong: Right before throwing, I added this code: std::cerr <<"Cannot get key: "<< key< References: <123462a7-1b0d-9bf5-989c-a1e63dcb1e3a@dproft.de> Message-ID: Dennis Proft writes: > The error only occurs as soon as i include some boost headers (in my > example i used #include ). Thanks for the bug report and analysis/test case! This turns out to be caused by a namespace alias in /usr/include/c++/8/cxxabi.h:678 that we didn't handle properly: namespace abi = __cxxabiv1; I've committed the fix: https://git.codesynthesis.com/cgit/odb/odb/commit/?id=3a1788234bfaa96ee093b68e9ba02cf7d5bdffe6 Let me know if you would like me to stage a version with this fix. From boris at codesynthesis.com Fri Oct 5 08:04:22 2018 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Oct 5 08:12:36 2018 Subject: [odb-users] internal compiler error: cult:compiler::context::no_entry In-Reply-To: References: Message-ID: MM writes: > Right before throwing, I added this code: > > std::cerr <<"Cannot get key: "<< key< > which produces: > > Cannot get key: column-id-type Ok, then everything looks normal. A reproducer would, of course, be ideal. Failed that, try to print the name of the data member and show its and related definitions in your header file. From finjulhich at gmail.com Sat Oct 6 11:11:35 2018 From: finjulhich at gmail.com (MM) Date: Sat Oct 6 11:20:11 2018 Subject: [odb-users] internal compiler error: cult:compiler::context::no_entry Message-ID: On Fri, 5 Oct 2018 at 13:04, Boris Kolpackov wrote: > MM writes: > > > Right before throwing, I added this code: > > > > std::cerr <<"Cannot get key: "<< key< > > > which produces: > > > > Cannot get key: column-id-type > > Ok, then everything looks normal. A reproducer would, of course, be > ideal. Failed that, try to print the name of the data member and show > its and related definitions in your header file. I've printed the data member path like so: > static string > id_column_type () > { > context& c (context::current ()); > data_member_path& id (*context::id_member (*c.top_object)); > const auto& idvec = > static_cast&>(id); > for (const auto* m: idvec) > std::cerr << "data member="<< m->fq_name() < return id.back ()->get ("column-id-type"); > } key = "column-id-type" data member=::NS1::NS2::BaseClass::id_ namespace NS1 { namespace NS2 { class BaseClass { protected: std::uint32_t id_; }; }} id_ is a protected member of BaseClass and its c++ type is std::uint32_t A empty derived class is defined: > class DerivedClass : public BaseClass {}; The pragmas look like so: #include "DerivedClass.h" #pragma db object(BaseClass) polymorphic table("eqlogb") transient definition #pragma db member(BaseClass::id_) id unique #pragma db object(DerivedClass) abstract table("eqlogbl") transient definition I have added > type("INTEGER") and id_type("INTEGER") to the pragma for id_ The no_entry exception is still thrown. MM From asnagni at yahoo.com Tue Oct 16 06:31:07 2018 From: asnagni at yahoo.com (Alain-Serge Nagni) Date: Tue Oct 16 06:40:06 2018 Subject: [odb-users] Help need with build issue References: <1900674798.490118.1539685867684.ref@mail.yahoo.com> Message-ID: <1900674798.490118.1539685867684@mail.yahoo.com> Hi to everyone, ?? I got the code from the repository and I'm trying to build version 2.5.0-b.10 When I try to generate the odb configure file by running the? bootstrap scrip with this command:??????????????? ./bootstrap I will have these errors: ????? ????? configure.ac:12: error: possibly undefined macro: m4_equote ????? ????? ????? If this token and others are legitimate, please use m4_pattern_allow. ????? ????? ????? See the Autoconf documentation. ????? ????? configure.ac:12: error: possibly undefined macro: m4_ifdef ????? ????? configure.ac:12: error: possibly undefined macro: AM_PROG_AR ????? ????? autoreconf: /usr/bin/autoconf failed with exit status: 1 When I looked in the configure.ac at lin 12, this is what I saw:????????m4_equote()[m4_ifdef]m4_dquote()([AM_PROG_AR], [AM_PROG_AR]) # Required by automake 1.12. Since I'm using automake 1.15 I commented out that line to try get things moving (not sure if this is the correct approach). After the change, when I re-run the bootstrap scrip this is the error that I get: ????? ????? configure.ac:16: installing 'config/config.guess' ????? ????? configure.ac:16: installing 'config/config.sub' ????? ????? configure.ac:11: installing 'config/install-sh' ????? ????? configure.ac:11: installing 'config/missing' ????? ????? automake: error: no 'Makefile.am' found for any configure output ????? ????? automake: Did you forget AC_CONFIG_FILES([Makefile]) in configure.ac? ????? ????? autoreconf: automake failed with exit status: 1 Not sure where to look. Can anybody help. That will be appreciated. I'm on Linux and using:??????????? gcc version 6.4.1 ????????????automake 1.15 ??????????? autoreconf 12.2 Thank you. From boris at codesynthesis.com Tue Oct 16 08:12:49 2018 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Oct 16 08:21:39 2018 Subject: [odb-users] Help need with build issue In-Reply-To: <1900674798.490118.1539685867684@mail.yahoo.com> References: <1900674798.490118.1539685867684.ref@mail.yahoo.com> <1900674798.490118.1539685867684@mail.yahoo.com> Message-ID: Alain-Serge Nagni writes: > I got the code from the repository and I'm trying to build version > 2.5.0-b.10 The recommended way to build the latest pre-release is with build2 as described in this page: https://codesynthesis.com/products/odb/doc/install-build2.xhtml Let me know if you have any issues with this method. From asnagni at yahoo.com Tue Oct 16 18:51:49 2018 From: asnagni at yahoo.com (Alain-Serge Nagni) Date: Tue Oct 16 19:00:51 2018 Subject: [odb-users] Help need with build issue In-Reply-To: References: <1900674798.490118.1539685867684.ref@mail.yahoo.com> <1900674798.490118.1539685867684@mail.yahoo.com> Message-ID: <542489344.929527.1539730309438@mail.yahoo.com> Hi Boris,? Thank you for the info but when I try to build the odb package using build2, by using the command provided in the guide: ????bpkg create -d odb-gcc-6 cc???? \ ? ????config.cxx=g++????????????????? \ ? ????config.cc.coptions=-O3????????? \ ? ????config.bin.rpath=/usr/local/lib \ ? ????config.install.root=/usr/local? \ ????? config.install.sudo=sudo I will have an error. This is the error that I have: error: `create' is not a bpkg command. Did you mean one of these? ???? $ bpkg getdeps ???? $ bpkg init ???? $ bpkg install ???? $ bpkg json ???? $ bpkg list ???? $ bpkg package ???? $ bpkg show ???? $ bpkg suggest ???? $ bpkg term ???? $ bpkg update ???? $ bpkg utils Thank you. On Tuesday, October 16, 2018, 8:12:55 AM EDT, Boris Kolpackov wrote: Alain-Serge Nagni writes: > I got the code from the repository and I'm trying to build version > 2.5.0-b.10 The recommended way to build the latest pre-release is with build2 as described in this page: https://codesynthesis.com/products/odb/doc/install-build2.xhtml Let me know if you have any issues with this method. From boris at codesynthesis.com Wed Oct 17 05:03:04 2018 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Oct 17 05:11:58 2018 Subject: [odb-users] Help need with build issue In-Reply-To: <542489344.929527.1539730309438@mail.yahoo.com> References: <1900674798.490118.1539685867684.ref@mail.yahoo.com> <1900674798.490118.1539685867684@mail.yahoo.com> <542489344.929527.1539730309438@mail.yahoo.com> Message-ID: Alain-Serge Nagni writes: > [...] when I try to build the odb package using build2, by using the > command provided in the guide: > > bpkg create -d odb-gcc-6 cc \ > config.cxx=g++ \ > config.cc.coptions=-O3 \ > config.bin.rpath=/usr/local/lib \ > config.install.root=/usr/local \ > config.install.sudo=sudo > > I will have an error. This is the error that I have: > > error: `create' is not a bpkg command. > > Did you mean one of these? > $ bpkg getdeps > $ bpkg init > $ bpkg install > $ bpkg json > $ bpkg list > $ bpkg package > $ bpkg show > $ bpkg suggest > $ bpkg term > $ bpkg update > $ bpkg utils Looks like you have another executable called 'bpkg' in your path (most likely this[1]). Try running: $ which bpkg $ bpkg --version If you installed build2 into /usr/local (which is the default), then you should be able to fix this by adding /usr/local/bin to the beginning of your PATH: $ export PATH="/usr/local/bin:$PATH" Of course, an even simpler fix is to uninstall the other bpkg if you don't need it. [1] https://github.com/bpkg/bpkg From asnagni at yahoo.com Wed Oct 17 05:41:16 2018 From: asnagni at yahoo.com (Alain-Serge Nagni) Date: Wed Oct 17 05:50:19 2018 Subject: [odb-users] Help need with build issue In-Reply-To: References: <1900674798.490118.1539685867684.ref@mail.yahoo.com> <1900674798.490118.1539685867684@mail.yahoo.com> <542489344.929527.1539730309438@mail.yahoo.com> Message-ID: <448678932.128731.1539769276416@mail.yahoo.com> Hi Boris,? I was able to piece together all the information and I can having the system build now. I figure out that I needed to download the the pakage on the webpage: https://build2.org/download.xhtml an follow the instructions in the BOOTSTRAP-UNIX file. That was not very clear at the first reading for me, but it's all good now. Thank you very much for the info. Alain-Serge On Wednesday, October 17, 2018, 5:03:11 AM EDT, Boris Kolpackov wrote: Alain-Serge Nagni writes: > [...] when I try to build the odb package using build2, by using the > command provided in the guide: > >? ? bpkg create -d odb-gcc-6 cc? ? ? \ >? ? ? config.cxx=g++? ? ? ? ? ? ? ? ? \ >? ? ? config.cc.coptions=-O3? ? ? ? ? \ >? ? ? config.bin.rpath=/usr/local/lib \ >? ? ? config.install.root=/usr/local? \ >? ? ? config.install.sudo=sudo > > I will have an error. This is the error that I have: > > error: `create' is not a bpkg command. > > Did you mean one of these? >? ? ? $ bpkg getdeps >? ? ? $ bpkg init >? ? ? $ bpkg install >? ? ? $ bpkg json >? ? ? $ bpkg list >? ? ? $ bpkg package >? ? ? $ bpkg show >? ? ? $ bpkg suggest >? ? ? $ bpkg term >? ? ? $ bpkg update >? ? ? $ bpkg utils Looks like you have another executable called 'bpkg' in your path (most likely this[1]). Try running: $ which bpkg $ bpkg --version If you installed build2 into /usr/local (which is the default), then you should be able to fix this by adding /usr/local/bin to the beginning of your PATH: $ export PATH="/usr/local/bin:$PATH" Of course, an even simpler fix is to uninstall the other bpkg if you don't need it. [1] https://github.com/bpkg/bpkg From asnagni at yahoo.com Wed Oct 17 19:29:50 2018 From: asnagni at yahoo.com (Alain-Serge Nagni) Date: Wed Oct 17 19:38:55 2018 Subject: [odb-users] Internal Compiler error References: <1312217311.567717.1539818990968.ref@mail.yahoo.com> Message-ID: <1312217311.567717.1539818990968@mail.yahoo.com> Ho Boris,? I'm not sure where to report this error. I'm trying to build my project with the odb version 2.5.09 and I'm haveing an internal compiler error. ????????*** 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 ????????during GIMPLE pass: *warn_unused_result ????????In file included from /usr/local/include/odb/container-traits.hxx:217, ???????????????? ????????from :4: ????????/usr/local/include/odb/std-unordered-set-traits.hxx: In function ?void __static_initialization_and_destruction_0(int, int)?: ????????/usr/local/include/odb/std-unordered-set-traits.hxx:122:1: internal compiler error: Segmentation fault ?????????} First time I'm having this issue (I was using version 2.4.0). I'm not sure about what to do here. Please let me know if you need more info to help you figure out what is wrong. Compiler:? gcc 8.1.1Os:? Linuxdistribution:? Fedora 28 Thank you,Alain-Serge From boris at codesynthesis.com Thu Oct 18 07:34:22 2018 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Oct 18 07:43:21 2018 Subject: [odb-users] Internal Compiler error In-Reply-To: <1312217311.567717.1539818990968@mail.yahoo.com> References: <1312217311.567717.1539818990968.ref@mail.yahoo.com> <1312217311.567717.1539818990968@mail.yahoo.com> Message-ID: Alain-Serge Nagni writes: > I'm not sure where to report this error. I'm trying to build my project > with the odb version 2.5.09 and I'm haveing an internal compiler error. > > ????????*** 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 > ????????during GIMPLE pass: *warn_unused_result > ????????In file included from /usr/local/include/odb/container-traits.hxx:217, > ???????????????? ????????from :4: > ????????/usr/local/include/odb/std-unordered-set-traits.hxx: In function ?void __static_initialization_and_destruction_0(int, int)?: > ????????/usr/local/include/odb/std-unordered-set-traits.hxx:122:1: internal compiler error: Segmentation fault > ?????????} > > Compiler:? gcc 8.1.1Os:? Linuxdistribution:? Fedora 28 It would be helpful to get the stack trace as well as the test case (i.e., a subset of the header you are compiling) that reproduces the problem. To get the stack trace, re-run the ODB command with '-x -dH', for example: $ odb -x -dH ... test.hxx This should produce the core file. To analyze it, run: $ gdb -ex backtrace "$(g++ -print-file-name=cc1plus)" core This should produce the stack trace. Please include it with the test case. From asnagni at yahoo.com Thu Oct 18 17:50:22 2018 From: asnagni at yahoo.com (Alain-Serge Nagni) Date: Thu Oct 18 17:59:33 2018 Subject: [odb-users] Internal Compiler error In-Reply-To: References: <1312217311.567717.1539818990968.ref@mail.yahoo.com> <1312217311.567717.1539818990968@mail.yahoo.com> Message-ID: <0FA95F91-1EEB-4314-ACE4-55159DA95505@yahoo.com> Hi Boris, Problem fixed. It was an #include of a file that was causing the problem. I put the include in a #ifdef #endif statement and the problem is gone. What is strange is that it was not doing that with version 2.4.0 . Anyway thank you for your quick response and assistance . Thank you, Alain-Serge > On Oct 18, 2018, at 7:34 AM, Boris Kolpackov wrote: > > Alain-Serge Nagni writes: > >> I'm not sure where to report this error. I'm trying to build my project >> with the odb version 2.5.09 and I'm haveing an internal compiler error. >> >> *** 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 >> during GIMPLE pass: *warn_unused_result >> In file included from /usr/local/include/odb/container-traits.hxx:217, >> from :4: >> /usr/local/include/odb/std-unordered-set-traits.hxx: In function ?void __static_initialization_and_destruction_0(int, int)?: >> /usr/local/include/odb/std-unordered-set-traits.hxx:122:1: internal compiler error: Segmentation fault >> } >> >> Compiler: gcc 8.1.1Os: Linuxdistribution: Fedora 28 > > It would be helpful to get the stack trace as well as the test case > (i.e., a subset of the header you are compiling) that reproduces the > problem. > > To get the stack trace, re-run the ODB command with '-x -dH', for > example: > > $ odb -x -dH ... test.hxx > > This should produce the core file. To analyze it, run: > > $ gdb -ex backtrace "$(g++ -print-file-name=cc1plus)" core > > This should produce the stack trace. Please include it with the > test case. From boris at codesynthesis.com Fri Oct 19 10:17:42 2018 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Oct 19 10:26:42 2018 Subject: [odb-users] Internal Compiler error In-Reply-To: <0FA95F91-1EEB-4314-ACE4-55159DA95505@yahoo.com> References: <1312217311.567717.1539818990968.ref@mail.yahoo.com> <1312217311.567717.1539818990968@mail.yahoo.com> <0FA95F91-1EEB-4314-ACE4-55159DA95505@yahoo.com> Message-ID: Alain-Serge Nagni writes: > Problem fixed. It was an #include of a file that was causing the > problem. I put the include in a #ifdef #endif statement and the > problem is gone. The fact that the ODB compiler crashes is not right and I would like to fix this. So can you please still send a reproducer and a stack trace? From ramindeh at gmail.com Thu Oct 18 07:53:30 2018 From: ramindeh at gmail.com (ramin d) Date: Fri Oct 19 10:33:22 2018 Subject: [odb-users] How do I best code/define FKs (C++) for Read/Write? Message-ID: Hello, my newbie question is: how are Foreign Keys best defined in code (C++) for reading and writing/inserts? Identifying = PK/ID is used as FK non-identifying = Candidate keys are used as FK Should identifying FKs be coded different from non-identifying FKs? The available documentation of ODB is confusing to me. Thank? You, R. From zxbzswxr at gmail.com Fri Oct 19 00:03:10 2018 From: zxbzswxr at gmail.com (Music samal) Date: Fri Oct 19 10:35:09 2018 Subject: [odb-users] Is there some advice on recursive call back mechnism? Message-ID: I just want to construct some persist class as hierarchy structure... it's somewhat like this ,A is the supreme class above which there are some B s , B has some C s .....and it's linked with pointer // it looks like that class A { public: A(string name_):name(name){} A(){} #pragma db id auto long long id string name ; #pragma db inverse(pA) vector > string } class B { public: B(string name):{} B(){} #pragma db id auto long long id string name; #pragma db on_delete(cascade) lazy_shared_ptr pA string qualifiedname; } as you see these classed have an number id the two string members, name and qualifiedname, suppose there is a B has name B1, its supper class A has name A1; so the qualifiedname is A1.B1, it are linked names according to persist classes hierarchy... an A object A1 can have many children Bs, eg, B1,B2,B3 .... Also these Bs has qualified names which are A1.B1 , A1.B2, A1.B3... persisting a B is easy, just get the upperclass A's qualifiedname .and combine with B's name if someday I want to update A1 . and modify its name as "A2" and update this object A what can I do to update children B's qualifiedname using odb-provided callback mechism ? and if B also have many C s , C also has name and qualified name? how to deal with it? it's something like trigger, modify a table trigger modifications to other tables .I use postgres database . can you help me???? From asnagni at yahoo.com Fri Oct 19 17:12:18 2018 From: asnagni at yahoo.com (Alain-Serge Nagni) Date: Fri Oct 19 17:21:30 2018 Subject: [odb-users] Internal Compiler error In-Reply-To: References: <1312217311.567717.1539818990968.ref@mail.yahoo.com> <1312217311.567717.1539818990968@mail.yahoo.com> <0FA95F91-1EEB-4314-ACE4-55159DA95505@yahoo.com> Message-ID: <34BEFC1F-03AE-40F6-BBCB-7A09BAEE9F2D@yahoo.com> Hi Boris, Sure we can do that to help improve the compiler. I will send you that ASAP, that is not a problem. Alain-Serge > On Oct 19, 2018, at 10:17 AM, Boris Kolpackov wrote: > > Alain-Serge Nagni writes: > >> Problem fixed. It was an #include of a file that was causing the >> problem. I put the include in a #ifdef #endif statement and the >> problem is gone. > > The fact that the ODB compiler crashes is not right and I would > like to fix this. So can you please still send a reproducer and > a stack trace? From sean.clarke at sec-consulting.co.uk Sun Oct 21 12:49:59 2018 From: sean.clarke at sec-consulting.co.uk (Sean Clarke) Date: Sun Oct 21 12:59:27 2018 Subject: [odb-users] compiler seg fault with g++8 on Debian Buster/Testing Message-ID: Hi, I've started testing against the Debian testing release and believe ODB is broken against g++8. When I instigate teh odb compiler to generate the odb.cxx files I get: *** 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 during GIMPLE pass: *warn_unused_result In file included from /usr/include/odb/container-traits.hxx:217, from :9: /usr/include/odb/std-unordered-set-traits.hxx: In function ?void __static_initialization_and_destruction_0(int, int)?: /usr/include/odb/std-unordered-set-traits.hxx:122:1: internal compiler error: Segmentation fault } ^ Please submit a full bug report, with preprocessed source if appropriate. See for instructions. Even when I install g++6 I still can't get ODB usable on the platform. Regards Sean Clarke From boris at codesynthesis.com Mon Oct 22 06:48:02 2018 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Oct 22 06:57:13 2018 Subject: [odb-users] compiler seg fault with g++8 on Debian Buster/Testing In-Reply-To: References: Message-ID: Sean Clarke writes: > I've started testing against the Debian testing release and believe ODB > is broken against g++8. I wonder if it's this bug: https://www.codesynthesis.com/pipermail/odb-users/2018-October/004113.html Which version of ODB are you using and how are you getting/building it? > Even when I install g++6 I still can't get ODB usable on the platform. Can you be more specific on what exactly is "usable"? From sean.clarke at sec-consulting.co.uk Mon Oct 22 07:16:36 2018 From: sean.clarke at sec-consulting.co.uk (Sean Clarke) Date: Mon Oct 22 07:26:01 2018 Subject: [odb-users] compiler seg fault with g++8 on Debian Buster/Testing In-Reply-To: References: Message-ID: Hi Boris, The ODB version I am using is that from the Buster repos i.e. 2.4.0. Sorry, by usuable I meant produce any generated files without set faulting - ihave installed g++6 and set that as default and even moved the plugin to the g++6 plugin directory. Is there a prebuilt or packaged version I can test? Happy to confirm/confirm resolved issue with any later binaries. Regards Sean On Mon, 22 Oct 2018, 11:48 Boris Kolpackov, wrote: > Sean Clarke writes: > > > I've started testing against the Debian testing release and believe > ODB > > is broken against g++8. > > I wonder if it's this bug: > > https://www.codesynthesis.com/pipermail/odb-users/2018-October/004113.html > > Which version of ODB are you using and how are you getting/building it? > > > > Even when I install g++6 I still can't get ODB usable on the platform. > > Can you be more specific on what exactly is "usable"? > From boris at codesynthesis.com Mon Oct 22 07:24:18 2018 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Oct 22 07:33:28 2018 Subject: [odb-users] compiler seg fault with g++8 on Debian Buster/Testing In-Reply-To: References: Message-ID: Sean Clarke writes: > The ODB version I am using is that from the Buster repos i.e. 2.4.0. Yeah, that's not good. But then buster is not yet stable... ;-). > Is there a prebuilt or packaged version I can test? Can you try the latest pre-release by following these instructions: https://codesynthesis.com/products/odb/doc/install-build2.xhtml I should work with both GCC 6 and 8. From boris at codesynthesis.com Mon Oct 22 07:28:07 2018 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Oct 22 07:37:16 2018 Subject: [odb-users] How do I best code/define FKs (C++) for Read/Write? In-Reply-To: References: Message-ID: ramin d writes: > my newbie question is: how are Foreign Keys best defined in code (C++) > for reading and writing/inserts? In ODB foreign keys are modeled with object pointers. See Chapter 6, "Relationships" in the ODB manual. > Identifying = PK/ID is used as FK > non-identifying = Candidate keys are used as FK > > Should identifying FKs be coded different from non-identifying FKs? I don't understand what you mean by identifying/non-identifying foreign keys. > The available documentation of ODB is confusing to me. Unfortunately, that's the best we've got. From boris at codesynthesis.com Mon Oct 22 07:34:27 2018 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Oct 22 07:43:37 2018 Subject: [odb-users] Is there some advice on recursive call back mechnism? In-Reply-To: References: Message-ID: Music samal writes: > what can I do to update children B's qualifiedname using odb-provided > callback mechism ? ODB does not provide any mechanisms for this. Maybe have the "qualifier" part as a separate foreign key member/column and then use your database's ON UPDATE CASCADE support? From 726531791 at qq.com Tue Oct 23 01:18:11 2018 From: 726531791 at qq.com (=?gb18030?B?x7/R1bXEu7bQpg==?=) Date: Tue Oct 23 04:47:40 2018 Subject: [odb-users] How do I compile odb into the so library that android can use Message-ID: How do I compile odb into the so library that android can use From finjulhich at gmail.com Tue Oct 23 09:43:25 2018 From: finjulhich at gmail.com (MM) Date: Tue Oct 23 09:52:58 2018 Subject: [odb-users] sqlite ON UPDATE CASCADE Message-ID: Hello, The sql generated by odb say for a member that is std::vector includes a foreign constraint "ON DELETE CASCADE" so that is the containing object is deleted from the master table, the relevant rows are deleted from the slave table. Is there a pragma to generate "ON UPDATE CASCADE" as well? Thank you From boris at codesynthesis.com Wed Oct 24 08:42:36 2018 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Oct 24 08:51:54 2018 Subject: [odb-users] sqlite ON UPDATE CASCADE In-Reply-To: References: Message-ID: MM writes: > The sql generated by odb say for a member that is std::vector includes a > foreign constraint "ON DELETE CASCADE" so that is the containing object is > deleted from the master table, the relevant rows are deleted from the slave > table. > > Is there a pragma to generate "ON UPDATE CASCADE" as well? No. This is normally unnecessary since the foreign key points to the primary key (object id) which cannot be modified. From boris at codesynthesis.com Wed Oct 24 09:13:56 2018 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Oct 24 09:23:14 2018 Subject: [odb-users] How do I compile odb into the so library that android can use In-Reply-To: References: Message-ID: ????? <726531791@qq.com> writes: > How do I compile odb into the so library that android can use There are some instructions on the wiki (though they could be a bit outdated): http://wiki.codesynthesis.com/Using_ODB_on_Android If you try them and find issues/fixes, we would appreciate it you report them back. From kexuetutu at sina.com Tue Oct 30 07:24:25 2018 From: kexuetutu at sina.com (Jerry) Date: Tue Oct 30 07:34:19 2018 Subject: [odb-users] how can ODB support CString in MFC Message-ID: <20181030112425.66C3818C008A@webmail.sinamail.sina.com.cn> I'm trying use ODB in my program to save a class that contains CString type (a MFC variable type). When I compile the include file with ODB, it tell me the 'CString' does not name a type. There is 2 ways I think can solve it. I tried but failed.1?Let ODB support the CString typeI write a CString-traits.hxx reference the qt example and this web (https://www.codesynthesis.com/~boris/blog/2012/07/18/custom-database-to-cxx-type-mapping-in-odb/)?when I compile with ODB, the compiler want the CString support include file. I give the include file path, but the compiler want more include file that from the CString include file, and it appears more unsupport type. I think there must be sth wrong because it's so inconvenient. 2?Let ODB compiler ignore the 'CString' wordI add the '#pragma db transient' before the CString, like below:......public:#pragma db transient CStringA name; double R = -1; double S = -1; bool isPositive;......but the odb compiler also tell me the CString not name a type. After all, my question is: 1?How can ODB support CString? 2?How can ODB compiler ignore particular sentence, such as sentence contains 'CString'? PS?There are 2 files[1.h] is the class i want to use ODB to save data[CString-traits.zip] is files i want to traits CString typeI use VS2013 windowns Thinks -------------- next part -------------- A non-text attachment was scrubbed... Name: =?GBK?B?Q1N0cmluZy10cmFpdHMuemlw?= Type: application/zip Size: 4693 bytes Desc: not available Url : https://codesynthesis.com/pipermail/odb-users/attachments/20181030/e33c7d65/GBKBQ1N0cmluZy10cmFpdHMuemlw.zip -------------- next part -------------- A non-text attachment was scrubbed... Name: =?GBK?B?MS5o?= Type: application/octet-stream Size: 590 bytes Desc: not available Url : https://codesynthesis.com/pipermail/odb-users/attachments/20181030/e33c7d65/GBKBMS5o.obj From John.Wu at arris.com Tue Oct 30 17:47:21 2018 From: John.Wu at arris.com (Wu, John) Date: Wed Oct 31 07:07:40 2018 Subject: [odb-users] ODB 2.5 Message-ID: <136B4847FE417244B0FF0E8A72431E24035E75A384@SDCEXMBX1.ARRS.ARRISI.com> Hi, Boris As of today, on codesynthesis.com the latest version is 2.4.0. When do you officially release odb 2.5.0? We switched to a new compiler for C++11 and there are a lot of compiling warnings regarding to deprecated auto_ptr. Thanks John > and ETA? ...... So, my rough estimate is another 4-5 months. Boris From 726531791 at qq.com Wed Oct 31 05:14:08 2018 From: 726531791 at qq.com (=?gb18030?B?x7/R1bXEu7bQpg==?=) Date: Wed Oct 31 07:07:40 2018 Subject: =?gb18030?B?u9i4tKO6IFtvZGItdXNlcnNdIEhvdyBkbyBJIGNv?= =?gb18030?B?bXBpbGUgb2RiIGludG8gdGhlIHNvIGxpYnJhcnkg?= =?gb18030?B?dGhhdGFuZHJvaWQgY2FuIHVzZQ==?= In-Reply-To: References: Message-ID: Should I put the host at the back of the parameter should be changed to what, compiled .a is "armeabi - v7a" type, I now use the parameters as follows "bash. / configure CXXFLAGS =" - Os - "disable - Shared - host = arm - Linux - androideabi -- prefix = / home/source/work/the eim/android/android - odb", Or what are the enumeration values for each rack package ------------------ ???? ------------------ ???: "Boris Kolpackov"; ????: 2018?10?24?(???) ??9:13 ???: "?????"<726531791@qq.com>; ??: "odb-users"; ??: Re: [odb-users] How do I compile odb into the so library thatandroid can use ????? <726531791@qq.com> writes: > How do I compile odb into the so library that android can use There are some instructions on the wiki (though they could be a bit outdated): http://wiki.codesynthesis.com/Using_ODB_on_Android If you try them and find issues/fixes, we would appreciate it you report them back. From boris at codesynthesis.com Wed Oct 31 08:22:24 2018 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Oct 31 08:32:04 2018 Subject: [odb-users] ODB 2.5 In-Reply-To: <136B4847FE417244B0FF0E8A72431E24035E75A384@SDCEXMBX1.ARRS.ARRISI.com> References: <136B4847FE417244B0FF0E8A72431E24035E75A384@SDCEXMBX1.ARRS.ARRISI.com> Message-ID: Wu, John writes: > As of today, on codesynthesis.com the latest version is 2.4.0. > When do you officially release odb 2.5.0? > We switched to a new compiler for C++11 and there are a lot of > compiling warnings regarding to deprecated auto_ptr. We are moving towards more continuous delivery and the latest pre- release for 2.5.0 is available for all platforms. Here are the installation instructions: https://codesynthesis.com/products/odb/doc/install-build2.xhtml I suggest that you upgrade to it instead of waiting for the "official" release (it is stable and fully supported; we use it ourselves in our own projects as well as a growing number of users). From boris at codesynthesis.com Wed Oct 31 08:29:42 2018 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Oct 31 08:39:21 2018 Subject: [odb-users] how can ODB support CString in MFC In-Reply-To: <20181030112425.66C3818C008A@webmail.sinamail.sina.com.cn> References: <20181030112425.66C3818C008A@webmail.sinamail.sina.com.cn> Message-ID: Jerry writes: > How can ODB support CString? The ODB compiler is based on GCC (MinGW version on Windows). To be able to persist CString you will need to somehow make GCC MinGW be able to include and compile MFC headers. Whether this is doable (and, if so, how) I have no idea. Overall, my suggestion would be to not use CString/MFC in the object model that you wish to persist with ODB. > How can ODB compiler ignore particular sentence, such as sentence > contains 'CString'? There is the ODB_COMPILER macro for that: class object { #ifndef ODB_COMPILER CString data; #endif };