New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot locate native library 'libsqlite3.so' #17

Closed
szabgab opened this Issue Sep 2, 2015 · 11 comments

Comments

Projects
None yet
6 participants
@szabgab
Member

szabgab commented Sep 2, 2015

While trying to connect to SQLite I got this error:

# Connect failed with error Cannot locate native library 'libsqlite3.so': libsqlite3.so: cannot open shared object file: No such file or directory

but

$ locate libsqlite3.so
/usr/lib/i386-linux-gnu/libsqlite3.so.0
/usr/lib/i386-linux-gnu/libsqlite3.so.0.8.6

How can I convince DBlish to find it?

@szabgab

This comment has been minimized.

Show comment
Hide comment
@szabgab

szabgab Sep 2, 2015

Member

Apparently after sudo apt-get install libsqlite3-dev the 'connect' worked, but I get 'Segmentation fault'

Member

szabgab commented Sep 2, 2015

Apparently after sudo apt-get install libsqlite3-dev the 'connect' worked, but I get 'Segmentation fault'

@jonathanstowe

This comment has been minimized.

Show comment
Hide comment
@jonathanstowe

jonathanstowe Sep 2, 2015

Contributor

usually installing the "-dev" package will create a symlink for the plain .so file.

Contributor

jonathanstowe commented Sep 2, 2015

usually installing the "-dev" package will create a symlink for the plain .so file.

@FROGGS

This comment has been minimized.

Show comment
Hide comment
@FROGGS

FROGGS Sep 2, 2015

Member

@szabgab Can you please run the segfaulting script using perl6-gdb-m? I'd like to see the output.

Member

FROGGS commented Sep 2, 2015

@szabgab Can you please run the segfaulting script using perl6-gdb-m? I'd like to see the output.

@szabgab

This comment has been minimized.

Show comment
Hide comment
@szabgab

szabgab Sep 2, 2015

Member
$ perl6-gdb-m db_create.pl 
================================================================================================
This is Rakudo Perl 6 running in the GNU debugger, which often allows the user to generate useful back-
traces to debug or report issues in Rakudo, the MoarVM backend or the currently running code.

This Rakudo version is 2015.7.2 built on MoarVM version 2015.7,
running on linux (3.2.0.23.generic.pae) / linux (3.2.0.23.generic.pae)

Type `bt full` to generate a backtrace if applicable, type `q` to quite or `help` for help.
------------------------------------------------------------------------------------------------
Reading symbols from /home/vagrant/rakudo/bin/moar...(no debugging symbols found)...done.
Starting program: /home/vagrant/rakudo/bin/moar --execname=/home/vagrant/rakudo/bin/perl6-gdb-m --libpath=/home/vagrant/rakudo/share/nqp/lib --libpath=/home/vagrant/rakudo/share/perl6/lib --libpath=/home/vagrant/rakudo/share/perl6/runtime /home/vagrant/rakudo/share/perl6/runtime/perl6.moarvm db_create.pl
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0xb5ea6ed8 in ?? () from /usr/lib/i386-linux-gnu/libsqlite3.so
(gdb) bt full
#0  0xb5ea6ed8 in ?? () from /usr/lib/i386-linux-gnu/libsqlite3.so
No symbol table info available.
#1  0xb7dfb28d in dcCall_x86_cdecl () from /home/vagrant/rakudo/lib/libmoar.so
No symbol table info available.
#2  0xb7dfac88 in dc_callvm_call_x86_cdecl () from /home/vagrant/rakudo/lib/libmoar.so
No symbol table info available.
#3  0xb7dfa914 in dcCallLongLong () from /home/vagrant/rakudo/lib/libmoar.so
No symbol table info available.
#4  0xb7d62c76 in MVM_nativecall_invoke () from /home/vagrant/rakudo/lib/libmoar.so
No symbol table info available.
#5  0xb7d3832b in MVM_interp_run () from /home/vagrant/rakudo/lib/libmoar.so
No symbol table info available.
#6  0xb7df7c47 in MVM_vm_run_file () from /home/vagrant/rakudo/lib/libmoar.so
No symbol table info available.
#7  0x08048cbd in main ()
No symbol table info available.

