Hi Haihao, On 4/27/2011 12:27 AM, haihao shen wrote:
Hi, I used CSmith to generate random code. However, some programs will hang with the command "./a.out" (The attachment is an example.) while others will correctly print the checksum. I am not sure whether there is some other configures to let the program print the checksum correctly each time.
Unfortunately, no. We feel that it could limit the expressiveness of our generator if we made all randomly generated programs terminate. It's easy to deal with the termination problem. You could set up timeout when you are running any executable. For instance, you might want to use this tool:
http://www.gnu.org/software/coreutils/manual/html_node/timeout-invocation.htmlOur test driver scripts/compiler_test.pl shows how to use timeout to stop execution.
- Yang
Or, could you tell me how I could generate those kind of programs? Thanks for your help! Best, Haihao