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

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

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 p5pRT commented Jun 30, 1999

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

Searchable as RT935$

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Jun 30, 1999

From tchrist@jhereg.perl.com

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 p5pRT commented Jun 30, 1999

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

Successfully merging a pull request may close this issue.

None yet
1 participant