From: David A. <dav...@gm...> - 2009-07-10 14:29:35
|
All - I have a problem with some code I put in the incubator - hostemu. This is for the most part some old OS/2 Rexx code I have ported to Linux. It is designed to supply a partial implementation of the host EXECIO command to the Linux/ooRexx environment. The code is broken into two source files one of which contains the platform dependent code and a second file which contains the code for the parsing of the EXECIO command. The parsing file is the one with the trouble. The Linux YACC command is used to parse the parsing file and produce a CPP file that is processed by GCC. The main entry point to this file is a routine named yyparse. It takes no arguments and returns an int value which determines if the parse succeeded or not. The code produced by YACC is NOT reentrant. Thus you will find a semaphore surrounding the call to yyparse to prevent multiple threads from calling yyparse at the same time. Now to the problem. The first call to yyparse always succeeds (unless you give it a bad EXECIO command). But a subsequent call to yyparse will cause a hang. I have tried to place a printf as the first statement in yyparse but that never gets called. It is like the stack has been corrupted or something similar. If any of you have any ideas why this is happening I would appreciate hearing from you. Thanks, David Ashley |