Re: segmentation fault

2012-01-04 Thread Motaz SAAD
On Dec 24 2011, 9:07 pm, shlo...@shlomifish.org (Shlomi Fish) wrote:
> Hi Motaz,
>
> On Thu, 22 Dec 2011 10:57:48 -0800 (PST)
>
> Motaz SAAD  wrote:
> > Hello,
>
> > Thanks very much, it is really helpful tool.
>
> You're welcome.
>
> > my script spend 10 min running until I get segmentation fault error,
> > but when I traced my script and it spend 2 days and still running !!!
> > I run tracing using -d flag (perl -d:Trace p.pl)
> > is this normal ?
>
> Well, the "-d:Trace" flag slows down the execution, but it shouldn't be such a
> dramatic difference. I guess you've ran into a Heisenbug:
>
> http://en.wikipedia.org/wiki/Unusual_software_bug#Heisenbug
>
> I'm not sure what's causing it, but I guess you can try doing manual traces
> using prints.
>
> Regards,
>
>         Shlomi Fish
>
> --
> -
> Shlomi Fish      http://www.shlomifish.org/
> Chuck Norris/etc. Facts -http://www.shlomifish.org/humour/bits/facts/
>
> And the top story for today: wives live longer than husbands because they are
> not married to women.
>     — Colin Mochrie in Who’s Line is it, Anyway?
>
> Please reply to list if it's a mailing list post -http://shlom.in/reply.

Hello,
Thanks for reply,

I traced the code with print statements, I also run the script with -d
option and the debugger pointed to line
  while(defined($frPage = $frPages->next)) {
which cause the segmentation fault !!!
it is very strange that this statement worked thousands of time then
cause segmentation fault !. I am afraid it is a problem of memory or
it is a bug in cpan Parse::MediaWikiDump package

any comments, tips, will be appreciated

thanks
best regards,
Motaz


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: segmentation fault

2011-12-24 Thread Adams Paul

Sent from my LG phone

Motaz SAAD  wrote:

>On Dec 21, 5:37 pm, shlo...@shlomifish.org (Shlomi Fish) wrote:
>> On Wed, 21 Dec 2011 09:48:19 -0600
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> Robert Wohlfarth  wrote:
>> > On Tue, Dec 20, 2011 at 11:25 AM, Motaz SAAD  wrote:
>>
>> > > I am a beginner  in perl and I have segmentation fault in my code. the
>> > > code run perfectly for the until the third iteration and it produce
>> > > segmentation fault  in the inner while loop in the 3rd iteration of
>> > > the outer while loop.
>> > > Would you please help me with hints.
>> > > Your help will be appreciated
>>
>> > If it were me, I would add "print" statements inside of the loop (see
>> > below). When it segfaults, you see which two "print"s the error comes
>> > between. Then move those closer and closer until you find the line causing
>> > the error.  That narrows down the scope. It looks like you started down
>> > that path already...
>>
>> You can achieve the same effect much more easily and without polluting your
>> code using Devel::Trace :
>>
>> *http://search.cpan.org/dist/Devel-Trace/
>>
>> There's alsohttp://search.cpan.org/dist/Devel-Trace-More/and my 
>> ownhttp://search.cpan.org/dist/Devel-LineTrace/(which does something a
>> bit different than the others) which may prove of use.
>>
>> Regards,
>>
>>         Shlomi Fish
>>
>> --
>> -
>> Shlomi Fish      http://www.shlomifish.org/
>> "Star Trek: We, the Living Dead" -http://shlom.in/st-wtld
>>
>> No one calls Xena the warrior princess “Zeena” to her face and survives.
>> Luckily for you, she hasn’t visited the modern day United States yet.
>>
>> Please reply to list if it's a mailing list post -http://shlom.in/reply.
>
>Hello,
>
>Thanks very much, it is really helpful tool.
>my script spend 10 min running until I get segmentation fault error,
>but when I traced my script and it spend 2 days and still running !!!
>I run tracing using -d flag (perl -d:Trace p.pl)
>is this normal ?
>
>Thanks,
>Best Regards,
>
>
>--
>To unsubscribe, e-mail: beginners-unsubscr...@perl.org
>For additional commands, e-mail: beginners-h...@perl.org
>http://learn.perl.org/
>
>
>


Re: segmentation fault

2011-12-24 Thread Shlomi Fish
Hi Motaz,

On Thu, 22 Dec 2011 10:57:48 -0800 (PST)
Motaz SAAD  wrote:
> Hello,
> 
> Thanks very much, it is really helpful tool.

You're welcome.

> my script spend 10 min running until I get segmentation fault error,
> but when I traced my script and it spend 2 days and still running !!!
> I run tracing using -d flag (perl -d:Trace p.pl)
> is this normal ?

Well, the "-d:Trace" flag slows down the execution, but it shouldn't be such a
dramatic difference. I guess you've ran into a Heisenbug:

http://en.wikipedia.org/wiki/Unusual_software_bug#Heisenbug

I'm not sure what's causing it, but I guess you can try doing manual traces
using prints.

Regards,

Shlomi Fish

-- 
-
Shlomi Fish   http://www.shlomifish.org/
Chuck Norris/etc. Facts - http://www.shlomifish.org/humour/bits/facts/

And the top story for today: wives live longer than husbands because they are
not married to women.
— Colin Mochrie in Who’s Line is it, Anyway?

Please reply to list if it's a mailing list post - http://shlom.in/reply .

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: segmentation fault

2011-12-24 Thread Motaz SAAD
On Dec 21, 5:37 pm, shlo...@shlomifish.org (Shlomi Fish) wrote:
> On Wed, 21 Dec 2011 09:48:19 -0600
>
>
>
>
>
>
>
>
>
> Robert Wohlfarth  wrote:
> > On Tue, Dec 20, 2011 at 11:25 AM, Motaz SAAD  wrote:
>
> > > I am a beginner  in perl and I have segmentation fault in my code. the
> > > code run perfectly for the until the third iteration and it produce
> > > segmentation fault  in the inner while loop in the 3rd iteration of
> > > the outer while loop.
> > > Would you please help me with hints.
> > > Your help will be appreciated
>
> > If it were me, I would add "print" statements inside of the loop (see
> > below). When it segfaults, you see which two "print"s the error comes
> > between. Then move those closer and closer until you find the line causing
> > the error.  That narrows down the scope. It looks like you started down
> > that path already...
>
> You can achieve the same effect much more easily and without polluting your
> code using Devel::Trace :
>
> *http://search.cpan.org/dist/Devel-Trace/
>
> There's alsohttp://search.cpan.org/dist/Devel-Trace-More/and my 
> ownhttp://search.cpan.org/dist/Devel-LineTrace/(which does something a
> bit different than the others) which may prove of use.
>
> Regards,
>
>         Shlomi Fish
>
> --
> -
> Shlomi Fish      http://www.shlomifish.org/
> "Star Trek: We, the Living Dead" -http://shlom.in/st-wtld
>
> No one calls Xena the warrior princess “Zeena” to her face and survives.
> Luckily for you, she hasn’t visited the modern day United States yet.
>
> Please reply to list if it's a mailing list post -http://shlom.in/reply.

Hello,

Thanks very much, it is really helpful tool.
my script spend 10 min running until I get segmentation fault error,
but when I traced my script and it spend 2 days and still running !!!
I run tracing using -d flag (perl -d:Trace p.pl)
is this normal ?

Thanks,
Best Regards,


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: segmentation fault

2011-12-21 Thread Robert Wohlfarth
On Wed, Dec 21, 2011 at 10:37 AM, Shlomi Fish wrote:

> On Wed, 21 Dec 2011 09:48:19 -0600
> Robert Wohlfarth  wrote:
>
> > On Tue, Dec 20, 2011 at 11:25 AM, Motaz SAAD 
> wrote:
> >
> > > I am a beginner  in perl and I have segmentation fault in my code. the
> > > code run perfectly for the until the third iteration and it produce
> > > segmentation fault  in the inner while loop in the 3rd iteration of
> > > the outer while loop.
> > > Would you please help me with hints.
> > > Your help will be appreciated
> > >
> >
> > If it were me, I would add "print" statements inside of the loop (see
> > below). When it segfaults, you see which two "print"s the error comes
> > between. Then move those closer and closer until you find the line
> causing
> > the error.  That narrows down the scope. It looks like you started down
> > that path already...
>
> You can achieve the same effect much more easily and without polluting your
> code using Devel::Trace :
>
> * http://search.cpan.org/dist/Devel-Trace/
>

