tcl/expect

Can someone identify what is the problem here?.

no children
while executing
"exp_wait -nowait -i -1"
(procedure "logOptions" line 45)
invoked from within
"logOptions"
(procedure "doExecute" line 98)
invoked from within
"doExecute"
(procedure "main" line 32)
invoked from within
"main $argc $argv"

It's kinda hard to identify without seeing the whole script. What actions have you done prior to the error, how does the error appears, what is the command line invoked, what is the OS in question ?

Little background:

This is a expect-tk script which we have it on a Sun-sparc WS. The script was working fine before we upgraded the machine from solaris 9.0 to solaris 10.0. Now the script does not execute properly, as seen in the error message it does not identify the child process and above procedures fail

    (procedure "logOptions" line 45)
invoked from within
    (procedure "doExecute" line 98)
      (procedure "main" line 32)
   "main $argc $argv"

When I try to execute "exp_wait -nowait -i -1" through catch it seems to be working fine.

If you need any other information please let me know.

Tcl version btwn 9 & 10? Are you using an expect binary or loading as a package?
The error message is pretty benevolent in theory. It's the same call as:

waitpid(-1,&status,WNOHANG);

If the child hasn't exited by the time you check for exit then this is the
message you will get. There is also the possibilty that you are simply calling
exec instead of fork and exec in which case behavior is random after the first
wait iirc.

Have you considered asynchronously handling SIGCHLD via trap as an experiment?

Tcl version btwn 9 & 10? -- No the solaris version 9 and 10.
Are you using an expect binary or loading as a package? -- it is a binary. (expect1.1)
Have you considered asynchronously handling SIGCHLD via trap as an experiment? -- how do I do that?.

Yes, sorry. I meant what are the expect revisions between sol9 and sol10? Are they identical? More importantly are the tcl/tk installations of the same version between
solaris 9 and 10?

If using a mismatched expect binary with different versions of tcl/tk installed behaviors like this are common. OTOH, it could be a bug in the newer version of expect.

As for how to async handle signals you just install a handler.

proc waitonchld {} {
     set ret [exp_wait -nowait -i -1]
     puts "Handled child exit $ret"
}
trap -code waitonchld {SIGCHLD}

Would it right anything?. I mean a "0" or "1"?. Sorry just want to know beforehand what to expect.

if you are referring to whether using a newer version of tcl's core libraries with an older expect binary that is dynamically linked ( or vice versa ) would break anything the obvious answer is "Yes."

Otherwise the trap code is more robust than calling wait with wnohang and hoping the child exits in time to for it to be reaped. That's a race you'll lose some part of the time.