Return-Path: william@bourbon.usc.edu Delivery-Date: Mon Nov 24 21:16:41 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAP5GekJ006967 for ; Mon, 24 Nov 2008 21:16:40 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mAP5FCTT000565 for ; Mon, 24 Nov 2008 21:15:12 -0800 Message-Id: <200811250515.mAP5FCTT000565@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Select from stdin Date: Mon, 24 Nov 2008 21:15:12 -0800 From: Bill Cheng Someone wrote: > To read the commands from the user we are using select as follows: > > select(1,&readfds, NULL,NULL,NULL); > > This never gave us any problems earlier. Even now it works perfectly for all > the commands except for a "search keywords " command. In this case, it does > what "search keywords" asks it to do and then from there, it is not able to > detect ANY commands. Sounds like a bug somewhere. > We did a printf before the select and determined that it is blocking on > select() and not detecting any sort of input commands after that "search > keywords" operation is done. We have been trying to debug this for quite > some time and are unable to come up with any solution. Could you please help > us regarding this ? Any hints or ideas on what could be causing this problem > ? If "search keywords" is the only command that breaks things, my guess is that it's the usual memory corruption bug and somehow it affects you reading from stdin. I don't have any great idea in how to find the bug. Sorry. -- Bill Cheng // bill.cheng@usc.edu