This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

fairly repeatable fork(?) errors in (contrived) test script


All:

I'm using the 9/19 snapshot. The sleep in the below test script seems to
be required, otherwise the script could be simplified and still
cause errors.

The test script works (always?) without errors on 1.3.20.

Here are a couple of test runs:

  ~ $ /tmp/test
  x: 1
  x: 2
  x: 3
  x: 4
  x: 5
  x: 6
  x: 7
  x: 8
  x: 9
      896 [main] bash 6544 fork_parent: child 6680 died waiting for longjmp before initialization
  /tmp/test: fork: No such file or directory

  all done
  ~ $ /tmp/test
  x: 1
  x: 2
  x: 3
  x: 4
  x: 5
  x: 6
  x: 7
  x: 8
  x: 9
  /tmp/test: fork: No such file or directory
      812 [main] bash 7028 fork_parent: child 3576 died waiting for longjmp before initialization
  /tmp/test: fork: Bad file descriptor

  all done

--
With a real (ie useful) script (that also involved a sleep) I was able to
get similar(?) errors after running only 5 instances of that
script in parallel.


"do nothing" test script:
--v-v------------------C-U-T---H-E-R-E-------------------------v-v-- 
#!/bin/bash

bar()
{

  foo=$(
    echo $(
      perl -pe '1;' /etc/passwd|
      tee /dev/null|
      (sleep 7;tr '[A-Z]' '[a-z]') |
      tail -1
    )
  )

  echo foo: $foo >/dev/null

}


for x in 1 2 3 4 5 6 7 8 9
do
  echo x: $x
  bar &
done

wait
echo
echo all done





--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]