coreutils
[Top][All Lists]
Advanced

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

Re: Invoke a Coreutils routine from another 'main' program


From: Zhoulai
Subject: Re: Invoke a Coreutils routine from another 'main' program
Date: Tue, 21 Jul 2015 13:17:27 -0700

Hi,

Thanks for your reply.  Do you mean that, even if I manage to invoke "echo.main" from an external program, this external program will terminate whenever "echo.main"  gets an error?

Indeed, that would be quite an issue for us. Actually, we are trying to automatically detect possible bugs in CoreUtils with a technique derived from our research work. To this end, we need to be able to stress-test 'echo.main', meaning that, we need to pass a large set of randomly generated inputs that syntactically conforms to the signature of the program under test. The high-level pseudocode is as follows: 

for each i of InputSet
       echo.main(i);
l0:    // do something to store the execution trace  of echo.main
end for
l1:   //analyze and report the bugs

The label l0 and l1 above are artificial. As you see,  if echo.main make the whole pseudocode above terminate, then neither l0 and l1 can be executed. Do you think there is an easy workaround so that when echo.main() terminates with an error, our pseudocode can still be running?

Also, I just skimmed two of your source code, echo.c, and base64.c from CoreUtil8.23, but  do not find the lines that triggers termination of the whole process. Would you show me the relevant code lines ?

Thanks for your help.

Zhoulai
 
However, it's important to remember that coreutils' programs as not designed to be
incorporated into bigger programs. One issue is that all the programs terminate
on any errors - if there was an error in the parameters (or during runtime),
the called function  (e.g. your "echo.main()") will not return to your 'main' with an error code - it will terminate your program.

regards,
 - assaf


reply via email to

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