-
Notifications
You must be signed in to change notification settings - Fork 560
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
perl segmentation fault report #788
Comments
From lvirden@cas.org----------------------------------------------------------------- $ gdb $(whence perl) core The script in question is: #!/usr/bin/perl ################################################################################# ############################################################## my $Parser = "yahoo"; ParseParams (); chdir ( $ConfigPath ); LoadConfig (); if ( $FlipReg == 1 ) # pause (); if ( ! -d $DestDir ) pause (); if ( $#URLs == -1 ) pause (); if ( $TheaterList ne "" ) if ( # # my $nURL = 0; my %hDates = (); print "\n\n"; foreach my $URL ( @URLs ) { # print "Grabbing URL if ( $Parser eq "yahoo" ) { # # # # # # if ( $FlipReg ) # print "\n\nScript Complete.\n\n"; ##################### exit 1; foreach my $line ( <CONFIG> ) chomp $line; ( my $key, my $value ) = split ( /\s+/, $line, 2 ); SWITCH: { close ( CONFIG ); # sub grabpage { # my $response = $ua->request ( $request ); sub WritePDBHeader print "Writing pdb $DBName with $nRecords records.\n"; my $attributes = 0x8000; my $now = time (); my $creationdate = $now; sub WriteDatePDB # Write out the headers syswrite ( PDB, pack ( "N", $nOffset ), 4 ); # Offset syswrite ( PDB, pack ( "xxx" ), 3 ); # Unique ID, leave zero $nOffset += GetDateSize ( $date ); # Pad two bytes # Write out the data sub GetDateSize my $size = 4; # one int return $size; sub WriteTheaterPDB # Write out the headers syswrite ( PDB, pack ( "N", $nOffset ), 4 ); # Offset syswrite ( PDB, pack ( "xxx" ), 3 ); # Unique ID, leave zero $nOffset += GetTheaterSize ( $theater ); # Pad two bytes # Write out the data # Write the info sub GetTheaterSize my $size = 4; # Two strings, two nulls, one offset return $size; sub WriteMoviePDB syswrite ( PDB, pack ( "N", $nOffset ), 4 ); # Offset syswrite ( PDB, pack ( "xxx" ), 3 ); # Unique ID, leave zero $nOffset += GetMovieSize ( $movie ); # Pad two bytes # Write out the data # Write the rating, if it exists sub GetMovieSize my $size = 7; # Three strings, three nulls, two offsets return $size; sub WriteShowtimePDB syswrite ( PDB, pack ( "xxx" ), 3 ); # Unique ID, leave zero $nOffset += GetShowtimeSize ( $showtime ); # Pad two bytes # Write out the data sub GetShowtimeSize my $size = 8; # four shorts return $size; sub WriteStringPDB syswrite ( PDB, pack ( "xxx" ), 3 ); # Unique ID, leave zero $nOffset += GetStringSize ( $string ); # Pad two bytes # Write out the data sub GetStringSize my $size = 1; # one string, one null return $size; sub syswritestr sub errormsg sub printmsg print "$_[0]\n"; sub pause sub ucwords sub AlloCineParse # Translate linefeeds # Remove blank lines $daynum++; my $mode = ""; if ( $mode eq "SALLES" ) #translate next if ( IgnoringTheater ( $theatername )); my $theaterinfo = sprintf ( "%s, %s, %s", $address, $zip, $city ); $hTheaters{ $TID }{ "Name" } = $theatername; next if ( !exists ( $hTheaters{ $TID })); my %daytimes = (); my $lastcnk = "time"; @incdays = $cnk; $lastcnk = "dow"; push @times, $cnk; $lastcnk = "time"; filltimes ( \%daytimes, \@incdays, \@excdays, \@times ); foreach my $day ( keys %daytimes ) #translate # Make sure there is showtime data for this movie $hMovies{ $MID }{ "Name" } = $moviename; last; #### auYahooParse contributed by Duncan Sargeant # " (to balance my colouriser :-) sub auYahooParse my ($content, $URL) = @_; # Figure out day offsets # $content is the list of cinemas in the selected area. foreach (@theaters) { print " Getting theater $theatername...\n"; my $foundtoday = 0; $foundtoday = 1 if ( $days { $day } == $DOW ); print " Getting day $day...\n"; $content = grabpage ("$URL/$dir/$day.html"); # I think is has been fixed -jrray my $time = timegm ( 0, 0, 0, $date, $month, $year ); # If we are running on a Mac, we need to fudge the time and my $DID = -1; $content =~ />([^>][^>][^>]+)\n/s; my $TID = -1; my @movies = split (/<li>/i, $content); my ($moviename, $showtimes) = split (/ - /, $movie); my $MID = -1; # Check that this ID combo hasn't been stored already # sub YahooParse my $content = $_[0]; # # Translate metaspaces into newlines $time = timegm ( 0, 0, 0, $day, $month, $year ); # If we are running on a Mac, we need to fudge the time and my $DID = -1; if ( IgnoringTheater ( $theatername )) my $TID = -1; $hTheaters{ $TID }{ "Name" } = $theatername; #querymovie ( $moviename ); # Check that this ID combo hasn't been stored already # Lop of extra garbage at the end # Remove the trailing linefeed my $SID = -1; sub ScootParse #### GARETH'S SCOOT CODE STARTS HERE ### my %months = ( 'January' => 0, # If we are running on a Mac, we need to fudge the time and $DID = -1; if ($line =~ /r=CINOC[^>]*>(.*?)<\//) { # If this theater is in our kill file, ignore it -- jrray $tline=1; ##################### # Get rid of those pesky ,;'s # # Check that this ID combo hasn't been stored already sub IgnoringTheater if ( exists $TheaterIgnore{ $theatername }) return 0; sub printspaces sub querymovie $title =~ s/\ /\+/g; my $URL = "http://us.imdb.com/Tfuzzy?title=" . $title . "&type=fuzzy&sort=chrono&tv=off"; #my $URL = "http://us.imdb.com/Plot?" . $title; print $URL . "\n"; #my $request = new HTTP::Request ( 'GET', $URL ); sub filltimes if ( $#{$_[3]} >= 0 ) if ( exists ( ${_[0]}{ $day })) my @times = split ( /,\s*/, ${$_[0]}{ $day }); sub ParseParams sub PrintUsage pause (); Perl Info
|
From [Unknown Contact. See original ticket]I recompiled perl with -g and here is the stack trace I am getting. program terminated by signal SEGV (no mapping at the fault address) |
From [Unknown Contact. See original ticket]Larry W. Virden writes:
Edit "cflags" file. I have #optdebug='' # ensure -g used if building a -DDEBUGGING libperl
Well, having something less than 1500+ lines long script would be Ilya |
From [Unknown Contact. See original ticket]Larry W. Virden writes:
And may I ask what is the reason for segfault? What is the contents #define CHR_SVLEN(sv) (UTF ? sv_len_utf8(sv) : SvCUR(sv)) and I suspect you do not use utf8, right?
Hey, I have seen this string (rendered ;-) yesterday! How did you Ilya |
From [Unknown Contact. See original ticket]From: Ilya Zakharevich <ilya@math.ohio-state.edu> Larry W. Virden writes: Current function is Perl_re_intuit_start dbx: see `help scope' for details Unfortunately, I'm not familiar enough with Perl's internals to -- |
From [Unknown Contact. See original ticket]On Tue, Oct 26, 1999 at 02:35:01PM -0400, Larry W. Virden wrote:
Well, it is not rocket science to resolve macros (at least if you run #define check_substr substrs->data[2].substr
Well, I think you know it already. *((GV*)sv)->sv_any is the simplest Ilya |
From [Unknown Contact. See original ticket]From: Ilya Zakharevich <ilya@math.ohio-state.edu> Well, I think you know it already. *((GV*)sv)->sv_any is the print *((GV*)sv)->sv_any -- |
From [Unknown Contact. See original ticket]Larry W. Virden writes:
This is all pretty nice, but I want to know why *segfault* happens. Ilya |
From [Unknown Contact. See original ticket]Larry W. Virden writes:
This is a plug only. It fixes a bug, but uncovers yet another Enjoy, Inline Patch--- ./t/op/pat.t~ Tue Oct 5 23:20:31 1999
+++ ./t/op/pat.t Mon Nov 1 18:08:47 1999
@@ -4,7 +4,7 @@
# the format supported by op/regexp.t. If you want to add a test
# that does fit that format, add it to op/re_tests, not here.
-print "1..193\n";
+print "1..194\n";
BEGIN {
chdir 't' if -d 't';
@@ -891,5 +891,10 @@ $test++;
$text = "aaXbXcc";
pos($text)=0;
$text =~ /\GXb*X/g and print 'not ';
+print "ok $test\n";
+$test++;
+
+$text = "xA\n" x 500;
+$text =~ /^\s*A/m and print 'not ';
print "ok $test\n";
$test++;
--- ./regexec.c~ Sun Oct 10 15:25:52 1999
+++ ./regexec.c Mon Nov 1 18:02:03 1999
@@ -642,6 +642,9 @@ Perl_re_intuit_start(pTHX_ regexp *prog,
prog->check_substr = Nullsv; /* disable */
prog->float_substr = Nullsv; /* clear */
s = strpos;
+ /* XXXX This is a remnant of the old implementation. It
+ looks wasteful, since now INTUIT can use many
+ other heuristics too. */
prog->reganch &= ~RE_USE_INTUIT;
}
else
@@ -804,9 +807,13 @@ Perl_regexec_flags(pTHX_ register regexp
after_try:
if (s >= end)
goto phooey;
- s = re_intuit_start(prog, sv, s + 1, strend, flags, NULL);
- if (!s)
- goto phooey;
+ if (prog->reganch & RE_USE_INTUIT) {
+ s = re_intuit_start(prog, sv, s + 1, strend, flags, NULL);
+ if (!s)
+ goto phooey;
+ }
+ else
+ s++;
}
} else {
if (s > startpos) |
From [Unknown Contact. See original ticket]Thank you for the patch. Unfortunately, after applying that patch and pragma/warnings.....PROG: |
From [Unknown Contact. See original ticket]On Tue, Nov 02, 1999 at 06:47:57AM -0500, Larry W. Virden wrote:
Was not that seen before? I do not get this warning. Are you running Ilya |
From [Unknown Contact. See original ticket]Re: was the error seen before? No, this is the first time I have seen this error. Re: am I running with PERL_DESTRUCT_LEVEL > 3? I have no such environment variable set - does the make test set -- |
From [Unknown Contact. See original ticket]On Tue, Nov 02, 1999 at 03:37:24PM -0500, Larry W. Virden wrote:
On p5p?
It is set to 2 if not defined. The additional message "Scalars Ilya |
From [Unknown Contact. See original ticket]On Nov 2, 17:16, Ilya Zakharevich wrote: I've never seen this error in person or on p5p <smile>... --> > Re: am I running with PERL_DESTRUCT_LEVEL > 3? Interesting... -- |
From [Unknown Contact. See original ticket]I'm continuing to see this segmentation fault. The last suggestion from |
From @andk
Ilya said, that what you saw could typically only be seen with -- |
From [Unknown Contact. See original ticket]Andreas J. Koenig writes:
Nope. The whole running program is usable. "Scalar leaked:" message Ilya |
From @gsarOn Thu, 18 Nov 1999 11:04:25 EST, "Larry W. Virden" wrote:
The test harness enables PERL_DESTRUCT_LEVEL for all tests not Sarathy |
From [Unknown Contact. See original ticket]Gurusamy Sarathy writes:
Nope. The test in question *already has* "we have a known leak" clause. Ilya |
From @gsarOn Thu, 18 Nov 1999 14:13:36 EST, Ilya Zakharevich wrote:
Is the "we have a known leak" clause in a BEGIN block? That would Sarathy |
From [Unknown Contact. See original ticket]On Thu, Nov 18, 1999 at 11:33:33AM -0800, Gurusamy Sarathy wrote:
IIRC it was a the misc test failing during compilation indeed. But Ilya |
Migrated from rt.perl.org#1715 (status was 'resolved')
Searchable as RT1715$
The text was updated successfully, but these errors were encountered: