Skip to main content.
home | support | download

Back to List Archive

RE: Spidering on Windows

From: David Norris <kg9ae(at)>
Date: Mon Oct 26 1998 - 20:57:14 GMT
> The stack trace I am interested in shows the exact calling context.
> There are 16 different places where fgets() is called.  The first thing
> I'd need to know is which of those 16 places is the call that fails.

I can't get a useful stack trace when the debugger faults while reading the
stack.  I need to install Softice and set it to the default debugger in VS

Well, when in doubt...  Start hacking the code to pieces.  It is definitely
in the http.c file.  I am almost certain that it is related to the PERL
helper.  I get the message "Bad Command Or File Name" printed to the console
just before the crash.  (Some glitch in the error handling, I presume ;)

Here is the only thing that I can figure:

Some code between line 404 to about 427 of http.c seems to be causing the

I can comment out the below line and the debugger starts behaving.  Mark
seems correct, the stack appears to be trashed by a buffer overflow.

This seems to corrupt the stack and kills my debugger;
http.c line 411:
	fgets(buffer, sizeof(buffer), fp);

The real problem is possibly (or related expressions):
http.c line 404-406:
    command = (char *)emalloc(strlen(spiderdirectory) + strlen(url) +
		strlen(tmpdir) + strlen(commandline) + strlen(spiderprog) + 32);
    sprintf(command, commandline, spiderdirectory, spiderprog, tmpdir,
lgetpid(), url);

I don't think that one could call the PERL helper in this manner on Windows.
Any ideas?  Am I doing something stupid?  What would it take to make this

BTW, I have no major need for the functionality, I am merely interested in
seeing it work.  So, I am in no hurry to fix it.  I am sure that I would
make some use it if it worked, though.

,David Norris

World Wide Web -
Illusionary Web - <-- 02:00 - 10:00 GMT
Video/Audio Phone -
Page via mail -
ICQ Universal Internet Number - 412039
E-Mail -
Received on Mon Oct 26 13:07:54 1998