Skip to content
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

Problem with Sys::Hostname. #88

Closed
p5pRT opened this issue Jun 20, 1999 · 8 comments
Closed

Problem with Sys::Hostname. #88

p5pRT opened this issue Jun 20, 1999 · 8 comments

Comments

@p5pRT
Copy link

p5pRT commented Jun 20, 1999

Migrated from rt.perl.org#892 (status was 'resolved')

Searchable as RT892$

@p5pRT
Copy link
Author

p5pRT commented Jun 20, 1999

From @muir

Created by @muir

David,

Do you still maintain Sys​::Hostname? If so, I would like to bring
a problem to your attention.

On FreeBSD, the following hangs forever with an infinate loop in sh.

  perl -MSys​::Hostname -e '$SIG{"CHLD"} = "IGNORE"; hostname();'

The fix is pretty simple​: make $SIG{CHLD} local.

retrieving revision 1.1.1.1
diff -c -r1.1.1.1 Hostname.pm
*** Hostname.pm 1998/09/09 06​:59​:55 1.1.1.1
--- Hostname.pm 1999/06/20 22​:59​:51
***************
*** 94,99 ****
--- 94,100 ----
  # method 3 - trusty old hostname command
  || eval {
  local $SIG{__DIE__};
+ local $SIG{CHLD};
  $host = `(hostname) 2>/dev/null`; # bsdish
  }
 

This is a bug report for perl from muir@​idiom.com,
generated with the help of perlbug 1.26 running under perl 5.00502.

Perl Info


Site configuration information for perl 5.00502:

Configured by markm at $Date: 1999/01/17 09:53:34 $.

Summary of my perl5 (5.0 patchlevel 5 subversion 2) configuration:
  Platform:
    osname=freebsd, osvers=3.0-current, archname=i386-freebsd
    uname='freebsd 3.0-current #0: '
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef useperlio=undef d_sfio=undef
  Compiler:
    cc='cc', optimize='undef', gccversion=2.7.2.1
    cppflags=''
    ccflags =''
    stdchar='char', d_stdstdio=undef, usevfork=true
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='ld', ldflags ='-Wl,-E '
    libpth=/usr/lib
    libs=-lm -lc -lcrypt
    libc=undef, so=so, useshrplib=true, libperl=libperl.so.3
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-DPIC -fpic', lddlflags='-shared '

Locally applied patches:
    


@INC for perl 5.00502:
    /usr/libdata/perl/5.00502/mach
    /usr/libdata/perl/5.00502
    /usr/local/lib/perl5/site_perl/5.005/i386-freebsd
    /usr/local/lib/perl5/site_perl/5.005
    .


Environment for perl 5.00502:
    HOME=/home/muir
    LANG (unset)
    LD_LIBRARY_PATH=.:/usr/lib:/usr/local/lib
    LOGDIR (unset)
    PATH=.:/home/muir/bin/idiom:/home/muir/bin:/home/muir/bin/share:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/shbin:/usr/local/sbin:/usr/local/bin:/usr/local/ptybin:/usr/X11R6/bin:/usr/bin/X11:/usr/local/tex/bin:/usr/ucb:/usr/bin:/bin:/etc:/usr/etc:/usr/games:/lib:/usr/lib:/usr/local/java/bin:/usr/lib/uucp:/usr/openwin/bin:/usr/openwin/bin/xview:/usr/openwin/demo:/usr/adm:/home/muir/tmp
    PERL_BADLANG (unset)
    SHELL=/bin/tcsh

@p5pRT
Copy link
Author

p5pRT commented Jun 20, 1999

From @muir

Created by @muir

David,

Do you still maintain Sys​::Hostname? If so, I would like to bring
a problem to your attention.

On FreeBSD, the following hangs forever with an infinate loop in sh.

  perl -MSys​::Hostname -e '$SIG{"CHLD"} = "IGNORE"; hostname();'

The fix is pretty simple​: make $SIG{CHLD} local.