I never used gdb. Is this it, or something else?
Source code:

use v6;

use DBIish;

my $dbh = DBIish.connect("SQLite", :database<example.db>, :RaiseError);

my $sql = q:to/STATEMENT/;
        CREATE TABLE users (
            name        varchar(4),
            email       varchar(30),
        );
        STATEMENT
 $dbh.do($sql);
Member

szabgab commented Sep 2, 2015

$ perl6-gdb-m db_create.pl 
================================================================================================
This is Rakudo Perl 6 running in the GNU debugger, which often allows the user to generate useful back-
traces to debug or report issues in Rakudo, the MoarVM backend or the currently running code.

This Rakudo version is 2015.7.2 built on MoarVM version 2015.7,
running on linux (3.2.0.23.generic.pae) / linux (3.2.0.23.generic.pae)

Type `bt full` to generate a backtrace if applicable, type `q` to quite or `help` for help.
------------------------------------------------------------------------------------------------
Reading symbols from /home/vagrant/rakudo/bin/moar...(no debugging symbols found)...done.
Starting program: /home/vagrant/rakudo/bin/moar --execname=/home/vagrant/rakudo/bin/perl6-gdb-m --libpath=/home/vagrant/rakudo/share/nqp/lib --libpath=/home/vagrant/rakudo/share/perl6/lib --libpath=/home/vagrant/rakudo/share/perl6/runtime /home/vagrant/rakudo/share/perl6/runtime/perl6.moarvm db_create.pl
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0xb5ea6ed8 in ?? () from /usr/lib/i386-linux-gnu/libsqlite3.so
(gdb) bt full
#0  0xb5ea6ed8 in ?? () from /usr/lib/i386-linux-gnu/libsqlite3.so
No symbol table info available.
#1  0xb7dfb28d in dcCall_x86_cdecl () from /home/vagrant/rakudo/lib/libmoar.so
No symbol table info available.
#2  0xb7dfac88 in dc_callvm_call_x86_cdecl () from /home/vagrant/rakudo/lib/libmoar.so
No symbol table info available.
#3  0xb7dfa914 in dcCallLongLong () from /home/vagrant/rakudo/lib/libmoar.so
No symbol table info available.
#4  0xb7d62c76 in MVM_nativecall_invoke () from /home/vagrant/rakudo/lib/libmoar.so
No symbol table info available.
#5  0xb7d3832b in MVM_interp_run () from /home/vagrant/rakudo/lib/libmoar.so
No symbol table info available.
#6  0xb7df7c47 in MVM_vm_run_file () from /home/vagrant/rakudo/lib/libmoar.so
No symbol table info available.
#7  0x08048cbd in main ()
No symbol table info available.

I never used gdb. Is this it, or something else?
Source code:

use v6;

use DBIish;

my $dbh = DBIish.connect("SQLite", :database<example.db>, :RaiseError);

my $sql = q:to/STATEMENT/;
        CREATE TABLE users (
            name        varchar(4),
            email       varchar(30),
        );
        STATEMENT
 $dbh.do($sql);
@jonathanstowe

This comment has been minimized.

Show comment
Hide comment
@jonathanstowe

jonathanstowe Sep 2, 2015

Contributor

Any chance you can get the libsqlite with debug symbols, so we can see
what function is actually being called :)

On Wed, 2015-09-02 at 10:42 -0700, Gabor Szabo wrote:

$ perl6-gdb-m db_create.pl

This is Rakudo Perl 6 running in the GNU debugger, which often allows the user to generate useful back-
traces to debug or report issues in Rakudo, the MoarVM backend or the currently running code.

This Rakudo version is 2015.7.2 built on MoarVM version 2015.7,
running on linux (3.2.0.23.generic.pae) / linux (3.2.0.23.generic.pae)

Type bt full to generate a backtrace if applicable, type q to quite or help for help.

