Vanilla List Maling List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [VANILLA-LIST:2048] Vanilla-2.9pl2 Released
On Sun, 7 Mar 1999, Mikael Sandstr|m wrote:
> Program received signal SIGSEGV, Segmentation fault.
> 0xef5e5de8 in fgets ()
> (gdb) bt
> #0 0xef5e5de8 in fgets ()
> #1 0x2471c in CheckBypass (login=0x6cb1c "d1tim",
> host=0xefffee3a "leemor.dtek.chalmers.se",
> file=0x6e420 "/users/dtek/and/netrek/INL_Robotpl2/bin/.bypass")
> at main.c:606
> #2 0x236c0 in main (argc=1, argv=0xefffec38) at main.c:279
Ok no help so far, so I tried a little on my own ...
CheckBypass takes 3 arguments ...
(gdb) p line_buf
$1 = "*@meson.cse.msu.edu\000\000\000\000\000\000\000\000\001", '\000'
<repeats 15 times>,
"\004\000\006£p\000\000\000\001\000\000\000\002\000\006ô\000\000\000$",
'\000' <repeats 12 times>, "\001", '\000' <repeats 23 times>,
"\001\000\006è\000\000\000\000\002\000\001\000\000\000\000\000\000\000\000\000
ïÿê\200\000\001Ä4\000\000\000\000\000\006£p\000\006§0\000\000\000\004",
'\000' <repeats 15 times>
Seems ok ....
(gdb) p bypassfile
$2 = (FILE *) 0x60068
(gdb) p *bypassfile
Cannot access memory at address 0x60068.
This is not good!
(gdb) p errno
$3 = 4
manpages gives EINTR, fopen gives 'A signal was caught during fopen().'
So it seems like fopen don't give NULL when this happens, I will try the
following code, compare it with the old one if you want to see whats
changed. If this error happens I will get it in the ERROR file too.
extern int errno;
int CheckBypass(login, host, file)
char *login, *host, *file;
{
FILE *bypassfile;
char log_buf[64], host_buf[64], line_buf[160];
char *position;
int num1;
int Hits=0;
errno = 0;
if ((bypassfile = fopen(file, "r")) == NULL || errno != 0) {
ERROR(1,( "No bypass file %s, errno %d\n", file, errno));
fflush(stderr);
return(FALSE);
}
Any other suggestions ? or am I totaly wrong ?
/Mikael