Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Jul 1997 13:25:25 -0700 (PDT)
From:      archie@whistle.com
To:        FreeBSD-gnats-submit@FreeBSD.ORG
Subject:   bin/4163: ftp core dump
Message-ID:  <199707242025.NAA07529@bubba.whistle.com>
Resent-Message-ID: <199707242030.NAA22283@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         4163
>Category:       bin
>Synopsis:       ftp core dumps after hitting control-C
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jul 24 13:30:01 PDT 1997
>Last-Modified:
>Originator:     Archie Cobbs
>Organization:
Whistle Communications, Inc.
>Release:        FreeBSD 2.2-STABLE i386
>Environment:

	FreeBSD 2.2 branch as of approx. July 20, 1997

>Description:

  Did a file transfer, enabling hash marks first. Seemed to finish
  (no more data was being sent and remote had closed the connection)
  but my local side didn't return a prompt. I hit control-C and got
  a core dump:


###########
^C
receive aborted
waiting for remote to finish abort
ftp: abort: Broken pipe
Segmentation fault (core dumped)

Here's why -- variable "cout" is NULL:

  Core was generated by `ftp'.
  Program terminated with signal 11, Segmentation fault.
  #0  0x806d01a in ?? ()
  (gdb) where
  #0  0x806d01a in ?? ()
  #1  0x8080060 in ?? ()
  #2  0x806cbaf in ?? ()
  #3  0x8e58 in abort_remote (din=0x809054c) at ftp.c:1513
  #4  0x7bf0 in recvrequest (cmd=0x2596 "", local=0x16050 "", remote=0x13f2c "", 
      lmode=0x2507 "", printnames=1) at ftp.c:978
  #5  0x2953 in getit (argc=3, argv=0x14430, restartit=0, mode=0x2507 "")
      at cmds.c:686
  #6  0x253b in get (argc=3, argv=0x14430) at cmds.c:579
  #7  0x9608 in cmdscanner (top=1) at main.c:289
  #8  0x934a in main (argc=1, argv=0xefbfd8e4) at main.c:177
  (gdb) up 4
  #4  0x7bf0 in recvrequest (cmd=0x2596 "", local=0x16050 "", remote=0x13f2c "", 
      lmode=0x2507 "", printnames=1) at ftp.c:978
  ftp.c:978: No such file or directory.
  (gdb) down
  #3  0x8e58 in abort_remote (din=0x809054c) at ftp.c:1513
  ftp.c:1513: No such file or directory.
  (gdb) p cout
  $1 = (FILE *) 0x0

Relevant source code snippet from ftp.c:

  1498 void
  1499 abort_remote(din)
  1500         FILE *din;
  1501 {
  1502         char buf[BUFSIZ];
  1503         int nfnd;
  1504         struct fd_set mask;
  1505
  1506         /*
  1507          * send IAC in urgent mode instead of DM because 4.3BSD places o
  ob mark  
  1508          * after urgent byte rather than before as is protocol now
  1509          */
  1510         sprintf(buf, "%c%c%c", IAC, IP, IAC);
  1511         if (send(fileno(cout), buf, 3, MSG_OOB) != 3)
  1512                 warn("abort"); 
  1513         fprintf(cout,"%cABOR\r\n", DM);	<--- core dump here
  1514         (void) fflush(cout);
  1515         FD_ZERO(&mask);
  1516         FD_SET(fileno(cin), &mask);
  1517         if (din) {
  1518                 FD_SET(fileno(din), &mask);
  1519         } 

>How-To-Repeat:

  Do what I described, I guess...

>Fix:

  Dunno.

>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199707242025.NAA07529>