Skip to content

killing subprocess ==> reproducible core dump (fwd) #130

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

Closed
p5pRT opened this issue Jun 30, 1999 · 2 comments
Closed

killing subprocess ==> reproducible core dump (fwd) #130

p5pRT opened this issue Jun 30, 1999 · 2 comments

Comments

@p5pRT
Copy link

p5pRT commented Jun 30, 1999

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

Searchable as RT935$

@p5pRT
Copy link
Author

p5pRT commented Jun 30, 1999

From [email protected]

mips-sgi-irix6.2, perl 5.004_04.

The attached program will make perl dump core on Irix 6.2.
On Linux 2.0.36, it causes perl to exit with "out of memory" instead.

What I am trying to do is, run a subprocess, and if it doesn't complete
in a few seconds, kill it and move on.

In this example, the part of the non-terminating sub-process will be
played by ""perl -e '1 while 1;'" in order to make it nice and
self-contained. (In my actual program, the sub-process in question is
"giftopnm", which sometimes gets stuck in a loop when fed bad data.)

The call to "kill" apparently does nothing.

If you un-comment the call to waitpid, perl doesn't die -- but waitpid
never returns, because the pid hasn't actually died.

It dumps core the second time through the loop, as soon as it tries to
launch the second sub-process.

Any suggestions on how I can do what I'm trying to do?

Second question -- it seems that you can't use "use diagnostics" in
programs that use `eval' to do timeouts. It always says

  Uncaught exception from user code​:
  Uncaught exception from user code​:
  alarm
  main​::__ANON__('ALRM') called at /tmp/a.pl line 27
  eval {...} called at /tmp/a.pl line 18
  main​::foo() called at /tmp/a.pl line 54
  ...propagated at /tmp/a.pl line 35.
  main​::foo() called at /tmp/a.pl line 54

when, in fact, I *am* catching that exception (at least in the sense of,
the program does what I expect w.r.t. timeouts when I don't use
diagnostics.) Is there any way to get diagnostics and use alarms at the
same time?

--
Jamie Zawinski jwz@​jwz.org http​://www.jwz.org/

@p5pRT
Copy link
Author

p5pRT commented Jun 30, 1999

From [email protected]

dumper.pl

@p5pRT p5pRT closed this as completed Nov 28, 2003
jkeenan pushed a commit that referenced this issue Aug 15, 2024
1.65 -- 2024-08-06
	[BUGFIXES]
	 * Update exotic names test to avoid single quote package separator
	   (GH #128)
	 * Don't loop forever in uniqnum.t (GH #130)
rawleyfowler pushed a commit to rawleyfowler/perl5 that referenced this issue Sep 2, 2024
1.65 -- 2024-08-06
	[BUGFIXES]
	 * Update exotic names test to avoid single quote package separator
	   (GH Perl#128)
	 * Don't loop forever in uniqnum.t (GH Perl#130)
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