Ethereal-users: Re: [Ethereal-users] Fixes for crashes in tethereal version 9.0.x
On Fri, Jun 21, 2002 at 06:16:45PM +0100, Ian Parker wrote:
> 1. tethereal crash on ctrl-C
>
> Bug in capture_cleanup(int signum _U_) in tethereal.c:
> Call to
>
> longjmp(ld.stopenv, 1);
>
> crashes as ld.stopenv is an invalid address (it does not appear to have
> been initialised)
> I have replaced this by:
>
> ld.go = FALSE;
>
> as described in the comment (0.8.x version included this statement
> rather than the longjmp)
Unfortunately, that won't work on all versions of UNIX, as, at least on
some versions, if you set "ld.go" to FALSE in the signal handler, and
return, the libpcap code will just continue to loop, rather than
returning.
That was why the longjmp was put there.
> I will leave it to the author of the longjmp, to privide the definitive
> fix.
I mentioned that problem in recent mail to Graeme Hewson, who put the
longjmp in.
> 2. tethereal input file option "-r file" always fails with invalid file
> descriptor.
>
> Bug in open_cap_file() in tethereal.c:
> The call:
>
> if (fstat(fd, &cf_stat) < 0) {
>
> Always fails as a file descriptor is being passed when it should be a
> FILE pointer.
No, "fstat()" on UNIX takes a file descriptor as an argument. I doubt
that it takes a "FILE *" as an argument on Windows - especially given
that Ethereal (in "file.c") also does "fstat(fd, &cf_stat)" in code that
makes the file-reading progress bar work, and the file-reading progress
bar *does* appear to work on Windows.
In any case, the current CVS version of "tethereal.c" doesn't do
"stat()" or "fstat()" any more.
> 3. The build snapshot, ethereal-2002-06-18, could not have been build on
> win32, as various files contain unix only code that needs #ifndef WIN32
As of a few hours ago, the CVS tree definitely built on Win32, as I
built it on Win32, so if there was code of that sort, it's not there any
more.