From owner-freebsd-hackers Sun Feb 22 14:37:20 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id OAA28073 for freebsd-hackers-outgoing; Sun, 22 Feb 1998 14:37:20 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from frmug.org (frmug-gw.frmug.org [193.56.58.252]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id OAA28060 for ; Sun, 22 Feb 1998 14:37:06 -0800 (PST) (envelope-from roberto@keltia.freenix.fr) Received: (from uucp@localhost) by frmug.org (8.8.8/frmug-2.2/nospam) with UUCP id XAA18185 for hackers@FreeBSD.ORG; Sun, 22 Feb 1998 23:36:52 +0100 (CET) (envelope-from roberto@keltia.freenix.fr) Received: (from roberto@localhost) by keltia.freenix.fr (8.8.8/keltia-2.13/nospam) id WAA02214; Sun, 22 Feb 1998 22:44:53 +0100 (CET) (envelope-from roberto) Message-ID: <19980222224452.A2190@keltia.freenix.fr> Date: Sun, 22 Feb 1998 22:44:52 +0100 From: Ollivier Robert To: hackers@FreeBSD.ORG Subject: Re: Signal 11 problem Mail-Followup-To: hackers@FreeBSD.ORG References: <199802221942.LAA08014@dingo.cdrom.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.90.4i In-Reply-To: ; from Sunthiti Patchararungruang on Mon, Feb 23, 1998 at 04:12:05AM +0700 X-Operating-System: FreeBSD 3.0-CURRENT ctm#4088 AMD-K6 MMX @ 225 MHz Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG According to Sunthiti Patchararungruang: > Sorry about my useless example. Here is the real problem. I cut it > from wu-ftpd 2.4. All variables are proved to be correct. I use ^^^^^^^^^^^ Thanks for giving us the real clue. See below. > FreeBSD2.2.5. > > sprintf(msg, "%.24s %d %s %d %s %c %s %c %c %s ftp %d %s\n", ^^ > ctime(&curtime), > xfertime, > remotehost, > byte_count, ^^^^^^^^^^ Your problem is probably there and we tumbled on it a something like two years ago :-) It is the "byte_count" thingy which is probably an "off_t" (64 bits) but the sprintf format string want it as an int "%d". That cause a difference in offsets between what it is in the stack and what the sprintf function retrieve from it based on the format string. Change your format string to show "%qd" (or better "%qu") and watch your program run. -- Ollivier ROBERT -=- FreeBSD: The Power to Serve! -=- roberto@keltia.freenix.fr FreeBSD keltia.freenix.fr 3.0-CURRENT #1: Sun Feb 22 00:44:29 CET 1998 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message