retrieving revision 1.1.1.1
diff -c -r1.1.1.1 Hostname.pm
*** Hostname.pm 1998/09/09 06​:59​:55 1.1.1.1
--- Hostname.pm 1999/06/20 22​:59​:51
***************
*** 94,99 ****
--- 94,100 ----
  # method 3 - trusty old hostname command
  || eval {
  local $SIG{__DIE__};
+ local $SIG{CHLD};
  $host = `(hostname) 2>/dev/null`; # bsdish
  }
 

This is a bug report for perl from muir@​idiom.com,
generated with the help of perlbug 1.26 running under perl 5.00502.

Perl Info


Site configuration information for perl 5.00502:

Configured by markm at $Date: 1999/01/17 09:53:34 $.

Summary of my perl5 (5.0 patchlevel 5 subversion 2) configuration:
  Platform:
    osname=freebsd, osvers=3.0-current, archname=i386-freebsd
    uname='freebsd 3.0-current #0: '
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef useperlio=undef d_sfio=undef
  Compiler:
    cc='cc', optimize='undef', gccversion=2.7.2.1
    cppflags=''
    ccflags =''
    stdchar='char', d_stdstdio=undef, usevfork=true
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='ld', ldflags ='-Wl,-E '
    libpth=/usr/lib
    libs=-lm -lc -lcrypt
    libc=undef, so=so, useshrplib=true, libperl=libperl.so.3
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-DPIC -fpic', lddlflags='-shared '

Locally applied patches:
    


@INC for perl 5.00502:
    /usr/libdata/perl/5.00502/mach
    /usr/libdata/perl/5.00502
    /usr/local/lib/perl5/site_perl/5.005/i386-freebsd
    /usr/local/lib/perl5/site_perl/5.005
    .


Environment for perl 5.00502:
    HOME=/home/muir
    LANG (unset)
    LD_LIBRARY_PATH=.:/usr/lib:/usr/local/lib
    LOGDIR (unset)
    PATH=.:/home/muir/bin/idiom:/home/muir/bin:/home/muir/bin/share:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/shbin:/usr/local/sbin:/usr/local/bin:/usr/local/ptybin:/usr/X11R6/bin:/usr/bin/X11:/usr/local/tex/bin:/usr/ucb:/usr/bin:/bin:/etc:/usr/etc:/usr/games:/lib:/usr/lib:/usr/local/java/bin:/usr/lib/uucp:/usr/openwin/bin:/usr/openwin/bin/xview:/usr/openwin/demo:/usr/adm:/home/muir/tmp
    PERL_BADLANG (unset)
    SHELL=/bin/tcsh



1 similar comment
@p5pRT
Copy link
Author

p5pRT commented Jun 20, 1999

From @muir

Created by @muir

David,

Do you still maintain Sys​::Hostname? If so, I would like to bring
a problem to your attention.

On FreeBSD, the following hangs forever with an infinate loop in sh.

  perl -MSys​::Hostname -e '$SIG{"CHLD"} = "IGNORE"; hostname();'

The fix is pretty simple​: make $SIG{CHLD} local.

retrieving revision 1.1.1.1
diff -c -r1.1.1.1 Hostname.pm
*** Hostname.pm 1998/09/09 06​:59​:55 1.1.1.1
--- Hostname.pm 1999/06/20 22​:59​:51
***************
*** 94,99 ****
--- 94,100 ----
  # method 3 - trusty old hostname command
  || eval {
  local $SIG{__DIE__};
+ local $SIG{CHLD};
  $host = `(hostname) 2>/dev/null`; # bsdish
  }
 

This is a bug report for perl from muir@​idiom.com,
generated with the help of perlbug 1.26 running under perl 5.00502.

Perl Info


Site configuration information for perl 5.00502:

Configured by markm at $Date: 1999/01/17 09:53:34 $.

