[odb-users] segmentation error on the hello example(w.r.t auto_ptr<database> db (new odb::mysql::database (argc, argv));)

ys C youngsunhere at gmail.com
Fri Mar 26 06:53:31 EDT 2021


ys C <youngsunhere at gmail.com>
12:10 PM (7 hours ago)
to odb-users
Thank you for your reply, Boris!
I used g++ 7 for example and libodb build.
I did use the 2.5 pre-release install through build as well.

As you mentioned, I tried debugging while running the executable, and got
the following clues. Could this be some broken linkage issue?


libc.so.6!_int_malloc(mstate av, size_t bytes)
libc.so.6!__GI___libc_malloc(size_t,bytes)
libstdc++.so.6!operator new(unsigned long)
libodb-mysql-2.4.so
!odb::mysql::database::database(int&,char**,bool,std::__cxx11...
create_database(int&,char**)
main


Thank you for your time!
Youngsun Cho


On Thu, Mar 25, 2021 at 10:22 PM Boris Kolpackov <boris at codesynthesis.com>
wrote:

> ys C <youngsunhere at gmail.com> writes:
>
> > However when driver  is run as below, I get segmentation error.
> >
> > *./driver --user root --database cpp_test*
> >
> > My debugging only got so far as finding out that it was due to L 62 in
> > *database.hxx*
> >
> >
> > *auto_ptr<database> db (new odb::mysql::database (argc, argv));)*
> >
> > I am running on Ubuntu 18.04, using mysql for db, as mentioned.
> > Could this be installation issue?
>
> Yes, this could be a compiler/ABI mismatch between the compiler that
> you use to build the example and that was used to build the libodb*
> packages (I assume you are using system-installed ones).
>
> If you want to try to eliminate this possibility, I would suggest
> building the 2.5 pre-release from source as described here:
>
> https://codesynthesis.com/products/odb/doc/install-build2.xhtml
>
> Otherwise (or if you have the same issues with 2.5), you will
> need to build the test with debug information (-g) and look
> around in the debugger (e.g., stack trace, etc) for what might
> be causing this.
>


-- 
Best regards,
Youngsun Cho


More information about the odb-users mailing list