Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Email::Store segfault when using DBD::Sybase

by rgcosma (Beadle)
on Nov 10, 2005 at 13:45 UTC ( [id://507375]=perlquestion: print w/replies, xml ) Need Help??

rgcosma has asked for the wisdom of the Perl Monks concerning the following question:

Hello, I have a functional Perl with Email::Store (wonderful module btw) no errors when using MySQL. Trying to do the same basic thing -
undef $/; $mail = <>; $/ = "\n"; Email::Store::Mail->store ( $mail );
but with a MS SQL 2000 database, I get -
ct_send(CS_DESCRIBE_INPUT) returned 0 at /usr/lib/perl5/site_perl/5.8 +.1/i586-linux-thread-multi/DBD/Sybase.pm line 133, <> line 1. Segmentation fault
Unfortunately I have absolutely no idea how to debug a segfault in perl, can any one please guide me to the right tools? Thank you very much.

Replies are listed 'Best First'.
Re: Email::Store segfault when using DBD::Sybase
by demerphq (Chancellor) on Nov 10, 2005 at 14:56 UTC

    Send MS a letter recommending that they pay Michael Peppler to port DBD::Sybase over to DBD::MsSQL. If you are a corporate user then the letter might actually do some good. :-)

    After all they put a whack of cash towards Perl in general a few years back....

    ---
    $world=~s/war/peace/g

      Actually, DBD::Sybase works with MS SQL Server 2000. I'm not sure if there are any issues with sql server 2005 though.

      Jason L. Froebe

      Team Sybase member

      No one has seen what you have seen, and until that happens, we're all going to think that you're nuts. - Jack O'Neil, Stargate SG-1

Re: Email::Store segfault when using DBD::Sybase
by marto (Cardinal) on Nov 10, 2005 at 14:44 UTC
    Hi,


    Using you code are you able to talk to the SQL Server database at all?
    I am no expert on SQL Server but as there are no reply posts yet I will have a stab :)
    Which version of the TDS Libraries are you running? If you build DBD::Sybase with the TDS libraries from www.freetds.org you should be able to access SQL Server 2000 using the correct protocol.
    For further ino have a look at this article.

    Hope this helps.

    Martin
      freetds-0.63 built from sources, suse 9.0 with updates. Works like a charm, except for this particular issue.
Re: Email::Store segfault when using DBD::Sybase
by jfroebe (Parson) on Nov 10, 2005 at 15:48 UTC

    Hi,

    Please post a sample script of what you are trying to do. The snippets you provided aren't enough to provide a reasonable answer

    Thanks :)

    Jason L. Froebe

    Team Sybase member

    No one has seen what you have seen, and until that happens, we're all going to think that you're nuts. - Jack O'Neil, Stargate SG-1

      Toanswer several questions in one message:
      - I can talk nicely to the MS SQL server (2000), tested with several other perl scripts on this machine. The script really is just this:
      #!/usr/bin/perl use warnings; use DBI; use Email::Store ('dbi:mysql:server=127.0.0.1;database=test','test','t +est'); undef $/; $mail = <>; $/ = "\n"; Email::Store::Mail->store ( $mail );
      Side-notes - SQL Translator gave me some errors when doing Email::Store->setup: SQL 2000 wants "col_name int identity" not "col_name identity int(11)" also for some weird reason it insisted on converting text fields to varchar(65535) so I created the needed tables by hand.
        It doesn't appear that Email::Store has been tested with SQL Server or Sybase. I would recommend working with Simon Cozens to extend and test the module for use with TSQL based servers.

        Jason L. Froebe

        Team Sybase member

        No one has seen what you have seen, and until that happens, we're all going to think that you're nuts. - Jack O'Neil, Stargate SG-1

Re: Email::Store segfault when using DBD::Sybase
by mpeppler (Vicar) on Nov 11, 2005 at 06:09 UTC
    The problem is that Email::Store tries to use placeholders when preparing the SQL query, and FreeTDS doesn't support that feature in it's implementation of Sybase's Client Library yet.

    I know that they are working on it, but in the meantime the maintainer of Email::Store (or you yourself) need to find a work-around. Maybe by patching Email::Store to allow direct interpolation of parameters in some situations which could be enabled via a flag in the module?

    Michael

Re: Email::Store segfault when using DBD::Sybase
by jesuashok (Curate) on Nov 10, 2005 at 14:48 UTC
    Hi,

    If you run Perl with "-d" option you ca debug the perl code in module by module.

    "Keep pouring your ideas"
      Output from the debugger:
      ct_send(CS_DESCRIBE_INPUT) returned 0 at /usr/lib/perl5/site_perl/5.8. +1/i586-linux-thread-multi/DBD/Sybase.pm line 133, <> line 1. DBD::Sybase::db::prepare('DBIx::ContextualFetch::db=HASH(0x98a +8d54)','SELECT message_id\x{a}FROM mail\x{a}WHERE message_id = ?\x +{a}','undef') called at /usr/lib/perl5/site_perl/5.8.1/i586-linux-thr +ead-multi/DBI.pm line 1618 DBD::_::db::prepare_cached('DBIx::ContextualFetch::db=HASH(0x9 +8a8d54)','SELECT message_id\x{a}FROM mail\x{a}WHERE message_id = ? +\x{a}') called at /usr/lib/perl5/site_perl/5.8.1/Ima/DBI.pm line 381 Ima::DBI::__ANON__[/usr/lib/perl5/site_perl/5.8.1/Ima/DBI.pm:3 +84]('Email::Store::Mail','message_id = ?') called at /usr/lib/perl5/s +ite_perl/5.8.1/Class/DBI.pm line 1093 Class::DBI::_do_search('Email::Store::Mail','=','message_id',' +4cdb01c5e4c1$34619a80$46d19b3c@corrie') called at /usr/lib/perl5/site +_perl/5.8.1/Class/DBI.pm line 1071 Class::DBI::search('Email::Store::Mail','message_id','4cdb01c5 +e4c1$34619a80$46d19b3c@corrie') called at /usr/lib/perl5/site_perl/5. +8.1/Class/DBI.pm line 681 Class::DBI::retrieve('Email::Store::Mail','4cdb01c5e4c1$34619a +80$46d19b3c@corrie') called at /usr/lib/perl5/site_perl/5.8.1/Email/S +tore/Mail.pm line 33 Email::Store::Mail::store('Email::Store::Mail','Received: from + mymx.domain.com ([1.2.3.4]) by myhost....') called at ./test.pl line + 12
      I have to kill -9 it afterwards

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://507375]
Approved by marto
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (3)
As of 2024-04-19 01:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found