Re: Received fatal signal 11 using a prosqlite predicate

"Bob Ly" <[email protected]>
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <[email protected]>
Thank you for your response, Nicos.

I was able to duplicate the example sqlite database.

?- [library(prosqlite)].
%  library(debug) compiled into prolog_debug 0.00 sec, 54 clauses
% library(prosqlite) compiled into prosqlite 0.04 sec, 1,613 clauses
true.

?- sqlite_connect('uniprot.sqlite',uniport).
Using database at: uniprot.sqlite
true.

?- sqlite_query('SELECT primary_accession, secondary_accession FROM  
secondary_accessions',Row).
Row = row('P64943', 'A0A111') ;
Row = row('P64941', 'A0A112') ;
Row = row('Q10704', 'A0A113') ;
Row = row('O90631', 'A0A131') ;
Row = row('Q6NUJ1', 'A0A184') ;
Row = row('A0A189', 'A0A1A0') ;
Row = row('A0A194', 'A0A1A5') ;
Row = row('A0A1C3', 'A0A1D3') .

So the problem appears to be the database itself.

I thought the problem might be the permission of the database but they  
are the same.
$ ls downloads/uniprot.sqlite -l && ls  
.mozilla/firefox/ooftaizq.default/places.sqlite -l
-rw-r--r-- 1 robert robert 192375808 Jun 12 10:42 downloads/uniprot.sqlite
-rw-r--r-- 1 robert robert 20971520 Sep 28 07:33  
.mozilla/firefox/ooftaizq.default/places.sqlite

I also thought the error might be the fact that the datable was hidden  
(ie .uniprot.sqlite) but I was able to duplicate the previous code  
successfully.

The system I am running is the following:
Linux 360data 3.2.0-4-amd64 #1 SMP Debian 3.2.46-1 x86_64 GNU/Linux.

The database is just the web browser's (in this case, iceweasel)  
history. Maybe I should try a different web browser that uses jason  
strings as oppose to sqlite files to store history information? I'll  
continue search for a solution.

Does swipl have an error log some or is that a flag setting to enable  
such a feature?

Best Regards,


Bob Ly




Quoting "Nicos Angelopoulos" <[email protected]>:

>
>
> Dear Bob,
>
> On Thu, 26 Sep 2013 08:47:43 -0500
> "Bob Ly" <[email protected]> wrote:
>
>> I tried calling this predicate from prosqlite on the moz_places table
>> from places.sqlite file.
>> ?- sqlite_query('SELECT id, title, visit_count FROM moz_places',Row).
>>
>> I got the following value.
>> Row = row(2, 'Web Search - CrunchBang', 185) ;
>>
>> Then I got the following error message.
>> SWI-Prolog [thread 1]: received fatal signal 11 (segv)
>> Stack trace labeled "crash":
>>    [0] crashHandler+0x36
>>    [1] dispatch_signal+0x44a
>>    [2] __restore_rt+(nil)
>>    [3] __strerror_r+0x171
>>    [4] PL_put_atom_chars+0x32
>>    [5] unify_row_term+0x124
>>    [6] c_sqlite_query+0x25a
>>    [7] PL_next_solution+0x5818
>>    [8] query_loop+0x11f
>>    [9] prologToplevel+0x4f
>> Aborted
>>
>> Am I not understanding the prosqlite_query predicate or is there a
>> better predicate to obtain selected rows of table?
>>
>
> This is certainly a supported way to access the sqlite table.
> For instance, on a linux computer the following works with the example
> database uniprot.sqlite
>
>
> ?- [library(prosqlite)].
> %  library(debug) compiled into prolog_debug 0.00 sec, 54 clauses
> % library(prosqlite) compiled into prosqlite 0.03 sec, 335 clauses
> true.
>
> ?- sqlite_connect( 'examples/uniprot.sqlite', uniprot ).
> Using database at: examples/uniprot.sqlite
> true.
>
> ?- sqlite_table_column( uniprot, Tbl, Column ), write( Tbl-Column ),  
> nl, fail.
> secondary_accessions-secondary_accession
> secondary_accessions-primary_accession
> identifier_mapping-uniprot_accession
> identifier_mapping-identifier_type
> identifier_mapping-target_identifier
> false.
>
> ?- sqlite_query'Select primary_accession, secondary_accession from  
> secondary_accessions', Row ).
> Row = row('P64943', 'A0A111') ;
> Row = row('P64941', 'A0A112') ;
> Row = row('Q10704', 'A0A113') ;
> Row = row('O90631', 'A0A131') ;
> Row = row('Q6NUJ1', 'A0A184') ;
> Row = row('A0A189', 'A0A1A0') ;
> Row = row('A0A194', 'A0A1A5') ;
> Row = row('A0A1C3', 'A0A1D3') .
>
> Would you be able to share your sqlite database ?
> Are you on Windows  ?
>
> Regards,
>
> Nicos Angelopoulos
>
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.