Summary of my perl5 (5.0 patchlevel 5 subversion 2) configuration:
  Platform:
    osname=freebsd, osvers=3.0-current, archname=i386-freebsd
    uname='freebsd 3.0-current #0: '
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef useperlio=undef d_sfio=undef
  Compiler:
    cc='cc', optimize='undef', gccversion=2.7.2.1
    cppflags=''
    ccflags =''
    stdchar='char', d_stdstdio=undef, usevfork=true
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='ld', ldflags ='-Wl,-E '
    libpth=/usr/lib
    libs=-lm -lc -lcrypt
    libc=undef, so=so, useshrplib=true, libperl=libperl.so.3
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-DPIC -fpic', lddlflags='-shared '

Locally applied patches:
    


@INC for perl 5.00502:
    /usr/libdata/perl/5.00502/mach
    /usr/libdata/perl/5.00502
    /usr/local/lib/perl5/site_perl/5.005/i386-freebsd
    /usr/local/lib/perl5/site_perl/5.005
    .


Environment for perl 5.00502:
    HOME=/home/muir
    LANG (unset)
    LD_LIBRARY_PATH=.:/usr/lib:/usr/local/lib
    LOGDIR (unset)
    PATH=.:/home/muir/bin/idiom:/home/muir/bin:/home/muir/bin/share:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/shbin:/usr/local/sbin:/usr/local/bin:/usr/local/ptybin:/usr/X11R6/bin:/usr/bin/X11:/usr/local/tex/bin:/usr/ucb:/usr/bin:/bin:/etc:/usr/etc:/usr/games:/lib:/usr/lib:/usr/local/java/bin:/usr/lib/uucp:/usr/openwin/bin:/usr/openwin/bin/xview:/usr/openwin/demo:/usr/adm:/home/muir/tmp
    PERL_BADLANG (unset)
    SHELL=/bin/tcsh



@p5pRT
Copy link
Author

p5pRT commented Jun 20, 1999

From [Unknown Contact. See original ticket]

Isn't this illustrative of a more general problem of mixing zombies,
sig kids, explicit reapers, and backticks? (And maybe pipe opens).
I don't think we've ever enumerated precisely what is safe to do in a
module with respect to process management to avoid interfering with
Perl internals, the main program, or other modules. A list of "dos
and don'ts", would be great to have, perhaps even something checkable
semi-automatically for CPAN and Core modules.

--tom

@p5pRT
Copy link
Author

p5pRT commented Jun 20, 1999

From @muir

* Isn't this illustrative of a more general problem of mixing zombies,
* sig kids, explicit reapers, and backticks? (And maybe pipe opens).
* I don't think we've ever enumerated precisely what is safe to do in a
* module with respect to process management to avoid interfering with
* Perl internals, the main program, or other modules. A list of "dos
* and don'ts", would be great to have, perhaps even something checkable
* semi-automatically for CPAN and Core modules.

Is that backwards? I would tend to think that the CPAN and Core
modules should insulate themselves from things that other programmers
rather than trying to document gotchas like​:

  Don't change $SIG{CHLD} if you use Sys​::Hostname or anything
  that uses Sys​::Hostname like ...

Much better IMHO to fix Sys​::Hostname so that it always works.

That said, there are things that module writers should not need
to worry about. I was going to say "like changing $[," but that
was fixed by making it file-scoped.

-Dave

@p5pRT
Copy link
Author

p5pRT commented Jun 20, 1999

From [Unknown Contact. See original ticket]

Is that backwards? I would tend to think that the CPAN and Core
modules should insulate themselves from things that other programmers
rather than trying to document gotchas like​:

Don't change $SIG{CHLD} if you use Sys​::Hostname or anything
that uses Sys​::Hostname like ...

Much better IMHO to fix Sys​::Hostname so that it always works.

That's what I meant for us to go look for.

--tom

@p5pRT
Copy link
Author

p5pRT commented Jul 24, 2000

From [Unknown Contact. See original ticket]

fixed in perl 5.6.0

@p5pRT p5pRT closed this as completed Nov 28, 2003
@p5pRT
Copy link
Author

p5pRT commented Nov 28, 2003

From The RT System itself

fixed in perl 5.6.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant