[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #62030] 'Malformed xchar' error, if fork'ed child throws

From: Stephan Rudlof
Subject: [bug #62030] 'Malformed xchar' error, if fork'ed child throws
Date: Fri, 11 Feb 2022 21:06:53 -0500 (EST)

Follow-up Comment #5, bug #62030 (project gforth):

[comment #3 comment #3:]
> The way to do this in the current Gforth development version is by:
> require unix/libc.fs
> : test fork() if ( ... )
>   else [: ( ... ) ;] catch ?dup-if  DoError 1  else  0  then
>       exit()
>   then ;

Thanks for the info!

What about '(bye)' instead of exit()? At least there is one in v0.7.3. Not

> fork() and exit() as C functions have deliberately () so they don't conflict
with Forth words with the same name.

This looks like a good convention: good to have a clear separation of external
func call from other forth words (calling them with error handling).

> You are supposed to catch whatever you do in the forked version, as
otherwise, it will return to the QUIT loop.  Closing stdin as a workaround
used to work, but it doesn't look right.

Closing stdin has been first idea to stop interpreting, if something nasty
happens (and 'bye' not reached); and it has worked for v0.7.3.

I've looked into the devel version, due to another error (resize with size 0),
which is fixed in current version (before I've seen, that there is a non-zero
errno after gforth start, but this was not the problem), and also tried my
fork experiments...

Current version seems to have some distance to the official one v0.7.3: are
there any plans to make a new release?

Best regards and special thanks for your fast reaction,


Reply to this item at:


  Message sent via Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]