Hi,

Below please find a Perl DBI program, the output of the program,
and a stack trace following the SEGV.  It appears to be dying
in the sqlite DSO as the result of an attempt to get the TYPE
of a field in a VIEW.

I have no such problem obtaining the TYPE information in a TABLE;
I only have the problem in a VIEW.

As the program output shows, relevant versions are:

Perl: 5.8.6 (threaded, but this isn't a threaded app)
Sqlite: 3.0.8
DBI: 1.48
DBM:SQLite: 1.07

Hmmm... I see I didn't actually print out the Sqlite version number,
but please take my word for it that the above is what it is.

Any advice?  A quick search of the list archive didn't turn this
symptom up.

Thanks,
-P.

---------- program -------------------
# $Id: dump_sqlite.pl,v 1.4 2005/04/14 21:01:14 shenkin Exp $
# Dump an sqlite DB to stdout
# Usage: "dump_sqlite <sqlite file name>

use strict;
use Carp;
use DBI;

# get db name from cmdline:
my $dbfile = $ARGV[0];

# make sure db is there:
if( not -e $dbfile ) {
  confess "dumpdb: could not find sqlite file $dbfile\n";
}

# connect to db:
my $dbh =   my $dbh = DBI->connect( "dbi:SQLite:dbname=$dbfile", "", "",
   { AutoCommit=>0,RaiseError=>1 } )
   or confess "Could not connect to database $dbfile\n";
print "Connected to database $dbfile\n"
 . " Binary values are shown as 'BLOB' and NULL values as 'NULL'\n";

print "DBI->installed_versions:\n";
DBI->installed_versions;

# NB: "all_properties" is a view:
my $sth = $dbh->prepare(" SELECT * FROM all_properties" );
print "sth->{NUM_OF_FIELDS}= $sth->{NUM_OF_FIELDS}\n";
print "sth->{NAME}->[1]= $sth->{NAME}->[1]\n";
print "sth->{TYPE}->[1]= $sth->{TYPE}->[1]\n";


---------- program output -------------------
Connected to database testform-node1_raw.sqlite
 Binary values are shown as 'BLOB' and NULL values as 'NULL'
DBI->installed_versions:
  Perl            : 5.008006    (i686-linux-thread-multi)
  OS              : linux       (2.4.20-28.7)
  DBI             : 1.47
  DBD::Sponge     : 11.10
  DBD::SQLite     : 1.07
  DBD::Proxy      : install_driver(Proxy) failed: Can't locate RPC/PlClient.pm 
in @INC
  DBD::File       : 0.32
  DBD::ExampleP   : 11.12
  DBD::DBM        : 0.02
sth->{NUM_OF_FIELDS}= 3
sth->{NAME}->[1]= name
Segmentation fault (core dumped)


---------- stack trace -------------------
#0  0x080bdac5 in Perl_newSVpv ()
#1  0x40230996 in sqlite_st_FETCH_attrib () from
/zone1/shenkin/bld/main/Linux-x86-g.ifort/mmshare-v1.5/lib/Linux-x86/perl5/site_perl/5.8.6/i686-linux-thread-multi/auto/DBD/SQLite/SQLite.so
#2  0x40222a91 in XS_DBD__SQLite__st_FETCH_attrib ()
   from
/zone1/shenkin/bld/main/Linux-x86-g.ifort/mmshare-v1.5/lib/Linux-x86/perl5/site_perl/5.8.6/i686-linux-thread-multi/auto/DBD/SQLite/SQLite.so
#3  0x4020103c in XS_DBI_dispatch () from
/zone1/shenkin/bld/main/Linux-x86-g.ifort/mmshare-v1.5/lib/Linux-x86/perl5/site_perl/5.8.6/i686-linux-thread-multi/auto/DBI/DBI.so
#4  0x080b3ee4 in Perl_pp_entersub ()
#5  0x080ad680 in Perl_runops_standard ()
#6  0x08063939 in S_call_body ()
#7  0x080634b6 in Perl_call_sv ()
#8  0x080a49e1 in S_magic_methpack ()
#9  0x080a4add in Perl_magic_getpack ()
#10 0x080a29a0 in Perl_mg_get ()
#11 0x080b45f3 in Perl_vivify_ref ()
#12 0x080b1866 in Perl_pp_helem ()
#13 0x080ad680 in Perl_runops_standard ()
#14 0x08063048 in S_run_body ()
#15 0x08062d59 in perl_run ()
#16 0x0805fc45 in main ()
#17 0x400c11c4 in __libc_start_main () from /lib/libc.so.6


--
  Peter S. Shenkin                      Schrodinger, Inc.
  VP, Software Development              120 W. 45th St., 32nd Floor
  646 366 9555 x111 Tel                 New York, NY 10036
  646 366 9550 FAX                      USERID: shenkin
  http://www.schrodinger.com            DOMAIN: schrodinger DOT com
  Pre-arranged conf. calls: 816-650-0812 or 888-667-9995; passcode 060428#

Reply via email to