Those are cool modules! Thanks for the tip.

-- 
Robert Wohlfarth


Re: segmentation fault

2011-12-21 Thread Shlomi Fish
On Wed, 21 Dec 2011 09:48:19 -0600
Robert Wohlfarth  wrote:

> On Tue, Dec 20, 2011 at 11:25 AM, Motaz SAAD  wrote:
> 
> > I am a beginner  in perl and I have segmentation fault in my code. the
> > code run perfectly for the until the third iteration and it produce
> > segmentation fault  in the inner while loop in the 3rd iteration of
> > the outer while loop.
> > Would you please help me with hints.
> > Your help will be appreciated
> >
> 
> If it were me, I would add "print" statements inside of the loop (see
> below). When it segfaults, you see which two "print"s the error comes
> between. Then move those closer and closer until you find the line causing
> the error.  That narrows down the scope. It looks like you started down
> that path already...

You can achieve the same effect much more easily and without polluting your
code using Devel::Trace :

* http://search.cpan.org/dist/Devel-Trace/

There's also http://search.cpan.org/dist/Devel-Trace-More/ and my own
http://search.cpan.org/dist/Devel-LineTrace/ (which does something a 
bit different than the others) which may prove of use.

Regards,

Shlomi Fish

-- 
-
Shlomi Fish   http://www.shlomifish.org/
"Star Trek: We, the Living Dead" - http://shlom.in/st-wtld

No one calls Xena the warrior princess “Zeena” to her face and survives.
Luckily for you, she hasn’t visited the modern day United States yet.

Please reply to list if it's a mailing list post - http://shlom.in/reply .

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: segmentation fault

2011-12-21 Thread Robert Wohlfarth
On Tue, Dec 20, 2011 at 11:25 AM, Motaz SAAD  wrote:

> I am a beginner  in perl and I have segmentation fault in my code. the
> code run perfectly for the until the third iteration and it produce
> segmentation fault  in the inner while loop in the 3rd iteration of
> the outer while loop.
> Would you please help me with hints.
> Your help will be appreciated
>

If it were me, I would add "print" statements inside of the loop (see
below). When it segfaults, you see which two "print"s the error comes
between. Then move those closer and closer until you find the line causing
the error.  That narrows down the scope. It looks like you started down
that path already...


