From owner-freebsd-current Wed Oct 30 19:45:55 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6082537B401 for ; Wed, 30 Oct 2002 19:45:53 -0800 (PST) Received: from lakemtao03.cox.net (lakemtao03.cox.net [68.1.17.242]) by mx1.FreeBSD.org (Postfix) with ESMTP id BBAEE43E77 for ; Wed, 30 Oct 2002 19:45:52 -0800 (PST) (envelope-from ataraxia@cox.net) Received: from cox.net ([68.98.184.165]) by lakemtao03.cox.net (InterMail vM.5.01.04.05 201-253-122-122-105-20011231) with ESMTP id <20021031034551.HGTX16428.lakemtao03.cox.net@cox.net> for ; Wed, 30 Oct 2002 22:45:51 -0500 Message-ID: <3DC0A776.8020704@cox.net> Date: Wed, 30 Oct 2002 22:45:58 -0500 From: Ray Kohler User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.2b) Gecko/20021030 X-Accept-Language: en-us, en MIME-Version: 1.0 To: current@freebsd.org Subject: burncd hangs after 'blank' Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Sorry if this is old news, but I've just discovered a problem in burncd. If I do a 'blank' the operation completes but burncd then hangs. I have a gdb session that shows the situation quite nicely: when burncd does CDRIOCGETPROGRESS to get the number for the progress bar, it always reports 0, and with no error, so burncd gets stuck in an infinite loop. This really looks like an ioctl() issue more than a burncd one: either CDRIOCGETPROGRESS shouldn't be allowed on 'blank' or it should return valid information. Gdb session follows (sorry about the horrible line-wrapping). /usr/src/usr.sbin/burncd 10:23PM % sudo cc -O -pipe -g -march=athlon -Wall -Wno-format-y2k -Wno-uninitialized -o burncd burncd.c /usr/src/usr.sbin/burncd 10:26PM % sudo gdb burncd GNU gdb 5.2.1 (FreeBSD) Copyright 2002 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-undermydesk-freebsd"... (gdb) r -s 4 -f /dev/acd0c blank Starting program: /usr/src/usr.sbin/burncd/burncd -s 4 -f /dev/acd0c blank ^Zanking CD, please wait.. Program received signal SIGTSTP, Stopped (user). 0x280b0823 in nanosleep () from /usr/lib/libc.so.5 (gdb) bt #0 0x280b0823 in nanosleep () from /usr/lib/libc.so.5 #1 0x280a594f in sleep () from /usr/lib/libc.so.5 #2 0x08049069 in main (argc=1, argv=0x2812247c) at burncd.c:194 #3 0x08048a80 in _start () (gdb) up 2 #2 0x08049069 in main (argc=1, argv=0x2812247c) at burncd.c:194 194 sleep(1); (gdb) l 189 blank == CDR_B_ALL ? "eras" : "blank"); 190 191 if (ioctl(fd, CDRIOCBLANK, &blank) < 0) 192 err(EX_IOERR, "ioctl(CDRIOCBLANK)"); 193 while (1) { 194 sleep(1); 195 error = ioctl(fd, CDRIOCGETPROGRESS, &percent); 196 if (percent > 0 && !quiet) 197 fprintf(stderr, 198 "%sing CD - %d %% done \r", (gdb) 199 blank == CDR_B_ALL ? 200 "eras" : "blank", percent); 201 if (error || percent == 100 || 202 (percent == 0 && last == 99)) 203 break; 204 last = percent; 205 } 206 if (!quiet) 207 printf("\n"); 208 continue; (gdb) p error $1 = 0 (gdb) p percent $2 = 0 (gdb) p last $3 = 0 (gdb) set last=99 (gdb) p last $4 = 99 (gdb) c Continuing. Program exited normally. (gdb) q To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message