Reading symbols from /home/vagrant/rakudo/bin/moar...(no debugging symbols found)...done.
Starting program: /home/vagrant/rakudo/bin/moar --execname=/home/vagrant/rakudo/bin/perl6-gdb-m --libpath=/home/vagrant/rakudo/share/nqp/lib --libpath=/home/vagrant/rakudo/share/perl6/lib --libpath=/home/vagrant/rakudo/share/perl6/runtime /home/vagrant/rakudo/share/perl6/runtime/perl6.moarvm db_create.pl
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0xb5ea6ed8 in ?? () from /usr/lib/i386-linux-gnu/libsqlite3.so
(gdb) bt full
#0 0xb5ea6ed8 in ?? () from /usr/lib/i386-linux-gnu/libsqlite3.so
No symbol table info available.
#1 0xb7dfb28d in dcCall_x86_cdecl () from /home/vagrant/rakudo/lib/libmoar.so
No symbol table info available.
#2 0xb7dfac88 in dc_callvm_call_x86_cdecl () from /home/vagrant/rakudo/lib/libmoar.so
No symbol table info available.
#3 0xb7dfa914 in dcCallLongLong () from /home/vagrant/rakudo/lib/libmoar.so
No symbol table info available.
#4 0xb7d62c76 in MVM_nativecall_invoke () from /home/vagrant/rakudo/lib/libmoar.so
No symbol table info available.
#5 0xb7d3832b in MVM_interp_run () from /home/vagrant/rakudo/lib/libmoar.so
No symbol table info available.
#6 0xb7df7c47 in MVM_vm_run_file () from /home/vagrant/rakudo/lib/libmoar.so
No symbol table info available.
#7 0x08048cbd in main ()
No symbol table info available.

I never used gdb. Is this it, or something else?
Source code:

use v6;

use DBIish;

my $dbh = DBIish.connect("SQLite", :database<example.db>, :RaiseError);

my $sql = q:to/STATEMENT/;
CREATE TABLE users (
name varchar(4),
email varchar(30),
);
STATEMENT
$dbh.do($sql);


Reply to this email directly or view it on GitHub.

Contributor

jonathanstowe commented Sep 2, 2015

Any chance you can get the libsqlite with debug symbols, so we can see
what function is actually being called :)

On Wed, 2015-09-02 at 10:42 -0700, Gabor Szabo wrote:

$ perl6-gdb-m db_create.pl

This is Rakudo Perl 6 running in the GNU debugger, which often allows the user to generate useful back-
traces to debug or report issues in Rakudo, the MoarVM backend or the currently running code.

This Rakudo version is 2015.7.2 built on MoarVM version 2015.7,
running on linux (3.2.0.23.generic.pae) / linux (3.2.0.23.generic.pae)

Type bt full to generate a backtrace if applicable, type q to quite or help for help.

Reading symbols from /home/vagrant/rakudo/bin/moar...(no debugging symbols found)...done.
Starting program: /home/vagrant/rakudo/bin/moar --execname=/home/vagrant/rakudo/bin/perl6-gdb-m --libpath=/home/vagrant/rakudo/share/nqp/lib --libpath=/home/vagrant/rakudo/share/perl6/lib --libpath=/home/vagrant/rakudo/share/perl6/runtime /home/vagrant/rakudo/share/perl6/runtime/perl6.moarvm db_create.pl
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0xb5ea6ed8 in ?? () from /usr/lib/i386-linux-gnu/libsqlite3.so
(gdb) bt full
#0 0xb5ea6ed8 in ?? () from /usr/lib/i386-linux-gnu/libsqlite3.so
No symbol table info available.
#1 0xb7dfb28d in dcCall_x86_cdecl () from /home/vagrant/rakudo/lib/libmoar.so
No symbol table info available.
#2 0xb7dfac88 in dc_callvm_call_x86_cdecl () from /home/vagrant/rakudo/lib/libmoar.so
No symbol table info available.
#3 0xb7dfa914 in dcCallLongLong () from /home/vagrant/rakudo/lib/libmoar.so
No symbol table info available.
#4 0xb7d62c76 in MVM_nativecall_invoke () from /home/vagrant/rakudo/lib/libmoar.so
No symbol table info available.
#5 0xb7d3832b in MVM_interp_run () from /home/vagrant/rakudo/lib/libmoar.so
No symbol table info available.
#6 0xb7df7c47 in MVM_vm_run_file () from /home/vagrant/rakudo/lib/libmoar.so
No symbol table info available.
#7 0x08048cbd in main ()
No symbol table info available.

