This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Tentative fix for RT#125350 - AFL detected crash.
[perl5.git]
/
Porting
/
findrfuncs
diff --git
a/Porting/findrfuncs
b/Porting/findrfuncs
old mode 100644
(file)
new mode 100755
(executable)
index
ea019c9
..
c9a7ff8
--- a/
Porting/findrfuncs
+++ b/
Porting/findrfuncs
@@
-1,11
+1,14
@@
-#!/usr/bin/perl -w
+#!/usr/bin/perl -w
s
#
# findrfuncs: find reentrant variants of functions used in an executable.
#
# findrfuncs: find reentrant variants of functions used in an executable.
+#
# Requires a functional "nm -u". Searches headers in /usr/include
# to find available *_r functions and looks for non-reentrant
# variants used in the supplied executable.
#
# Requires a functional "nm -u". Searches headers in /usr/include
# to find available *_r functions and looks for non-reentrant
# variants used in the supplied executable.
#
+# Requires debug info in the shared libraries/executables.
+#
# Gurusamy Sarathy
# gsar@ActiveState.com
#
# Gurusamy Sarathy
# gsar@ActiveState.com
#
@@
-49,8
+52,6
@@
find(sub {
open F, "<$File::Find::name"
or die "Can't open $File::Find::name: $!";
my $line;
open F, "<$File::Find::name"
or die "Can't open $File::Find::name: $!";
my $line;
- # None of the <netdb.h> _r prototypes are to be used in Tru64.
- return if $^O eq 'dec_osf' && $_ eq 'netdb.h';
while (defined ($line = <F>)) {
if ($line =~ /\b(\w+_r)\b/) {
#warn "$1 => $File::Find::name\n";
while (defined ($line = <F>)) {
if ($line =~ /\b(\w+_r)\b/) {
#warn "$1 => $File::Find::name\n";
@@
-64,25
+65,56
@@
find(sub {
delete $rfuncs{setlocale_r} if $^O eq 'linux';
# delete obsolete (as promised by man pages) symbols
delete $rfuncs{setlocale_r} if $^O eq 'linux';
# delete obsolete (as promised by man pages) symbols
+my $netdb_r_obsolete;
if ($^O eq 'hpux') {
delete $rfuncs{crypt_r};
if ($^O eq 'hpux') {
delete $rfuncs{crypt_r};
+ delete $rfuncs{drand48_r};
+ delete $rfuncs{endgrent_r};
+ delete $rfuncs{endpwent_r};
+ delete $rfuncs{getgrent_r};
+ delete $rfuncs{getpwent_r};
delete $rfuncs{setlocale_r};
delete $rfuncs{setlocale_r};
+ delete $rfuncs{srand48_r};
delete $rfuncs{strerror_r};
delete $rfuncs{strerror_r};
+ $netdb_r_obsolete = 1;
} elsif ($^O eq 'dec_osf') {
delete $rfuncs{crypt_r};
delete $rfuncs{strerror_r};
} elsif ($^O eq 'dec_osf') {
delete $rfuncs{crypt_r};
delete $rfuncs{strerror_r};
+ $netdb_r_obsolete = 1;
+}
+if ($netdb_r_obsolete) {
+ delete @rfuncs{qw(endhostent_r
+ endnetent_r
+ endprotoent_r
+ endservent_r
+ gethostbyaddr_r
+ gethostbyname_r
+ gethostent_r
+ getnetbyaddr_r
+ getnetbyname_r
+ getnetent_r
+ getprotobyname_r
+ getprotobynumber_r
+ getprotoent_r
+ getservbyname_r
+ getservbyport_r
+ getservent_r
+ sethostent_r
+ setnetent_r
+ setprotoent_r
+ setservent_r)};
}
my %syms;
for my $exe (@EXES) {
# warn "#--- $exe\n";
}
my %syms;
for my $exe (@EXES) {
# warn "#--- $exe\n";
- for my $sym (`$NMU $exe`) {
+ for my $sym (`$NMU $exe
2>/dev/null
`) {
chomp $sym;
$sym =~ s/^\s+//;
$sym =~ s/^([0-9A-Fa-f]+\s+)?[Uu]\s+//;
$sym =~ s/\s+[Uu]\s+-$//;
chomp $sym;
$sym =~ s/^\s+//;
$sym =~ s/^([0-9A-Fa-f]+\s+)?[Uu]\s+//;
$sym =~ s/\s+[Uu]\s+-$//;
- next if /\s/;
+ next if
$sym =~
/\s/;
$sym =~ s/\@.*\z//; # remove @@GLIBC_2.0 etc
# warn "#### $sym\n";
if (exists $rfuncs{"${sym}_r"} && ! $syms{"$sym:$exe"}++) {
$sym =~ s/\@.*\z//; # remove @@GLIBC_2.0 etc
# warn "#### $sym\n";
if (exists $rfuncs{"${sym}_r"} && ! $syms{"$sym:$exe"}++) {
@@
-99,4
+131,3
@@
for my $exe (@EXES) {
}
@syms = ();
}
}
@syms = ();
}
-