Re: DBI and unicode seg. fault

From: Tim Bunce (Tim.Bunce_at_pobox.com)
Date: 07/22/04


Date: Thu, 22 Jul 2004 20:21:44 +0100
To: Ondrej Koala Vacha <koala@vju.cz>

On Thu, Jul 22, 2004 at 05:12:57PM +0200, Ondrej Koala Vacha wrote:
>
> Hi,
>
> I have mysql with iso-latin2 support, DBI 1.32 and perl 5.8.0.
> The code below causes segmentation fault of perl when $DBI::errstr
> contains an iso-latin2 character(s). What I have wrong?
>
> ------------------test.pl-----------------
> #!/usr/bin/perl
> use encoding 'latin2';
> use open ":std",
> IN => ":encoding(iso-8859-2)",
> OUT => ":encoding(iso-8859-2)";
>
> require DBI;
> $SQL = DBI->connect("DBI:mysql:test");
>
> # character in the select statement is 'a' with 'caron'
> my $sql = $SQL->prepare(Encode::encode('iso-8859-2',"select á"));
> $sql->execute;
> if ($DBI::errstr) {
> return 0;
> }
> ----------------------------------
>
> $ DBI_TRACE=2 perl test.pl
> <- connect= DBI::db=HASH(0x8303804)
> Segmentation fault

The trace shows that the connect() method has returned but the prepare()
method has not been entered. The segmentation fault is probably from
Encode::encode().

Tim.



Relevant Pages

  • Re: DBI and unicode seg. fault
    ... The segmentation fault is probably from ... A stack trace from the ... Reproducing it without the DBI, if possible, would also help. ... Tim. ...
    (perl.dbi.users)
  • Re: thread & freebsd
    ... Segmentation fault. ... Cannot find thread, Thread ID=2753, generic error ... code or other `trace' information. ...
    (comp.unix.programmer)
  • DBI and unicode seg. fault
    ... The code below causes segmentation fault of perl when $DBI::errstr ... DBI 1.32-ithread dispatch trace level set to 2 ... ~0x8303834 undef undef HASH) ...
    (perl.dbi.users)
  • Re: using thread in C++
    ... Segmentation fault. ... But When I trace the backtrace, gdb tells me ...
    (comp.programming.threads)
  • Segmentation Fault with Oracle
    ... I am getting a Segmentation fault when I execute the following program: ... Following is the DBI trace file's o/p: ...
    (perl.dbi.users)