I never used gdb. Is this it, or something else?
Source code:

use v6;

use DBIish;

my $dbh = DBIish.connect("SQLite", :database<example.db>, :RaiseError);

my $sql = q:to/STATEMENT/;
CREATE TABLE users (
name varchar(4),
email varchar(30),
);
STATEMENT
$dbh.do($sql);


Reply to this email directly or view it on GitHub.

@Zhtwn

This comment has been minimized.

Show comment
Hide comment
@Zhtwn

Zhtwn Sep 2, 2015

That would be sudo apt-get install libsqlite3-0-dbg, I believe.

Zhtwn commented Sep 2, 2015

That would be sudo apt-get install libsqlite3-0-dbg, I believe.

@szabgab

This comment has been minimized.

Show comment
Hide comment
@szabgab

szabgab Sep 3, 2015

Member

@Zhtwn thanks for the explanation!

As I can see this is the extra output I got.

Program received signal SIGSEGV, Segmentation fault.
sqlite3LockAndPrepare (db=0xa98cf30, zSql=0xa9f3de8 "CREATE TABLE users (\n    name        varchar(4),\n    email       varchar(30)\n);\n", nBytes=-1, 
    saveSqlFlag=1, pOld=0x0, ppStmt=0xffffffff, pzTail=0xa992188) at sqlite3.c:92544
92544   sqlite3.c: No such file or directory.
(gdb) bt full
#0  sqlite3LockAndPrepare (db=0xa98cf30, zSql=0xa9f3de8 "CREATE TABLE users (\n    name        varchar(4),\n    email       varchar(30)\n);\n", nBytes=-1, 
    saveSqlFlag=1, pOld=0x0, ppStmt=0xffffffff, pzTail=0xa992188) at sqlite3.c:92544
        rc = 178208232
Member

szabgab commented Sep 3, 2015

@Zhtwn thanks for the explanation!

As I can see this is the extra output I got.

Program received signal SIGSEGV, Segmentation fault.
sqlite3LockAndPrepare (db=0xa98cf30, zSql=0xa9f3de8 "CREATE TABLE users (\n    name        varchar(4),\n    email       varchar(30)\n);\n", nBytes=-1, 
    saveSqlFlag=1, pOld=0x0, ppStmt=0xffffffff, pzTail=0xa992188) at sqlite3.c:92544
92544   sqlite3.c: No such file or directory.
(gdb) bt full
#0  sqlite3LockAndPrepare (db=0xa98cf30, zSql=0xa9f3de8 "CREATE TABLE users (\n    name        varchar(4),\n    email       varchar(30)\n);\n", nBytes=-1, 
    saveSqlFlag=1, pOld=0x0, ppStmt=0xffffffff, pzTail=0xa992188) at sqlite3.c:92544
        rc = 178208232
@azawawi

This comment has been minimized.

Show comment
Hide comment
@azawawi

azawawi Nov 11, 2015

Contributor

@szabgab, Is this still an issue?

Contributor

azawawi commented Nov 11, 2015

@szabgab, Is this still an issue?

@azawawi azawawi added the bug label Nov 11, 2015

@azawawi

This comment has been minimized.

Show comment
Hide comment
@azawawi

azawawi Nov 18, 2015

Contributor

I am closing this issue since it has stalled.

Please see the following example for using the new DBIish environment variables.

Contributor

azawawi commented Nov 18, 2015

I am closing this issue since it has stalled.

Please see the following example for using the new DBIish environment variables.

@azawawi azawawi closed this Nov 18, 2015

@Skarsnik

This comment has been minimized.

Show comment
Hide comment
@Skarsnik

Skarsnik Nov 18, 2015

Contributor

Actually it's related to this: https://rt.perl.org/Ticket/Display.html?id=126645 for the first part.

Contributor

Skarsnik commented Nov 18, 2015

Actually it's related to this: https://rt.perl.org/Ticket/Display.html?id=126645 for the first part.

@azawawi

This comment has been minimized.

Show comment
Hide comment
@azawawi

azawawi Nov 22, 2015

Contributor

Thanks for your feedback.

Contributor

azawawi commented Nov 22, 2015

Thanks for your feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment