Class::DBI::Sybase segfaulting

Ivor Williams <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.dbi.sybase
Message-ID <[email protected]>
Cross posted from Class::DBI list:

Here is a fairly trivial DB and script. What am I doing wrong?

OS is Solaris 5.8 and Sybase version 12.5.1

Class::DBI version 0.96
DBI version 1.47
DBD::Sybase version 0.95
Class::DBI::Sybase version 0.31
Perl 5.6.1


================================
create table TEST 
(
  nurgle  integer,
  foobar  varchar(20)
)

insert into TEST (nurgle,foobar)
values (1, 'Dingbat')


================================
#!/usr/local/bin/perl

use warnings;

package Test::DBI;
use strict;
use base 'Class::DBI::Sybase';

__PACKAGE__->connection('dbi:Sybase:server=SERVER_TST;database=TESTING2','tst2','tst2');

__PACKAGE__->set_up_table('TEST');

package main;
use strict;

my $foo = Test::DBI->search( nurgle => 1);

for (qw/nurgle foobar/) {
        print $foo->$_,"\n";
}
==============================

From: Perrin Harkins <[email protected]> 
To: [email protected] 
Cc: "[email protected]" <[email protected]> 
Subject: Re: Class::DBI segfaulting 
Date: Mon, 28 Feb 2005 10:40:37 -0500 
References: <[email protected]> 

> On Mon, 2005-02-28 at 14:47 +0000, [email protected] wrote:
>> It's blowing up somewhere under set_up_table.
>> There also doesn't seem to be anything special that Class:DBI::Sybase is 
>> doing.
>
> Well, Class::DBI is pure perl, so either Perl is segfaulting, or
> Class::DBI::Sybase (or some other XS module used in there) is doing it.
> I'd suggest tracing it to the offending line in the debugger as a
> starting point.

I've traced it to Class::DBI::Sybase line 86, where it is trying to
retrieve the results from the procedure sp_help $table. It's actually
segfaulting in Carp::Heavy, probably on account of some dodgy SV that
DBD::Sybase has returned.

Any idea how I would go about tracking this down further?


  DB<1> b 86
  DB<2> c
Class::DBI::Sybase::set_up_table(/home/williami/lib/Class/DBI/Sybase.pm:86):
86:             $col = $sth->fetchall_arrayref(); 
  DB<2> T
. = Class::DBI::Sybase::set_up_table('Test::DBI', 'TEST') called from file `cdbi_test.pl' line 11
  DB<2> s
DBI::st::fetchall_arrayref(/usr/local/lib/perl5/5.6.1/Carp.pm:97):
97:         { local $@; require Carp::Heavy; }  # XXX fix require to not clear $@?
  DB<2> 
DBI::st::fetchall_arrayref(/usr/local/lib/perl5/5.6.1/Carp.pm:97):
97:         { local $@; require Carp::Heavy; }  # XXX fix require to not clear $@?
  DB<2> 
DBI::st::fetchall_arrayref(/usr/local/lib/perl5/5.6.1/Carp.pm:97):
97:         { local $@; require Carp::Heavy; }  # XXX fix require to not clear $@?
  DB<2> 
DBI::st::fetchall_arrayref(/usr/local/lib/perl5/5.6.1/Carp/Heavy.pm:247):
247:    1;
  DB<2> 
DBI::st::fetchall_arrayref(/usr/local/lib/perl5/5.6.1/Carp.pm:98):
98:         goto &longmess_heavy;
  DB<2> 
Carp::longmess_heavy(/usr/local/lib/perl5/5.6.1/Carp/Heavy.pm:30):
30:         return @_ if ref $_[0];
  DB<2> 
Carp::longmess_heavy(/usr/local/lib/perl5/5.6.1/Carp/Heavy.pm:31):
31:         my $error = join '', @_;
  DB<2> 
Carp::longmess_heavy(/usr/local/lib/perl5/5.6.1/Carp/Heavy.pm:32):
32:         my $mess = "";
  DB<2> 
Carp::longmess_heavy(/usr/local/lib/perl5/5.6.1/Carp/Heavy.pm:33):
33:         my $i = 1 + $CarpLevel;
  DB<2> 
Carp::longmess_heavy(/usr/local/lib/perl5/5.6.1/Carp/Heavy.pm:34):
34:         my ($pack,$file,$line,$sub,$hargs,$eval,$require);
  DB<2> 
Carp::longmess_heavy(/usr/local/lib/perl5/5.6.1/Carp/Heavy.pm:35):
35:         my (@a);
  DB<2> 
Carp::longmess_heavy(/usr/local/lib/perl5/5.6.1/Carp/Heavy.pm:39):
39:         while (do { { package DB; @a = caller($i++) } } ) {
  DB<2> 
Carp::longmess_heavy(/usr/local/lib/perl5/5.6.1/Carp/Heavy.pm:39):
39:         while (do { { package DB; @a = caller($i++) } } ) {
  DB<2> 
Carp::longmess_heavy(/usr/local/lib/perl5/5.6.1/Carp/Heavy.pm:124):
124:        $mess || $error;
  DB<2> 
Signal SEGV: 
Abort(coredump)
==============================

Any thoughts?
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.