-----BEGIN PGP SIGNED MESSAGE-----
I added the following code to log_exit():
void log_exit(int code, const char *file, int line)
{
static int error_count=0;
if(error_count++ > 10) {
abort();
}
To force it to bail earlier instead of overflowing the stack.
As you can see at frame #50, it is trying to log that the connection went
away unexpectantly. I don't know why that might have happened, but clearly
the handling of this error is incorrect. Note that the client terminates
with non-zero error status (I don't know which one, but, I could find out),
which causes our cron job to fail, which is why we noticed this in the first
place.
Script started on Sun Oct 13 01:52:45 2002
freeswan@xs1:~$ uname -a
FreeBSD xs1.xs4all.nl 4.5-RELEASE-p3 FreeBSD 4.5-RELEASE-p3 #0: Fri Apr 19
11:42:45 CEST 2002 cor@xs0.xs4all.nl:/usr/src/sys/compile/XS4ALL-SMP i386
freeswan@xs1:~$ which rsync
/home/f/freeswan/bin/rsync
freeswan@xs1:~$ rsync --version
rsync version 2.5.5 protocol version 26
Copyright (C) 1996-2002 by Andrew Tridgell and others
<http://rsync.samba.org/>
Capabilities: 64-bit files, socketpairs, hard links, symlinks, batchfiles,
IPv6, 32-bit system inums, 64-bit internal inums
rsync comes with ABSOLUTELY NO WARRANTY. This is free software, and you
are welcome to redistribute it under certain conditions. See the GNU
General Public Licence for details.
freeswan@xs1:~$ gdb src/rsync-2.5.5/rsync FTP/rsync.core
GNU gdb 4.18
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for
details.
This GDB was configured as "i386-unknown-freebsd"...
Core was generated by `rsync'.
Program terminated with signal 6, Abort trap.
Reading symbols from /usr/lib/libc.so.4...done.
Reading symbols from /usr/libexec/ld-elf.so.1...done.
#0 0x280c6990 in kill () from /usr/lib/libc.so.4
(gdb) bt
#0 0x280c6990 in kill () from /usr/lib/libc.so.4
#1 0x28102b0e in abort () from /usr/lib/libc.so.4
#2 0x8052897 in log_exit (code=13, file=0x80693f9 "log.c", line=279)
at log.c:555
#3 0x804c662 in _exit_cleanup (code=13, file=0x80693f9 "log.c",
line=279)
at cleanup.c:87
#4 0x8052248 in rwrite (code=FERROR,
buf=0xbfbfa86c "rsync error: errors with program diagnostics (code 13)
at log.c(279)\n", len=69) at log.c:279
#5 0x8052302 in rprintf (code=FERROR,
format=0x8069580 "rsync error: %s (code %d) at %s(%d)\n") at
log.c:324
#6 0x8052924 in log_exit (code=13, file=0x80693f9 "log.c", line=279)
at log.c:571
#7 0x804c662 in _exit_cleanup (code=13, file=0x80693f9 "log.c",
line=279)
at cleanup.c:87
#8 0x8052248 in rwrite (code=FERROR,
buf=0xbfbfad5c "rsync error: errors with program diagnostics (code 13)
at log.c(279)\n", len=69) at log.c:279
#9 0x8052302 in rprintf (code=FERROR,
format=0x8069580 "rsync error: %s (code %d) at %s(%d)\n") at
log.c:324
#10 0x8052924 in log_exit (code=13, file=0x80693f9 "log.c", line=279)
at log.c:571
#11 0x804c662 in _exit_cleanup (code=13, file=0x80693f9 "log.c",
line=279)
at cleanup.c:87
#12 0x8052248 in rwrite (code=FERROR,
buf=0xbfbfb24c "rsync error: errors with program diagnostics (code 13)
at log.c(279)\n", len=69) at log.c:279
#13 0x8052302 in rprintf (code=FERROR,
format=0x8069580 "rsync error: %s (code %d) at %s(%d)\n") at
log.c:324
#14 0x8052924 in log_exit (code=13, file=0x80693f9 "log.c", line=279)
at log.c:571
#15 0x804c662 in _exit_cleanup (code=13, file=0x80693f9 "log.c",
line=279)
at cleanup.c:87
#16 0x8052248 in rwrite (code=FERROR,
buf=0xbfbfb73c "rsync error: errors with program diagnostics (code 13)
at log.c(279)\n", len=69) at log.c:279
#17 0x8052302 in rprintf (code=FERROR,
format=0x8069580 "rsync error: %s (code %d) at %s(%d)\n") at
log.c:324
#18 0x8052924 in log_exit (code=13, file=0x80693f9 "log.c", line=279)
at log.c:571
#19 0x804c662 in _exit_cleanup (code=13, file=0x80693f9 "log.c",
line=279)
at cleanup.c:87
#20 0x8052248 in rwrite (code=FERROR,
buf=0xbfbfbc2c "rsync error: errors with program diagnostics (code 13)
at log.c(279)\n", len=69) at log.c:279
#21 0x8052302 in rprintf (code=FERROR,
format=0x8069580 "rsync error: %s (code %d) at %s(%d)\n") at
log.c:324
#22 0x8052924 in log_exit (code=13, file=0x80693f9 "log.c", line=279)
at log.c:571
#23 0x804c662 in _exit_cleanup (code=13, file=0x80693f9 "log.c",
line=279)
at cleanup.c:87
#24 0x8052248 in rwrite (code=FERROR,
buf=0xbfbfc11c "rsync error: errors with program diagnostics (code 13)
at log.c(279)\n", len=69) at log.c:279
#25 0x8052302 in rprintf (code=FERROR,
format=0x8069580 "rsync error: %s (code %d) at %s(%d)\n") at
log.c:324
#26 0x8052924 in log_exit (code=13, file=0x80693f9 "log.c", line=279)
at log.c:571
#27 0x804c662 in _exit_cleanup (code=13, file=0x80693f9 "log.c",
line=279)
at cleanup.c:87
#28 0x8052248 in rwrite (code=FERROR,
buf=0xbfbfc60c "rsync error: errors with program diagnostics (code 13)
at log.c(279)\n", len=69) at log.c:279
#29 0x8052302 in rprintf (code=FERROR,
format=0x8069580 "rsync error: %s (code %d) at %s(%d)\n") at
log.c:324
#30 0x8052924 in log_exit (code=13, file=0x80693f9 "log.c", line=279)
at log.c:571
#31 0x804c662 in _exit_cleanup (code=13, file=0x80693f9 "log.c",
line=279)
at cleanup.c:87
#32 0x8052248 in rwrite (code=FERROR,
buf=0xbfbfcafc "rsync error: errors with program diagnostics (code 13)
at log.c(279)\n", len=69) at log.c:279
#33 0x8052302 in rprintf (code=FERROR,
format=0x8069580 "rsync error: %s (code %d) at %s(%d)\n") at
log.c:324
#34 0x8052924 in log_exit (code=13, file=0x80693f9 "log.c", line=279)
- ---Type <return> to continue, or q <return> to quit---
at log.c:571
#35 0x804c662 in _exit_cleanup (code=13, file=0x80693f9 "log.c",
line=279)
at cleanup.c:87
#36 0x8052248 in rwrite (code=FERROR,
buf=0xbfbfcfec "rsync error: errors with program diagnostics (code 13)
at log.c(279)\n", len=69) at log.c:279
#37 0x8052302 in rprintf (code=FERROR,
format=0x8069580 "rsync error: %s (code %d) at %s(%d)\n") at
log.c:324
#38 0x8052924 in log_exit (code=13, file=0x80693f9 "log.c", line=279)
at log.c:571
#39 0x804c662 in _exit_cleanup (code=13, file=0x80693f9 "log.c",
line=279)
at cleanup.c:87
#40 0x8052248 in rwrite (code=FERROR,
buf=0xbfbfd4dc "rsync error: errors with program diagnostics (code 13)
at log.c(279)\n", len=69) at log.c:279
#41 0x8052302 in rprintf (code=FERROR,
format=0x8069580 "rsync error: %s (code %d) at %s(%d)\n") at
log.c:324
#42 0x8052924 in log_exit (code=13, file=0x80693f9 "log.c", line=279)
at log.c:571
#43 0x804c662 in _exit_cleanup (code=13, file=0x80693f9 "log.c",
line=279)
at cleanup.c:87
#44 0x8052248 in rwrite (code=FERROR,
buf=0xbfbfd9cc "rsync error: errors with program diagnostics (code 13)
at log.c(279)\n", len=69) at log.c:279
#45 0x8052302 in rprintf (code=FERROR,
format=0x8069580 "rsync error: %s (code %d) at %s(%d)\n") at
log.c:324
#46 0x8052924 in log_exit (code=13, file=0x80693f9 "log.c", line=279)
at log.c:571
#47 0x804c662 in _exit_cleanup (code=13, file=0x80693f9 "log.c",
line=279)
at cleanup.c:87
#48 0x8052248 in rwrite (code=FERROR,
buf=0xbfbfdebc "rsync: error writing 70 unbuffered bytes - exiting:
Broken pipe\n", len=64) at log.c:279
#49 0x8052302 in rprintf (code=FERROR,
format=0x806bec0 "rsync: error writing %d unbuffered bytes - exiting:
%s\n") at log.c:324
#50 0x8056d85 in writefd_unbuffered (fd=1, buf=0xbfbfe45c "B", len=70)
at io.c:459
#51 0x8056f08 in mplex_write (fd=1, code=FERROR,
buf=0xbfbff504 "rsync: connection unexpectedly closed (2525941 bytes
read so far)\n", len=66) at io.c:516
#52 0x805727a in io_multiplex_write (code=FERROR,
buf=0xbfbff504 "rsync: connection unexpectedly closed (2525941 bytes
read so far)\n", len=66) at io.c:697
#53 0x805217b in rwrite (code=FERROR,
buf=0xbfbff504 "rsync: connection unexpectedly closed (2525941 bytes
read so far)\n", len=66) at log.c:245
#54 0x80565bf in read_error_fd () at io.c:119
#55 0x80567d4 in read_timeout (fd=3, buf=0xbfbffb18
"????L???\"?\004\b\003",
len=4) at io.c:216
#56 0x805690a in read_unbuffered (fd=3,
buf=0xbfbffb18 "????L???\"?\004\b\003", len=4) at io.c:274
#57 0x8056a6e in readfd (fd=3, buffer=0xbfbffb18
"????L???\"?\004\b\003", N=4)
at io.c:329
#58 0x8056aa3 in read_int (f=3) at io.c:342
#59 0x804b522 in generate_files (f=1, flist=0x807b120, local_name=0x0,
f_recv=3) at generator.c:524
#60 0x804fef7 in do_recv (f_in=0, f_out=1, flist=0x807b120, local_name=0x0)
at main.c:420
#61 0x8050106 in do_server_recv (f_in=0, f_out=1, argc=2, argv=0x8078064)
at main.c:491
#62 0x80501b4 in start_server (f_in=0, f_out=1, argc=2, argv=0x8078060)
at main.c:519
#63 0x80509fb in main (argc=2, argv=0x8078060) at main.c:918
#64 0x804a04d in _start ()
(gdb) q
freeswan@xs1:~$ quit
bash: quit: command not found
freeswan@xs1:~$ exit
exit
Script done on Sun Oct 13 01:53:23 2002
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)
Comment: Finger me for keys
iQCVAwUBPameI4qHRg3pndX9AQFx1gP/aReBBqsFONEBYgywVMLVqFRDtGUjHDab
2/an4sKlNoOF/nzHIs8+3/1E5oGpB0hzjsmjMEEQS3N9l/79gLQKySj3Gkxc+Ezf
fdw3TQIuo+69R7Ob3LKbZ6FYu5devGQW6tERaij8eknduysnlbOC23WD8RXoJ65n
J11DxX203ZY=YUS7
-----END PGP SIGNATURE-----