>
> #!/usr/bin/perl -w
>
> # Code : Dake
> use strict;
> use Parse::MediaWikiDump;
> use utf8;
> use XML::Parser;
> use XML::Writer;
> use IO::File;
>
> binmode STDOUT, ":utf8";
>
>
>
> #my $file = shift(@ARGV) or die "must specify a Mediawiki dump file";
> my $enWiki = 'enwiki-latest-pages-articles.xml';
> my $frWiki = 'frwiki-2023-pages-articles.xml';
> my $arWiki = 'arwiki-2018-pages-articles.xml';
>
> my $enPages = Parse::MediaWikiDump::Pages->new($enWiki);
> my $frPages = Parse::MediaWikiDump::Pages->new($frWiki);
> my $arPages = Parse::MediaWikiDump::Pages->new($arWiki);
>
>
> my $output = new IO::File("enfrar.xml", ">:utf8");
>
> my $writer = new XML::Writer(OUTPUT => $output, DATA_MODE =>
> 1,DATA_INDENT => 2);
> $writer->xmlDecl("UTF-8");
>
> my $enPage;
> #my $frPage;
> #my $arPage;
>
> my $enId;
> #my $frId;
> #my $arId;
>
> my $enTitle;
> #my $arTitle;
> #my $frTitle;
>
> my $enText;
> #my $frText;
> #my $arText;
>
>
>
> my $EnCount = 0;
> my $EnArFrCount = 0;
> my $EnArCount = 0;
> my $EnFrCount = 0;
> my $testCount = 1;
>
>
> #my $category;
>
> $writer->startTag("en-fr-ar-wiki");
>
> while(defined($enPage = $enPages->next)) {#for each english article
>
print "One\n";

>#main namespace only
>next unless $enPage->namespace eq '';
>
>$enId = $enPage->id;
>$enTitle = $enPage->title;
>#$category = $page->category;
>$enText = $enPage->text;
>
>$EnCount++;
>
>
>if($enTitle eq "A") {next;}
>
print "Two\n";

>
>
>
>
>
>
>
>#if (($$text =~ /\[\[en:/i) && ($$text =~ /\[\[ar:/i))
>
>if (  ($$enText =~ m/\[\[fr:/i)  && ($$enText =~ m/\[\[ar:/i)  ) {#
> if the english article contains links for arabic and french articles
>print "\nlinks found for ar & fr in en article entitled:
> ",
> $enTitle , "\n";
>
>my $frPage;
>my $arPage;
>
>my $frId = "id not found";
>my $arId = "id not found";
>
>my $arTitle;
>my $frTitle;
>
>my $frText;
>my $arText;
>$frText = "text not found";
>$arText = "text not found";
>
>
>$EnArFrCount++;
>$$enText =~ /\[\[fr:(.*?)\]/  ;
>$frTitle = $1;
>$$enText =~ /\[\[ar:(.*?)\]/  ;
>$arTitle = $1;
>
>
>#enforce the MediaWiki case rules
>#$frTitle = case_fixer($frTitle);
>print "searching for fr text in fr wiki\n";
>
>while(defined($frPage = $frPages->next)) {#find the the
> french
> article id and text,,, search by article's title
>#main namespace only
>next unless $frPage->namespace eq '';
>
print "Three\n";

>if ($frPage->title eq $frTitle) {
>my $frTextRef = $frPage->text;
>$frText = $$frTextRef;
>$frId = $frPage->id;
>print "fr text found\n";
>last;
>}
>}#end while for extracting french article id and text
>
print "Four\n";

>
> 
>
>#enforce the MediaWiki case rules
>#$arTitle = case_fixer($arTitle);
>print "searching for ar text in ar wiki\n";
>
>while(defined($arPag

segmentation fault

2011-12-21 Thread Motaz SAAD
Hello,

I am a beginner  in perl and I have segmentation fault in my code. the
code run perfectly for the until the third iteration and it produce
segmentation fault  in the inner while loop in the 3rd iteration of
the outer while loop.
Would you please help me with hints.
Your help will be appreciated

--
Motaz SAAD




#!/usr/bin/perl -w

# Code : Dake
use strict;
use Parse::MediaWikiDump;
use utf8;
use XML::Parser;
use XML::Writer;
use IO::File;

binmode STDOUT, ":utf8";



#my $file = shift(@ARGV) or die "must specify a Mediawiki dump file";
my $enWiki = 'enwiki-latest-pages-articles.xml';
my $frWiki = 'frwiki-2023-pages-articles.xml';
my $arWiki = 'arwiki-2018-pages-articles.xml';

my $enPages = Parse::MediaWikiDump::Pages->new($enWiki);
my $frPages = Parse::MediaWikiDump::Pages->new($frWiki);
my $arPages = Parse::MediaWikiDump::Pages->new($arWiki);


my $output = new IO::File("enfrar.xml", ">:utf8");

my $writer = new XML::Writer(OUTPUT => $output, DATA_MODE =>
1,DATA_INDENT => 2);
$writer->xmlDecl("UTF-8");

my $enPage;
#my $frPage;
#my $arPage;

my $enId;
#my $frId;
#my $arId;

my $enTitle;
#my $arTitle;
#my $frTitle;

my $enText;
#my $frText;
#my $arText;



my $EnCount = 0;
my $EnArFrCount = 0;
my $EnArCount = 0;
my $EnFrCount = 0;
my $testCount = 1;


#my $category;

$writer->startTag("en-fr-ar-wiki");

while(defined($enPage = $enPages->next)) {#for each english article
#main namespace only
next unless $enPage->namespace eq '';

$enId = $enPage->id;
$enTitle = $enPage->title;
#$category = $page->category;
$enText = $enPage->text;

$EnCount++;


if($enTitle eq "A") {next;}







#if (($$text =~ /\[\[en:/i) && ($$text =~ /\[\[ar:/i))

if (  ($$enText =~ m/\[\[fr:/i)  && ($$enText =~ m/\[\[ar:/i)  ) {#
if the english article contains links for arabic and french articles
print "\nlinks found for ar & fr in en article entitled:   ",
$enTitle , "\n";

my $frPage;
my $arPage;

my $frId = "id not found";
my $arId = "id not found";

my $arTitle;
my $frTitle;

my $frText;
my $arText;
$frText = "text not found";
$arText = "text not found";


$EnArFrCount++;
$$enText =~ /\[\[fr:(.*?)\]/  ;
$frTitle = $1;
$$enText =~ /\[\[ar:(.*?)\]/  ;
$arTitle = $1;


#enforce the MediaWiki case rules
#$frTitle = case_fixer($frTitle);
print "searching for fr text in fr wiki\n";

while(defined($frPage = $frPages->next)) {#find the the french
article id and text,,, search by article's title
#main namespace only
next unless $frPage->namespace eq '';
if ($frPage->title eq $frTitle) {
my $frTextRef = $frPage->text;
$frText = $$frTextRef;
$frId = $frPage->id;
print "fr text found\n";
last;
}
}#end while for extracting french article id and text



#enforce the MediaWiki case rules
#$arTitle = case_fixer($arTitle);
print "searching for ar text in ar wiki\n";

while(defined($arPage = $arPages->next)) {#find the the arabic
article id and text,,, search by article's title
#main namespace only
next unless $arPage->namespace eq '';
if ($arPage->title eq $arTitle) {
my $arTextRef = $arPage->text;
$arText = $$arTextRef;
$arId = $arPage->id;
print "ar text found\n";
last;
}
}#end while for extracting arabic article id and text





print $enId;
print ",";
print $enTitle;
print ",";
print $frTitle;
print ",";
print $arTitle;
print"\n";

#SQL
$writer->startTag("page");

$writer->startTag("en");


Re: help: segmentation fault in threads program that use binmode

2011-07-12 Thread a b
Hi,

did you got your issue resolved!! I also face segmentation fault but without
binmode

I didn't found any solution any where and opted another solution

my program was using thread in loop till perl dump core with Out of memory
issue


Best of luck

~a b

On Thu, Jun 9, 2011 at 5:32 AM, anders lee  wrote:

>
> when i use binmode in threaded program, i got a segmentation fault;
>
> i comment the binmode line, the program works well
>
>
> use threads;
> use threads::shared;
>
> use utf8;
> binmode(STDOUT, ':encoding(utf8)';
>
> ---thread create and join-
>
>
>
> --
> 使用 Opera 革命性的电子邮件客户程序: http://www.opera.com/mail/
>
> --
> To unsubscribe, e-mail: beginners-unsubscr...@perl.org
> For additional commands, e-mail: beginners-h...@perl.org
> http://learn.perl.org/
>
>
>


Re: help: segmentation fault in threads program that use binmode

2011-06-17 Thread Shlomi Fish
Hi anders,

On Wed, 15 Jun 2011 07:38:46 +0800
"anders lee"  wrote:

> 
> when i use binmode in threaded program, i got a segmentation fault;
> 
> i comment the binmode line, the program works well
> 
> 
> use threads;
> use threads::shared;
> 
> use utf8;
> binmode(STDOUT, ':encoding(utf8)';
> 

Well, it's not a good idea to use threads in Perl:

 rindolf: Before you start implementing code using Perl's
threads, please remember that Perl's threads are not like other
threads. Please see http://perldoc.perl.org/perlthrtut.html to learn
more; specifically the "What kind of threads are perl threads?"
section. Also see: http://www.perlmonks.org/index.pl?node_id=288022  

Please consider using forking or an asynchronous I/O framework
for Perl such as POE, IO::Async or Reflex, instead.

Regards,

Shlomi Fish 

-- 

-
Shlomi Fish  http://www.shlomifish.org/

Chuck Norris can make the statement "This statement is false" a true
one.

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




help: segmentation fault in threads program that use binmode

2011-06-14 Thread anders lee


when i use binmode in threaded program, i got a segmentation fault;

i comment the binmode line, the program works well


use threads;
use threads::shared;

use utf8;
binmode(STDOUT, ':encoding(utf8)';

---thread create and join-



--
使用 Opera 革命性的电子邮件客户程序: http://www.opera.com/mail/

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




help: segmentation fault in threads program that use binmode

2011-06-08 Thread anders lee


when i use binmode in threaded program, i got a segmentation fault;

i comment the binmode line, the program works well


use threads;
use threads::shared;

use utf8;
binmode(STDOUT, ':encoding(utf8)';

---thread create and join-



--
使用 Opera 革命性的电子邮件客户程序: http://www.opera.com/mail/

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Getting Segmentation fault

2008-05-31 Thread Rajnikant
Hello everyone,
 
I'm trying to call 'C' routine from perl script. I have static library
(libFile.a) where I can get object code of 
this routine and I have linked it with my perl script. This perl script get
compile but after running it I'm getting
segmentation fault. See code below for reference:
 
=== C Routine ==
#include 
#include 
 
char *  MyMethod(char *data)
{
   strcpy(data,"My text from C Code ");
   return data;
}
steps to get libFile.a:
cc -c libFile.o libFile.c
ar rcs libFile.a libFile.o
 
=== PerlScript ==
package Caller;
use Inline C => Config =>
ENABLE => AUTOWRAP,
LIBS => '-L/lib_location -lFile',
INC => '-I/lib_location'
  ;
use Inline C => <<'END';
char * MyMethod(char *data);
AV* AVstr;
SV* SVstr1;
void DisplayData()
{
AVstr=newAV();
   // Call to function defined in library
AVstr =  MyMethod(AVstr);
printf("\n SVstr1 data: %s\n",AVstr);
}
END
1;
 
use strict;
# call to Function
   Caller::DisplayData();
1;
Compile: perl -c Script_name
run :  perl -w Script_name
 
Do you have any guess why am I getting Segmentation fault? Is this the right
way to pass parameters and 
particularly memory allocation and deallocation?
 
Thanks in advance.



Thanks and Best regards,

~ Rajnikant

Software Engg.

Persistent Sys. Ltd.

Ph. +91 98222 04088

 

DISCLAIMER
==
This e-mail may contain privileged and confidential information which is the 
property of Persistent Systems Ltd. It is intended only for the use of the 
individual or entity to which it is addressed. If you are not the intended 
recipient, you are not authorized to read, retain, copy, print, distribute or 
use this message. If you have received this communication in error, please 
notify the sender and delete all copies of this message. Persistent Systems 
Ltd. does not accept any liability for virus infected mails.


Re: Getting Segmentation fault

2008-05-28 Thread Chas. Owens
On Wed, May 28, 2008 at 2:58 AM, Rajnikant
<[EMAIL PROTECTED]> wrote:
snip
> Could someone please help me out finding whats wrong in code?
> Thanks in advance.
snip

Without looking at the code in detail I would bet that the module is
not thread safe.  Try creating the Net::SFTP objects inside the
thread.

-- 
Chas. Owens
wonkden.net
The most important skill a programmer can have is the ability to read.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Getting Segmentation fault

2008-05-27 Thread Rajnikant
Hello everyone,
 
I want to connect my client to multiple servers and download files using
SFTP.
So as to connect and download file from server I'm using seperate thread.
I'm 
getting segmentation fault while creating the SFTP connection/Object in
SFTP::New method.
Following is the code snipet:
 
use threads;
use Net::SFTP;
 
my $host = 'xx.yy.zz.aa';
my $user = 'usr';
my $password = 'usr123';
 
my $thread = threads->new (\&ftpThreadEntry,$host,$user,$password);
my $thread1 = threads->new (\&ftpThreadEntry,$host,$user,$password);
 
sub ftpThreadEntry()
{
   my $host_l = shift;
   my $usr = shift;
   my $passwd = shift;
   print( "$host $usr $passwd \n");
 
   my %args = (
   "user",$usr,
   "password",$passwd
   );
 
   my $sftp = Net::SFTP->new($host_l,%args);
   if ($sftp)
   {
   print(" got connected to $host_l now\n");
   }
}
 
$thread->join();
$thread1->join();
 
after runing this, I'm getting following errors messages:
PARI:   ***   forbidden at
/usr/lib/perl5/site_perl/5.8.8/Net/SSH/Perl/Util/SSH2MP.pm line 17.
thread failed to start: PARI:   ***   unknown type 41. at
/usr/lib/perl5/site_perl/5.8.8/Net/SSH/Perl/Util/SSH2MP.pm line 17.
Segmentation fault

Could someone please help me out finding whats wrong in code?
Thanks in advance.



Thanks and Best regards,

~ Rajnikant

Software Engg.

Persistent Sys. Ltd.

Ph. +91 98222 04088

 

DISCLAIMER
==
This e-mail may contain privileged and confidential information which is the 
property of Persistent Systems Ltd. It is intended only for the use of the 
individual or entity to which it is addressed. If you are not the intended 
recipient, you are not authorized to read, retain, copy, print, distribute or 
use this message. If you have received this communication in error, please 
notify the sender and delete all copies of this message. Persistent Systems 
Ltd. does not accept any liability for virus infected mails.


Perl OBDC Segmentation fault

2007-10-05 Thread [EMAIL PROTECTED]
Hi all,
I have a script about query record from MS Access database.
This database contains a table named Lengths.
The list of field names is Sample_ID, Taxon_ID, Lenght.

Question is coming:
1. When I use the query command: select * from Lengths
It works well!
2. When I use the query command: select  * from Lengths where Taxon_ID
=1
It gives the following:
18-1-16
23-1-17
23-1-15
23-1-14
24-1-15
Segmentation fault
3. When I use the query command: select  * from Lengths where
Sample_ID = 1
The result is :
[EMAIL PROTECTED] msaccess]$ perl test.pl
Segmentation fault

Does anyone meet this problem?
My code is like this:
my $dbh = DBI-> connect( "dbi:ODBC:DSN=mdb1") or die "$DBI::errstr";
my $query = "select * from Lengths";

my $tp=$dbh->prepare("select  * from Lengths where Sample_ID = 1") or
die "cna nont $dbh->err $dbh->errstr \n";
$tp->execute();

#print $tp;

while (my @tmp_l=$tp->fetchrow_array())
{ print join('-',@tmp_l),"\n";}

The operating system is Red Hat Enterprise 3.
Perl : v5.8.3 built for i386-linux-thread-multi
ODBC: unixODBC 2.2.12
DBD::ODBC: 1.14

Best Regards,
Xu


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: Perl OBDC Segmentation fault

2007-10-05 Thread Jeff Pang
2007/10/4, [EMAIL PROTECTED] <[EMAIL PROTECTED]>:
> 2. When I use the query command: select  * from Lengths where Taxon_ID
> =1
> It gives the following:
> 18-1-16
> 23-1-17
> 23-1-15
> 23-1-14
> 24-1-15
> Segmentation fault
> 3. When I use the query command: select  * from Lengths where
> Sample_ID = 1
> The result is :
> [EMAIL PROTECTED] msaccess]$ perl test.pl
> Segmentation fault


Hi,

This is hard to debug it via common perl way.
You may refer this DBI debug document or ask it on DBI mailing list.

http://www.easysoft.com/developer/languages/perl/dbi-debugging.html

-- 
Jeff Pang - [EMAIL PROTECTED]
http://www.rwweb.co.cc

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: Perl OBDC Segmentation fault

2007-10-05 Thread Rob Coops
That should be: PERL_DL_NONLAZY=1

(fat fingers or a slow brain, quite possibly both, cause me to make those
kinds of mistakes)


On 10/5/07, Rob Coops <[EMAIL PROTECTED]> wrote:
>
> Here is one solution that seems to work for me.
>
> Set the following environment variable: PERL_DL_NOnLAZY=1
>
> The explanation as to what it does and why this might work you can fine at
> this link:  http://www.perl.com/lpt/a/520
>
> Regards,
>
> Rob
>
>
> On 10/4/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> >
> > Hi all,
> >I have a script about query record from MS Access database.
> > This database contains a table named Lengths.
> > The list of field names is Sample_ID, Taxon_ID, Lenght.
> >
> > Question is coming:
> > 1. When I use the query command: select * from Lengths
> > It works well!
> > 2. When I use the query command: select  * from Lengths where Taxon_ID
> > =1
> > It gives the following:
> > 18-1-16
> > 23-1-17
> > 23-1-15
> > 23-1-14
> > 24-1-15
> > Segmentation fault
> > 3. When I use the query command: select  * from Lengths where
> > Sample_ID = 1
> > The result is :
> > [EMAIL PROTECTED] msaccess]$ perl test.pl
> > Segmentation fault
> >
> > Does anyone meet this problem?
> > My code is like this:
> > my $dbh = DBI-> connect( "dbi:ODBC:DSN=mdb1") or die "$DBI::errstr";
> > my $query = "select * from Lengths";
> >
> > my $tp=$dbh->prepare("select  * from Lengths where Sample_ID = 1") or
> > die "cna nont $dbh->err $dbh->errstr \n";
> > $tp->execute();
> >
> > #print $tp;
> >
> > while (my @tmp_l=$tp->fetchrow_array())
> > { print join('-',@tmp_l),"\n";}
> >
> > The operating system is Red Hat Enterprise 3.
> > Perl : v5.8.3 built for i386-linux-thread-multi
> > ODBC: unixODBC 2.2.12
> > DBD::ODBC: 1.14
> >
> > Best Regards,
> > Xu
> >
> >
> > --
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > http://learn.perl.org/
> >
> >
> >
>


Perl OBDC Segmentation fault

2007-10-05 Thread [EMAIL PROTECTED]
Hi all,
I have a script about query record from MS Access database.
This database contains a table named Lengths.
The list of field names is Sample_ID, Taxon_ID, Lenght.

Question is coming:
1. When I use the query command: select * from Lengths
It works well!
2. When I use the query command: select  * from Lengths where Taxon_ID
=1
It gives the following:
18-1-16
23-1-17
23-1-15
23-1-14
24-1-15
Segmentation fault
3. When I use the query command: select  * from Lengths where
Sample_ID = 1
The result is :
[EMAIL PROTECTED] msaccess]$ perl test.pl
Segmentation fault

Does anyone meet this problem?
My code is like this:
my $dbh = DBI-> connect( "dbi:ODBC:DSN=mdb1") or die "$DBI::errstr";
my $query = "select * from Lengths";

my $tp=$dbh->prepare("select  * from Lengths where Sample_ID = 1") or
die "cna nont $dbh->err $dbh->errstr \n";
$tp->execute();

#print $tp;

while (my @tmp_l=$tp->fetchrow_array())
{ print join('-',@tmp_l),"\n";}

The operating system is Red Hat Enterprise 3.
Perl : v5.8.3 built for i386-linux-thread-multi
ODBC: unixODBC 2.2.12
DBD::ODBC: 1.14

Best Regards,
Xu


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




[Fwd: Re: Email::Address Segmentation Fault]

2006-12-08 Thread Mathew Snyder
Rob Dixon wrote:
> Mathew Snyder wrote:
>>
>> I can't seem to get this working.  Every time I try to run it
>> segfaults on me.
>> I've removed it from my code and reverted to the stage I was at before
>> I added
>> it and my script worked exactly as it did before I put it in.  I've
>> installed it
>> via both cpan and yum.  I've tried running it on a SuSE box and two
>> Fedora Core
>> 5 boxes.  I get the same result both times.
>>
>> Does anyone know if this is a buggy module?  Version is 1.883-1
> 
> Mathew Snyder wrote:
>>
>> my $data = $agent->content();
>> my @emails = Email::Address->parse($data);
>>
>> foreach my $email (@emails){
>> print $email;
>> };
> 
> Hmm. It shouldn't seg fault - it's all written in Perl. There is a
> version 1.884
> but I doubt if that will fix anything. All I can suggest is to try to
> reduce the
> problem. Is it faulting when it parses the HTML or when it prints the
> results?
> Can you simplify the data to a point where the fault goes away?
> 
> As a last resort there is a module Regexp::Common::Email::Address which
> you can
> try instead, but what you've got should work fine. Oh, and what Perl
> version are
> you running?
> 
> Rob
> 

I appreciate all of your help as well as little hints at compacting and cleaning
up my code as in the other thread.

As for this topic, I ended up figuring out how to use HTML::TokeParser which
wasn't nearly as complicated as I first thought.  I am now able to extract all
the email addresses I am looking for without any of the extra stuff I'm not.

Of course, that doesn't solve the segfault issue but that will have to wait
until later I think.

Mathew

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Email::Address Segmentation Fault

2006-12-08 Thread Mathew Snyder
Rob Dixon wrote:
> Mathew Snyder wrote:
>>
>> I can't seem to get this working.  Every time I try to run it
>> segfaults on me.
>> I've removed it from my code and reverted to the stage I was at before
>> I added
>> it and my script worked exactly as it did before I put it in.  I've
>> installed it
>> via both cpan and yum.  I've tried running it on a SuSE box and two
>> Fedora Core
>> 5 boxes.  I get the same result both times.
>>
>> Does anyone know if this is a buggy module?  Version is 1.883-1
> 
> Mathew Snyder wrote:
>>
>> my $data = $agent->content();
>> my @emails = Email::Address->parse($data);
>>
>> foreach my $email (@emails){
>> print $email;
>> };
> 
> Hmm. It shouldn't seg fault - it's all written in Perl. There is a
> version 1.884
> but I doubt if that will fix anything. All I can suggest is to try to
> reduce the
> problem. Is it faulting when it parses the HTML or when it prints the
> results?
> Can you simplify the data to a point where the fault goes away?
> 
> As a last resort there is a module Regexp::Common::Email::Address which
> you can
> try instead, but what you've got should work fine. Oh, and what Perl
> version are
> you running?
> 
> Rob
> 

I appreciate all of your help as well as little hints at compacting and cleaning
up my code as in the other thread.

As for this topic, I ended up figuring out how to use HTML::TokeParser which
wasn't nearly as complicated as I first thought.  I am now able to extract all
the email addresses I am looking for without any of the extra stuff I'm not.

Of course, that doesn't solve the segfault issue but that will have to wait
until later I think.

Mathew

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Email::Address Segmentation Fault

2006-12-06 Thread Jay Savage

On 12/6/06, Rob Dixon <[EMAIL PROTECTED]> wrote:

Mathew Snyder wrote:
>
> This is the meat of what I have.  It looks like it should work exactly as you
> have only a bit more explicitly.  All it does is return me to the prompt.  I
> know there should be at least 100 emails in the text I'm parsing.  In fact, 
I've
> figured out how to do this with HTML::TokeParser and am getting several hits. 
 I
> just need to figure out how to eliminate things I don't want.
>
> my $agent = WWW::Mechanize->new();
> $agent->get('https://rt.ops.servervault.com/');
>
> $agent->submit_form(
> form_name => 'login',
> fields=> {
> 'user' => $user,
> 'pass' => $pass,
> }
> );
>
> $agent->follow_link(text => "Tickets");
>
> $agent->submit_form(
> form_name => 'BuildQuery',
> fields=> {
> 'ValueOfStatus' => $status,
> 'ValueOfActor'  => $user,
> 'ValueOfQueue'  => $queue,
> },
> button=> 'DoSearch'
> );
>
> $agent =~ s/\s+/ /g;
> my @emails = Email::Address->parse($agent);
>
> foreach my $email (@emails){
> print $email;
> };

OK, here's your problem. Sorry, I overlooked it before. You're trying to parse
the WWW::Mechanize agent itself instead of the contents of the current page. You
had it correct in your previous post! Try:

my $data = $agent->content;
my @emails = Email::Address->parse($data);
print $_->address, "\n" foreach @emails;

and if you're having trouble add in the $data =~ s/\s+/ /g line before parsing
it.

HTH,

Rob



That may be the solution, but it isn't the problem. Or rather, it's
only one problem.

Regardless of whether E::A->parse() succeeds or fails, and of whether
on success it returns the expected result, Matthew should never be
seeing something die with SIGSEGV. That, combined with the fact that
nobody else seems to be getting a segfault leads me to believe that
something in Matthew's installation of Mech or one of its
dependencies, or possibly even the Perl RE, didn't compile correctly.
E::A->parse quite happily accepts the Mech object for me. It doesn't
return anything useful, but it doesn't segfault.

Email::Address is a pure Perl module with no XS. It should never dump
core. Die perhaps, but not segfault.

Something's fishy here.

-- jay
--
This email and attachment(s): [  ] blogable; [ x ] ask first; [  ]
private and confidential

daggerquill [at] gmail [dot] com
http://www.tuaw.com  http://www.downloadsquad.com  http://www.engatiki.org

values of β will give rise to dom!


Re: Email::Address Segmentation Fault

2006-12-06 Thread Rob Dixon

Mathew Snyder wrote:


This is the meat of what I have.  It looks like it should work exactly as you
have only a bit more explicitly.  All it does is return me to the prompt.  I
know there should be at least 100 emails in the text I'm parsing.  In fact, I've
figured out how to do this with HTML::TokeParser and am getting several hits.  I
just need to figure out how to eliminate things I don't want.

my $agent = WWW::Mechanize->new();
$agent->get('https://rt.ops.servervault.com/');

$agent->submit_form(
form_name => 'login',
fields=> {
'user' => $user,
'pass' => $pass,
}
);

$agent->follow_link(text => "Tickets");

$agent->submit_form(
form_name => 'BuildQuery',
fields=> {
'ValueOfStatus' => $status,
'ValueOfActor'  => $user,
'ValueOfQueue'  => $queue,
},
button=> 'DoSearch'
);

$agent =~ s/\s+/ /g;
my @emails = Email::Address->parse($agent);

foreach my $email (@emails){
print $email;
};


OK, here's your problem. Sorry, I overlooked it before. You're trying to parse
the WWW::Mechanize agent itself instead of the contents of the current page. You
had it correct in your previous post! Try:

my $data = $agent->content;
my @emails = Email::Address->parse($data);
print $_->address, "\n" foreach @emails;

and if you're having trouble add in the $data =~ s/\s+/ /g line before parsing
it.

HTH,

Rob

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Email::Address Segmentation Fault

2006-12-06 Thread Mathew
Rob Dixon wrote:
> Mathew Snyder wrote:
>> Rob Dixon wrote:
>>>
>>> Mathew Snyder wrote:

 Yes, that is exactly what I get.
>>>
>>> Then can you post something that /doesn't/ work for you please?
>>
>> I'm not sure what you mean.  The script I posted doesn't work for me.  So
>> far, everything you've suggested does.
> 
> I mean can you post some HTML that won't parse for you: I need to
> experience
> your problem myself to be able to help properly. The snippet of HTML you
> did
> post works fine for both of us, and I can't get the data you're having
> trouble
> with as I can't even see the server at rt.ops.servervault.com - I assume
> it's on
> your intranet. Even if I could I don't have your login details.
> 
> Rob
> 

That's kinda the hook here.  That bit of HTML I posted is exactly the
HTML I'm trying to parse.  For some reason, the code you have provided
works while the code I've been showing you doesn't even though, for all
intents and purposes, they do the same thing.

Mathew


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Email::Address Segmentation Fault

2006-12-06 Thread Rob Dixon

Mathew Snyder wrote:

Rob Dixon wrote:


Mathew Snyder wrote:


Yes, that is exactly what I get.


Then can you post something that /doesn't/ work for you please?


I'm not sure what you mean.  The script I posted doesn't work for me.  So
far, everything you've suggested does.


I mean can you post some HTML that won't parse for you: I need to experience
your problem myself to be able to help properly. The snippet of HTML you did
post works fine for both of us, and I can't get the data you're having trouble
with as I can't even see the server at rt.ops.servervault.com - I assume it's on
your intranet. Even if I could I don't have your login details.

Rob

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Email::Address Segmentation Fault

2006-12-06 Thread Rob Dixon

Mathew Snyder wrote:

Mathew Snyder wrote:

Mathew Snyder wrote:

I can't seem to get this working.  Every time I try to run it segfaults
on me. I've removed it from my code and reverted to the stage I was at 
before I added it and my script worked exactly as it did before I put

it in.  I've installed it via both cpan and yum.  I've tried running it
on a SuSE box and two Fedora Core 5 boxes.  I get the same result both
times.

Does anyone know if this is a buggy module?  Version is 1.883-1

I looked over the doc for this module.  It looks like the parse() method 
requires one argument which is a list of email addresses to look for. The

way I have it set up I think I may be passing the source of an entire web
page to it.


Oh, and that little snippet of code did work for me.

Mathew



Failing all else, try this:


use Regexp::Common qw/Email::Address/;

my @found = $data =~ /$RE{Email}{Address}/g;
print "$_\n" foreach @found;


Rob



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Email::Address Segmentation Fault

2006-12-06 Thread Mathew Snyder
Rob Dixon wrote:
> Mathew Snyder wrote:
>>
>> Rob Dixon wrote:
>>>
>>> Look at the code below. Is this what you get?
>>>
>>>
>>> use strict;
>>> use warnings;
>>>
>>> use Email::Address;
>>>
>>> my $data = q|
>>>>> href="/Ticket/Display.html?id=52549">52549>> class="collection-as-table" >>> href="/Ticket/Display.html?id=52549">***POSSIBLE SPAM*** Of fight a
>>> implicitopen>> class="collection-as-table" >Security class="collection-as-table"
> msnyder62>> class="oddline"
>  [EMAIL PROTECTED]>> class="collection-as-table"
> 13 hours ago 13 hours
>>> ago>0
>>> |;
>>>
>>> my @addrs = Email::Address->parse($data);
>>>
>>> print $_->address, "\n" foreach @addrs;
>>>
>>> **OUTPUT**
>>>
>>> [EMAIL PROTECTED]
>>>
>>>
>>
>> Yes, that is exactly what I get.
> 
> Then can you post something that /doesn't/ work for you please?
> 
> Rob
> 
> 
> 

I'm not sure what you mean.  The script I posted doesn't work for me.  So far,
everything you've suggested does.

Mathew

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Email::Address Segmentation Fault

2006-12-06 Thread Rob Dixon

Mathew Snyder wrote:
>
> Rob Dixon wrote:
>>
>> Look at the code below. Is this what you get?
>>
>>
>> use strict;
>> use warnings;
>>
>> use Email::Address;
>>
>> my $data = q|
>>> href="/Ticket/Display.html?id=52549">52549> class="collection-as-table" >> href="/Ticket/Display.html?id=52549">***POSSIBLE SPAM*** Of fight a
>> implicitopen> class="collection-as-table" >Security>>> msnyder62> class="oddline"
 >>> [EMAIL PROTECTED]> class="collection-as-table"
 13 hours ago>>> 13 hours
>> ago0
>> |;
>>
>> my @addrs = Email::Address->parse($data);
>>
>> print $_->address, "\n" foreach @addrs;
>>
>> **OUTPUT**
>>
>> [EMAIL PROTECTED]
>>
>>
>
> Yes, that is exactly what I get.

Then can you post something that /doesn't/ work for you please?

Rob



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Email::Address Segmentation Fault

2006-12-06 Thread Mathew Snyder
Rob Dixon wrote:
> Mathew Snyder wrote:
>> Rob Dixon wrote:
>>> Mathew Snyder wrote:
 Mathew Snyder wrote:
> I can't seem to get this working.  Every time I try to run it
> segfaults on me.
> I've removed it from my code and reverted to the stage I was at
> before I added
> it and my script worked exactly as it did before I put it in.  I've
> installed it
> via both cpan and yum.  I've tried running it on a SuSE box and two
> Fedora Core
> 5 boxes.  I get the same result both times.
>
> Does anyone know if this is a buggy module?  Version is 1.883-1
>
> Mathew
>
 I looked over the doc for this module.  It looks like the parse()
> method
 requires one argument which is a list of email addresses to look for.
 The way I
 have it set up I think I may be passing the source of an entire web
 page to it.
>>> OK it seems to dislike newlines in the content it's parsing. Make
> sure this
>>> works for you and, if so, you can apply the same fix to your own data.
>>> In the
>>> meantime I shall make some time to find the problem in the module (it
>>> just hangs
>>> on my machine).
>>>
>>> Rob
>>>
>>>
>>> use strict;
>>> use warnings;
>>>
>>> use LWP::Simple;
>>> use Email::Address;
>>>
>>> my $data = get
>>> 'http://search.cpan.org/~rjbs/Email-Address-1.884/lib/Email/Address.pm';
>>> $data =~ s/\s+/ /g;
>>>
>>> my @addrs = Email::Address->parse($data);
>>>
>>> print $_->address, "\n" foreach @addrs;
>>>
>>>
>>
>> This is the meat of what I have.  It looks like it should work exactly
> as you
>> have only a bit more explicitly.  All it does is return me to the
> prompt.  I
>> know there should be at least 100 emails in the text I'm parsing.  In
> fact, I've
>> figured out how to do this with HTML::TokeParser and am getting
> several hits.  I
>> just need to figure out how to eliminate things I don't want.
>>
>> my $agent = WWW::Mechanize->new();
>> $agent->get('https://rt.ops.servervault.com/');
>>
>> $agent->submit_form(
>> form_name => 'login',
>> fields=> {
>> 'user' => $user,
>> 'pass' => $pass,
>> }
>> );
>>
>> $agent->follow_link(text => "Tickets");
>>
>> $agent->submit_form(
>> form_name => 'BuildQuery',
>> fields=> {
>> 'ValueOfStatus' => $status,
>> 'ValueOfActor'  => $user,
>> 'ValueOfQueue'  => $queue,
>> },
>> button=> 'DoSearch'
>> );
>>
>> $agent =~ s/\s+/ /g;
>> my @emails = Email::Address->parse($agent);
>>
>> foreach my $email (@emails){
>> print $email;
>> };
>>
>>
>> This is an example of the text I'm parsing:
> 
> [snip]
> 
> Look at the code below. Is this what you get?
> 
> Rob
> 
> 
> use strict;
> use warnings;
> 
> use Email::Address;
> 
> my $data = q|
> href="/Ticket/Display.html?id=52549">52549 class="collection-as-table" > href="/Ticket/Display.html?id=52549">***POSSIBLE SPAM*** Of fight a
> implicitopen class="collection-as-table" >Security> >msnyder62 class="oddline"
>> >> >[EMAIL PROTECTED] class="collection-as-table"
>> >13 hours ago> >13 hours
> ago0
> |;
> 
> my @addrs = Email::Address->parse($data);
> 
> print $_->address, "\n" foreach @addrs;
> 
> **OUTPUT**
> 
> [EMAIL PROTECTED]
> 
> 

Yes, that is exactly what I get.

Mathew

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Email::Address Segmentation Fault

2006-12-06 Thread Rob Dixon

Mathew Snyder wrote:
> Rob Dixon wrote:
>> Mathew Snyder wrote:
>>> Mathew Snyder wrote:
 I can't seem to get this working.  Every time I try to run it
 segfaults on me.
 I've removed it from my code and reverted to the stage I was at
 before I added
 it and my script worked exactly as it did before I put it in.  I've
 installed it
 via both cpan and yum.  I've tried running it on a SuSE box and two
 Fedora Core
 5 boxes.  I get the same result both times.

 Does anyone know if this is a buggy module?  Version is 1.883-1

 Mathew

>>> I looked over the doc for this module.  It looks like the parse() method
>>> requires one argument which is a list of email addresses to look for.
>>> The way I
>>> have it set up I think I may be passing the source of an entire web
>>> page to it.
>> OK it seems to dislike newlines in the content it's parsing. Make sure this
>> works for you and, if so, you can apply the same fix to your own data.
>> In the
>> meantime I shall make some time to find the problem in the module (it
>> just hangs
>> on my machine).
>>
>> Rob
>>
>>
>> use strict;
>> use warnings;
>>
>> use LWP::Simple;
>> use Email::Address;
>>
>> my $data = get
>> 'http://search.cpan.org/~rjbs/Email-Address-1.884/lib/Email/Address.pm';
>> $data =~ s/\s+/ /g;
>>
>> my @addrs = Email::Address->parse($data);
>>
>> print $_->address, "\n" foreach @addrs;
>>
>>
>
> This is the meat of what I have.  It looks like it should work exactly as you
> have only a bit more explicitly.  All it does is return me to the prompt.  I
> know there should be at least 100 emails in the text I'm parsing.  In fact, 
I've
> figured out how to do this with HTML::TokeParser and am getting several hits. 
 I
> just need to figure out how to eliminate things I don't want.
>
> my $agent = WWW::Mechanize->new();
> $agent->get('https://rt.ops.servervault.com/');
>
> $agent->submit_form(
> form_name => 'login',
> fields=> {
> 'user' => $user,
> 'pass' => $pass,
> }
> );
>
> $agent->follow_link(text => "Tickets");
>
> $agent->submit_form(
> form_name => 'BuildQuery',
> fields=> {
> 'ValueOfStatus' => $status,
> 'ValueOfActor'  => $user,
> 'ValueOfQueue'  => $queue,
> },
> button=> 'DoSearch'
> );
>
> $agent =~ s/\s+/ /g;
> my @emails = Email::Address->parse($agent);
>
> foreach my $email (@emails){
> print $email;
> };
>
>
> This is an example of the text I'm parsing:

[snip]

Look at the code below. Is this what you get?

Rob


use strict;
use warnings;

use Email::Address;

my $data = q|
   52549***POSSIBLE SPAM*** Of fight a
implicitopenSecurity >msnyder62 > >[EMAIL PROTECTED] >13 hours ago >13 hours
ago0
|;

my @addrs = Email::Address->parse($data);

print $_->address, "\n" foreach @addrs;

**OUTPUT**

[EMAIL PROTECTED]


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Email::Address Segmentation Fault

2006-12-06 Thread Mathew Snyder
Rob Dixon wrote:
> Mathew Snyder wrote:
>> Mathew Snyder wrote:
>>> I can't seem to get this working.  Every time I try to run it
>>> segfaults on me.
>>> I've removed it from my code and reverted to the stage I was at
>>> before I added
>>> it and my script worked exactly as it did before I put it in.  I've
>>> installed it
>>> via both cpan and yum.  I've tried running it on a SuSE box and two
>>> Fedora Core
>>> 5 boxes.  I get the same result both times.
>>>
>>> Does anyone know if this is a buggy module?  Version is 1.883-1
>>>
>>> Mathew
>>>
>>
>> I looked over the doc for this module.  It looks like the parse() method
>> requires one argument which is a list of email addresses to look for. 
>> The way I
>> have it set up I think I may be passing the source of an entire web
>> page to it.
> 
> OK it seems to dislike newlines in the content it's parsing. Make sure this
> works for you and, if so, you can apply the same fix to your own data.
> In the
> meantime I shall make some time to find the problem in the module (it
> just hangs
> on my machine).
> 
> Rob
> 
> 
> use strict;
> use warnings;
> 
> use LWP::Simple;
> use Email::Address;
> 
> my $data = get
> 'http://search.cpan.org/~rjbs/Email-Address-1.884/lib/Email/Address.pm';
> $data =~ s/\s+/ /g;
> 
> my @addrs = Email::Address->parse($data);
> 
> print $_->address, "\n" foreach @addrs;
> 
> 

Oh, and that little snippet of code did work for me.

Mathew

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Email::Address Segmentation Fault

2006-12-06 Thread Mathew Snyder
Rob Dixon wrote:
> Mathew Snyder wrote:
>> Mathew Snyder wrote:
>>> I can't seem to get this working.  Every time I try to run it
>>> segfaults on me.
>>> I've removed it from my code and reverted to the stage I was at
>>> before I added
>>> it and my script worked exactly as it did before I put it in.  I've
>>> installed it
>>> via both cpan and yum.  I've tried running it on a SuSE box and two
>>> Fedora Core
>>> 5 boxes.  I get the same result both times.
>>>
>>> Does anyone know if this is a buggy module?  Version is 1.883-1
>>>
>>> Mathew
>>>
>>
>> I looked over the doc for this module.  It looks like the parse() method
>> requires one argument which is a list of email addresses to look for. 
>> The way I
>> have it set up I think I may be passing the source of an entire web
>> page to it.
> 
> OK it seems to dislike newlines in the content it's parsing. Make sure this
> works for you and, if so, you can apply the same fix to your own data.
> In the
> meantime I shall make some time to find the problem in the module (it
> just hangs
> on my machine).
> 
> Rob
> 
> 
> use strict;
> use warnings;
> 
> use LWP::Simple;
> use Email::Address;
> 
> my $data = get
> 'http://search.cpan.org/~rjbs/Email-Address-1.884/lib/Email/Address.pm';
> $data =~ s/\s+/ /g;
> 
> my @addrs = Email::Address->parse($data);
> 
> print $_->address, "\n" foreach @addrs;
> 
> 

This is the meat of what I have.  It looks like it should work exactly as you
have only a bit more explicitly.  All it does is return me to the prompt.  I
know there should be at least 100 emails in the text I'm parsing.  In fact, I've
figured out how to do this with HTML::TokeParser and am getting several hits.  I
just need to figure out how to eliminate things I don't want.

my $agent = WWW::Mechanize->new();
$agent->get('https://rt.ops.servervault.com/');

$agent->submit_form(
form_name => 'login',
fields=> {
'user' => $user,
'pass' => $pass,
}
);

$agent->follow_link(text => "Tickets");

$agent->submit_form(
form_name => 'BuildQuery',
fields=> {
'ValueOfStatus' => $status,
'ValueOfActor'  => $user,
'ValueOfQueue'  => $queue,
},
button=> 'DoSearch'
);

$agent =~ s/\s+/ /g;
my @emails = Email::Address->parse($agent);

foreach my $email (@emails){
print $email;
};


This is an example of the text I'm parsing:
   52549***POSSIBLE SPAM*** Of fight a
implicitopenSecuritymsnyder62[EMAIL PROTECTED]13 hours ago13 hours
ago0


Mathew

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Email::Address Segmentation Fault

2006-12-06 Thread Rob Dixon

Mathew Snyder wrote:

Mathew Snyder wrote:

I can't seem to get this working.  Every time I try to run it segfaults on me.
I've removed it from my code and reverted to the stage I was at before I added
it and my script worked exactly as it did before I put it in.  I've installed it
via both cpan and yum.  I've tried running it on a SuSE box and two Fedora Core
5 boxes.  I get the same result both times.

Does anyone know if this is a buggy module?  Version is 1.883-1

Mathew



I looked over the doc for this module.  It looks like the parse() method
requires one argument which is a list of email addresses to look for.  The way I
have it set up I think I may be passing the source of an entire web page to it.


OK it seems to dislike newlines in the content it's parsing. Make sure this
works for you and, if so, you can apply the same fix to your own data. In the
meantime I shall make some time to find the problem in the module (it just hangs
on my machine).

Rob


use strict;
use warnings;

use LWP::Simple;
use Email::Address;

my $data = get 
'http://search.cpan.org/~rjbs/Email-Address-1.884/lib/Email/Address.pm';

$data =~ s/\s+/ /g;

my @addrs = Email::Address->parse($data);

print $_->address, "\n" foreach @addrs;


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Email::Address Segmentation Fault

2006-12-06 Thread Rob Dixon

Mathew Snyder wrote:
>

I can't seem to get this working.  Every time I try to run it segfaults on me.
I've removed it from my code and reverted to the stage I was at before I added
it and my script worked exactly as it did before I put it in.  I've installed it
via both cpan and yum.  I've tried running it on a SuSE box and two Fedora Core
5 boxes.  I get the same result both times.

Does anyone know if this is a buggy module?  Version is 1.883-1


Mathew Snyder wrote:
>
> my $data = $agent->content();
> my @emails = Email::Address->parse($data);
>
> foreach my $email (@emails){
> print $email;
> };

Hmm. It shouldn't seg fault - it's all written in Perl. There is a version 1.884
but I doubt if that will fix anything. All I can suggest is to try to reduce the
problem. Is it faulting when it parses the HTML or when it prints the results?
Can you simplify the data to a point where the fault goes away?

As a last resort there is a module Regexp::Common::Email::Address which you can
try instead, but what you've got should work fine. Oh, and what Perl version are
you running?

Rob

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Email::Address Segmentation Fault

2006-12-06 Thread Mathew Snyder
Mathew Snyder wrote:
> I can't seem to get this working.  Every time I try to run it segfaults on me.
> I've removed it from my code and reverted to the stage I was at before I added
> it and my script worked exactly as it did before I put it in.  I've installed 
> it
> via both cpan and yum.  I've tried running it on a SuSE box and two Fedora 
> Core
> 5 boxes.  I get the same result both times.
> 
> Does anyone know if this is a buggy module?  Version is 1.883-1
> 
> Mathew
> 

I looked over the doc for this module.  It looks like the parse() method
requires one argument which is a list of email addresses to look for.  The way I
have it set up I think I may be passing the source of an entire web page to it.

Mathew

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Email::Address Segmentation Fault

2006-12-06 Thread Mathew Snyder
I can't seem to get this working.  Every time I try to run it segfaults on me.
I've removed it from my code and reverted to the stage I was at before I added
it and my script worked exactly as it did before I put it in.  I've installed it
via both cpan and yum.  I've tried running it on a SuSE box and two Fedora Core
5 boxes.  I get the same result both times.

Does anyone know if this is a buggy module?  Version is 1.883-1

Mathew

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Segmentation Fault - Perl5.8.5

2005-08-03 Thread Kaushik.Saiprasad
Hi Monks,

I'm currently involved in migrating a huge chunk of code (>45,000 LOC)
from 'perl/5.6.0a' to 'perl/5.8.5'. A significant part of this code is
made up of calls to 'Tk' widgets / GUIs. 

The issue is the following:

This code, which used to work without any problems with 'perl/5.6.0a',
has all of a sudden started giving 'Segmentation Faults'. This happens
ONLY during the GUI invocation stage and that too, only the FIRST time
the GUI is invoked from a particular shell! During the successive calls
from the SAME SHELL, the GUI works fine!

as any of you faced similar problems? Any idea what could be causing
these 'First-Time' failures? Thanks!

Cheers,
Kaushik

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Segmentation fault when installing Perl 5.8.6

2004-12-15 Thread perl_cova
Hi.

This time I asked for a friend of mine for help with my English.

I've been having problems installing DBD::Oracle and finally Tim Bunce advised 
me to install Perl 5.8.6. I try to, but I got a segmentation fault when running 
make.

I tried this by running "sh Configure -de" and also by running "sh Configure" 
and answering all the questions manualy.

The last lines of the make command are the following.

Does anyone have any idea of what might be wrong? :-( I don't think this is 
normal... could this be a problem with the machine (it's an Itanium 64bits 
running Red Hat Advanced Server)

Thanks in advance,

Andre

cc -L/usr/local/lib -o miniperl \
miniperlmain.o opmini.o libperl.a -lnsl -ldl -lm -lcrypt -lutil -lc 
./miniperl -w -Ilib -MExporter -e '' || make minitest
Attempt to free unreferenced scalar: SV 0x600246b0.
./miniperl -Ilib configpm configpm.tmp
sh mv-if-diff configpm.tmp lib/Config.pm
./miniperl -Ilib lib/lib_pm.PL
Attempt to free unreferenced scalar: SV 0x60024910 at lib/lib_pm.PL 
line 1.
Attempt to free unreferenced scalar: SV 0x6002c440 at 
lib/File/Basename.pm line 138.
Attempt to free unreferenced scalar: SV 0x6002c440 at 
lib/File/Basename.pm line 142.
Attempt to free unreferenced scalar: SV 0x600589c0 at lib/warnings.pm 
line 134.
Attempt to free unreferenced scalar: SV 0x6002c470 at 
lib/File/Basename.pm line 143.
Attempt to free unreferenced scalar: SV 0x60032730 at 
lib/Exporter/Heavy.pm line 3.
make: *** [lib/lib.pm] Segmentation fault

-- 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>



Re: Segmentation fault error and its causes

2004-11-16 Thread John
supriya devburman wrote:
some time script gives 'Segmentation fault' error
what does it mean n what is its cause
thnx..
 

I don't see Perl segfault often, but one place I have seen it is when an 
old version of Perl parses an XML file which contains a BOM.  Are you 
parsing XML with an old version of Perl?

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>



Re: Segmentation fault error and its causes

2004-11-16 Thread Chris Devers
On Tue, 16 Nov 2004, supriya devburman wrote:

> some time script gives 'Segmentation fault' error
> what does it mean [and] what is its cause

It's a very bad error, but chances are not your fault.

"Segfaults" are more common with compiled languages like C or C++ than 
interpreted languages like Perl or Python. They basically mean that code 
you're running attempted to access memory it's not allowed to have -- 
memory that belonged to another program, maybe even the operating system 
or important daemons.

In C, errors like this are all too easy to make, but in Perl, the 
language itself attempts to take care of this for you so that you never 
have to think about it. For the most part, it does a pretty good job, so 
if you're seeing this in one of your Perl scripts, chances are high that 
it's a problem with a module you're using, or maybe the language itself.

Of course, any time you're seeking help with a problem, it helps a lot 
to explain what your code does, what the environment is (what operating 
system you're running on, what version of Perl etc), and most of all, 
you need to show a brief snippet of code that demonstrates the problem.


-- 
Chris Devers

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Segmentation fault error and its causes

2004-11-16 Thread supriya devburman


some time script gives 'Segmentation fault' error
what does it mean n what is its cause

thnx..

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Segmentation fault error and its causes

2004-11-16 Thread supriya devburman


some time script gives 'Segmentation fault' error
what does it mean n what is its cause

thnx..

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Segmentation fault - probably Zlib.pm module problem

2003-10-15 Thread Rafal Gala
Hello

I have got a problem with Compress::Zlib module for Perl. When I load 
some other module that uses Compress::Zlib module, for example CPAN, it 
always crashes with "segmentation fault" message. I have already tried 5 
last versions of Compress::Zlib module and there is always the same 
problem.

Zlib compiles correctly, "make test" does not give any errors, it jus 
skips one test ("Encode").

My perl version is 5.6.1 and the system is Debian 3.0r1.

What can be wrong with my perl?

Best regards
Rafal
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Segmentation fault - core dumped

2002-02-19 Thread gross, cedric

> De : Ken Clark [mailto:[EMAIL PROTECTED]]
> Envoyé : mardi 19 février 2002 12:54

> could you be more precise? you could backtrace it, and send 
> that in as a
> bug, if it is one. and what version are you using? what were you doing
> when it failed? is there consistency with the failure?

I'm running perl v5.6.1 built for i386-freebsd
with libwww-perl-5.63
with msql,Mysql 1.2216
with HTML::TreeBuilder 3.11

I'm running this piece of prog as a cron job every 30 mins. Sometimes is
working fine, sometimes it's craching...Don't understand why ...

I try to find out with the core dumped file but it's not human
readable...(for me)
Cedric
> 
> nice vagueness though. i give it a 9.
> 
> k
> 
> On Tue, Feb 19, 2002 at 09:56:34AM +0100, gross, cedric wrote:
> > 
> >Dear all,
> > 
> > 
> > 
> >Sometimes with this piece of prog join I obtain a 
> segmentation fault -
> >core dumped...
> > 
> >Why ? and How I could solve it ?
> > 
> > 
> > 
> > 
> > 
> >Thanks for help
> 
> 

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Segmentation fault - core dumped

2002-02-19 Thread gross, cedric



Dear 
all,
 
Sometimes with this 
piece of prog join I obtain a segmentation fault - core 
dumped...
Why ? and How I 
could solve it ?
 
 
Thanks for 
help


meta_extract.pl
Description: meta_extract.pl

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


system specific - Perl resource kit -segmentation fault

2001-07-26 Thread Giridhar nandikotkur

Hi Anyone

I have a red hat 6.2 PII system.
i tried to install perl resource kit cdrom 1997 on my
machine which has 5.--4 and 5.--45 on it. I get a
segmentation fault during installation. My machine has
5.005 version of perl. Any suggestions as to where I
can find documentation on this issue?
I have 56 modem. so downloading from CPAN is not
working fine.


__
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]