From owner-freebsd-bugs@FreeBSD.ORG Sat May 13 23:45:26 2006 Return-Path: X-Original-To: freebsd-bugs@freebsd.org Delivered-To: freebsd-bugs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CB48716A40E for ; Sat, 13 May 2006 23:45:26 +0000 (UTC) (envelope-from g.wolfe@wojaFInc.com) Received: from smarthost.sa.chariot.net.au (smarthost.sa.chariot.net.au [203.87.93.142]) by mx1.FreeBSD.org (Postfix) with ESMTP id 95F4143D48 for ; Sat, 13 May 2006 23:45:25 +0000 (GMT) (envelope-from g.wolfe@wojaFInc.com) Received: from mail.qld.chariot.net.au (mail.qld.chariot.net.au [203.87.95.166]) by smarthost.sa.chariot.net.au (Postfix) with ESMTP id 7837D2B2DE9 for ; Sun, 14 May 2006 09:15:23 +0930 (CST) Received: from localhost (avs4.sa.chariot.net.au [203.87.94.10]) by mail.qld.chariot.net.au (Postfix) with ESMTP id 36A1E4E8AA for ; Sun, 14 May 2006 09:43:35 +1000 (EST) Received: from mail.qld.chariot.net.au ([203.87.95.166]) by localhost (avs4.sa.chariot.net.au [203.87.94.10]) (amavisd-new, port 10024) with LMTP id 22278-01-18 for ; Sun, 14 May 2006 09:15:23 +0930 (CST) Received: from [172.28.0.30] (58-84-114-37.dial-lns3.qld.chariot.net.au [58.84.114.37]) by mail.qld.chariot.net.au (Postfix) with ESMTP id B25424E88A for ; Sun, 14 May 2006 09:43:26 +1000 (EST) Message-ID: <44666F90.2060403@wojaFInc.com> Date: Sun, 14 May 2006 09:45:20 +1000 From: Glen Wolfe Organization: wojaFInc pty ltd User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-bugs@freebsd.org X-Virus-Scanned: amavisd-new at chariot.net.au Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: burncd write buffer overflow X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: g.wolfe@wojaFInc.com List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 May 2006 23:45:29 -0000 Hi I have been attempting to use burncd from FreeBSD Release 6.0 using the command line: *#burncd -f /dev/acd0 -s 3 dvdrw disk_image.iso* with repeated failure after attempting to write 890 kB to a DVD. After adding trace modifications to the primary write loop in int write_file(int fd, struct track_info *track_info) in *burncd.c* viz. ------------------ while ((count = read(track_info->file, buf, track_info->file_size == -1 ? track_info->block_size * BLOCKS : MIN((track_info->file_size - size), track_info->block_size * BLOCKS))) > 0) { int res; if (count % track_info->block_size) { /* pad file to % block_size */ bzero(&buf[count], (track_info->block_size * BLOCKS) - count); count = ((count / track_info->block_size) + 1) * track_info->block_size; } * /* trace report */* fprintf(stderr, "\nAbout to write this track of %jd KB ...\n", (intmax_t)count/1024); * /* end trace report */* if ((res = write(fd, buf, count)) != count) { if (res == -1) fprintf(stderr, "\n%s\n", strerror(errno)); */* ---------------------------- this error not handled ---------------- */* */* if buffer not fully written due to e.g. Device busy ... no recovery */* else fprintf(stderr, "\nonly wrote %d of %jd bytes\n", res, (intmax_t)count); break; } size += count; tot_size += count; if (!quiet) { int pct; fprintf(stderr, "written this track %jd KB", (intmax_t)size/1024); if (track_info->file != STDIN_FILENO && filesize) { pct = (size / 1024) * 100 / filesize; fprintf(stderr, " (%d%%)", pct); } fprintf(stderr, " total %jd KB\r", (intmax_t)tot_size / 1024); } if (track_info->file_size != -1 && size >= track_info->file_size) break; } ---------------------------- the following output is observed: -------------------------- # burncd/burncd -f /dev/acd0 -s 3 dvdrw fBSD_sys_cd.iso Writing track 0 of 1 ... next writeable LBA 0 writing from file fBSD_sys_cd.iso size 3111668 KB About to write this track of 32 KB ... written this track 32 KB (0%) total 32 KB About to write this track of 32 KB ... written this track 64 KB (0%) total 64 KB About to write this track of 32 KB ... written this track 96 KB (0%) total 96 KB About to write this track of 32 KB ... written this track 128 KB (0%) total 128 KB About to write this track of 32 KB ... written this track 160 KB (0%) total 160 KB About to write this track of 32 KB ... written this track 192 KB (0%) total 192 KB About to write this track of 32 KB ... written this track 224 KB (0%) total 224 KB About to write this track of 32 KB ... written this track 256 KB (0%) total 256 KB About to write this track of 32 KB ... written this track 288 KB (0%) total 288 KB About to write this track of 32 KB ... written this track 320 KB (0%) total 320 KB About to write this track of 32 KB ... written this track 352 KB (0%) total 352 KB About to write this track of 32 KB ... written this track 384 KB (0%) total 384 KB About to write this track of 32 KB ... written this track 416 KB (0%) total 416 KB About to write this track of 32 KB ... written this track 448 KB (0%) total 448 KB About to write this track of 32 KB ... written this track 480 KB (0%) total 480 KB About to write this track of 32 KB ... written this track 512 KB (0%) total 512 KB About to write this track of 32 KB ... written this track 544 KB (0%) total 544 KB About to write this track of 32 KB ... written this track 576 KB (0%) total 576 KB About to write this track of 32 KB ... written this track 608 KB (0%) total 608 KB About to write this track of 32 KB ... written this track 640 KB (0%) total 640 KB About to write this track of 32 KB ... written this track 672 KB (0%) total 672 KB About to write this track of 32 KB ... written this track 704 KB (0%) total 704 KB About to write this track of 32 KB ... written this track 736 KB (0%) total 736 KB About to write this track of 32 KB ... written this track 768 KB (0%) total 768 KB About to write this track of 32 KB ... written this track 800 KB (0%) total 800 KB About to write this track of 32 KB ... written this track 832 KB (0%) total 832 KB About to write this track of 32 KB ... written this track 864 KB (0%) total 864 KB About to write this track of 32 KB ... written this track 896 KB (0%) total 896 KB About to write this track of 32 KB ... Device busy burncd: ioctl(CDRIOCFLUSH): Input/output error -------------------------- This appears to me that the partial buffer write failure error is not handled adequately, or that the write speed is too fast (thus causing the error in the first place). As this error is not dependant on the speed (*-s*) option passed to *burncd*, can anyone make any comment on the appropriate error handling here, or the write speed setting mechanism in the cd/dvd writer device driver? *ad*thanks*vance * Glen* * -- Glen Wolfe g.wolfe@wojaFInc.com Ph +61-433 774 535 ------------------------------------------------------------------------ This private and confidential email has been sent in good faith that the addressee/s is/are to be its only viewer/s, even though transmitted unencrypted over public networks. If you are not the intended recipient, it would be appreciated if you would delete all copies (including attachments) that you possess, and contact the sender to make notification of this privacy failure. Thank you. ------------------------------------------------------------------------