Bug 104389 - Wrongly indicates success burning a DVD image
Summary: Wrongly indicates success burning a DVD image
Status: RESOLVED FIXED
Alias: None
Product: k3b
Classification: Applications
Component: Burning/Hardware (show other bugs)
Version: 0.11.20
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Sebastian Trueg
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-22 20:01 UTC by ieure
Modified: 2006-12-07 20:41 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Screenshot of the issue. (34.73 KB, image/jpeg)
2005-04-22 20:01 UTC, ieure
Details
success dialog (85.27 KB, image/png)
2006-11-21 20:32 UTC, Roger Larsson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ieure 2005-04-22 20:01:04 UTC
Version:           0.11.20 (using KDE 3.4.0, Debian Package 4:3.4.0-0pre4 (3.1))
Compiler:          gcc version 3.3.5 (Debian 1:3.3.5-8)
OS:                Linux (i686) release 2.6.10-1-686

K3b indicates that writing finished successfully, but it's obvious that it didn't- the full disc was not burned.

Using:
$ growisofs --version
* growisofs by <appro@fy.chalmers.se>, version 5.21,
  front-ending to mkisofs: mkisofs 2.01-unofficial-iconv (i686-pc-linux-gnu)

On Debian sarge.
Comment 1 ieure 2005-04-22 20:01:42 UTC
Created attachment 10751 [details]
Screenshot of the issue.
Comment 2 ieure 2005-04-22 20:06:44 UTC
More info:

The full log window in K3b reads:

Using growisofs 5.12 - Copyright (C) Andy Polyakov <appro@fy.chalmers.se>
Starting writing...
Writing speed: 11356 kb/s (8.20x)
:-( write failed: Resource temporarily unavailable
Flusing the cache may take some time.
Updating RMA...
Closing Session...
Writing successfully finished

And the debug output reads (in part):

 404258816/4683513856 ( 8.6%) @4.3x, remaining 10:24
:-? the LUN appears to be stuck writing LBA=30310h, retry in 0ms
:-[ WRITE@LBA=80030310h failed with SK=2h/ASC=04h/ACQ=08h]: Resource temporarily unavailable
:-( write failed: Resource temporarily unavailable
/dev/hdc: flushing cache
/dev/hdc: updating RMA
/dev/hdc: closing session
Comment 3 Sebastian Trueg 2005-04-23 15:15:34 UTC
are you using automounting? if so, disable it.
Comment 4 ieure 2005-04-24 12:15:15 UTC
I'm not using any kind of automounter.

I am running KDE 3.4.0, which has the media:/ setup, but nothing is automatically mounted.
Comment 5 Sebastian Trueg 2005-05-23 19:43:25 UTC
well, I don't know. sorry. this is some problem with the kernel and growisofs. K3b cannot do anything about this. so i will close this bug. did you have any success in the meantime?
Comment 6 ieure 2005-05-23 21:06:57 UTC
It's a problem with the kernel that K3b can't tell when growisofs fails to burn a disc? I don't think so.

It may be a growisofs problem, see e.g. http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=307660
Comment 7 Sebastian Trueg 2005-05-24 11:42:02 UTC
> :-? the LUN appears to be stuck writing LBA=30310h, retry in 0ms 
> :-[ WRITE@LBA=80030310h failed with SK=2h/ASC=04h/ACQ=08h]: Resource temporarily
> unavailable 
> :-( write failed: Resource temporarily unavailable 

now this does not look like a growisofs problem to me and it's also not a k3b bug since growisofs returns a 0 status. The only thing missing in k3b is an additional error check for messages like those...
Comment 8 ieure 2005-05-24 18:48:08 UTC
It doesn't matter what caused the burn to fail, the fact is that it failed, and K3b said it was successful.
Comment 9 Sebastian Trueg 2005-05-24 20:33:08 UTC
like I already said: the only problem in k3b is the missing error handling which I will improve. But I cannot do anything about the failed burn (and I think growisofs cannot either)
Comment 10 ieure 2005-05-24 20:47:51 UTC
Yes, I'm fully aware that you can't solve that problem, and I never asked you to. The report was solely about K3b reporting success when burning failed.
Comment 11 Sebastian Trueg 2005-05-24 22:08:54 UTC
:-D
I think it's time we stop this. We both basicly meant the same thing in the end.
So there is nothing left to do but improve K3b's error handling (and perhaps ask the author of growisofs for advise) 
Comment 12 Francois Marier 2006-01-26 20:26:35 UTC
I believe that the following Debian bug (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=349445) also relates to this.  Here's what Ross had to say about it:

My guess is that it's the same underlying problem.  However, some of
the specifics differ:

1) My case had different, and more extensive error messages indicating
an overall failure.  That bug reports shows
Using growisofs 5.12 - Copyright (C) Andy Polyakov <appro at fy.chalmers.se>
Starting writing...
Writing speed: 11356 kb/s (8.20x)
:-( write failed: Resource temporarily unavailable
Flusing the cache may take some time.
Updating RMA...
Closing Session...
Writing successfully finished

While I had
Writing DVD+R
Using growisofs 5.21
writing speed 12.30x
x write failed; Resource temporarily unavailable
writing successfully finished
mkisofs did not exit cleanly
Error while creating ISO image

(though both have "writing successfully finished").

2)  k3b seemed aware that these messages were error conditions, as it
displayed several of them with red icons.  It sounds as if that was
not the case in the original report, though it's unclear.

3) I was using a later version of k3b (0.12.10).

As with that bug, the bug is k3b's failure to detect the failure; it
is not a request for k3b to make the burn succeed.
Comment 13 Sebastian Trueg 2006-01-26 21:50:16 UTC
growisofs returns a wrong exit value. yes, k3b should check the errors. 
growisofs 6.0 should fix this hopefully.
Comment 14 Roger Larsson 2006-11-21 20:28:35 UTC
Another case this time with
> growisofs --version
* growisofs by <appro@fy.chalmers.se>, version 6.1,
  front-ending to mkisofs: mkisofs 2.01 (x86_64-suse-linux)

Output below - will add screenshot too.

System
-----------------------
K3b Version: 0.12.14

KDE Version: 3.5.1 Level "a" 
QT Version:  3.3.5
Kernel:      2.6.16.21-0.13-default
Devices
-----------------------
_NEC DVD_RW ND-3550A 1.05 (/dev/hdc, ) at  [Cd-r; Cd-rw; Cd-rom; Dvd-rom; Dvd-r; Dvd-rw; Dvd-r DL; Dvd+r; Dvd+rw; Dvd+r DL] [Dvd-rom; Dvd-r sekvensiell; Dvd-r med två lager sekvensiell; Dvd-rw begränsad överskrivning; Dvd-rw sekvensiell; Dvd+rw; Dvd+r; Dvd+r med dubbla lager; Cd-rom; Cd-r; Cd-rw] [SAO; Track-at-once; Obehandlat; SAO/R96R; RAW/R96R; Begränsad överskrivning]

Used versions
-----------------------
growisofs: 6.1
mkisofs: 2.1

growisofs
-----------------------
INFO: UTF-8 character encoding detected by locale settings.
 Assuming UTF-8 encoded filenames on source filesystem,
 use -input-charset to override.
Using _XSESSION_ERROR000.;1 for  roger/.xsession-errors-:2 (.xsession-errors-:1)
- - -
Using CNN_POP3_RESOLVER_DO001.TCPDUMP;1 for  roger/rendering/cnn-pop3-resolver-doubleclick-cnn.tcpdump (cnn-pop3-resolver-doubleclick-cnn-ads.tcpdump)
Incorrectly encoded string (Välkommen_till_SkandiaBanken..war) encountered.
Possibly creating an invalid Joliet extension. Aborting.
:-( write failed: Input/output error

growisofs command:
-----------------------
/usr/bin/growisofs -Z /dev/hdc -use-the-force-luke=notray -use-the-force-luke=tty -speed=8 -use-the-force-luke=bufsize:32m -gui -graft-points -volid Backup 2006-11-21 -volset  -appid K3B THE CD KREATOR (C) 1998-2005 SEBASTIAN TRUEG AND THE K3B TEAM -publisher Roger Larsson -preparer  -sysid LINUX -volset-size 1 -volset-seqno 1 -sort /tmp/kde-roger/k3b6jxscb.tmp -rational-rock -hide-list /tmp/kde-roger/k3bQh9p0b.tmp -joliet -hide-joliet-list /tmp/kde-roger/k3bUsw5Va.tmp -full-iso9660-filenames -disable-deep-relocation -iso-level 2 -path-list /tmp/kde-roger/k3bYPOlyb.tmp 

Comment 15 Roger Larsson 2006-11-21 20:32:16 UTC
Created attachment 18649 [details]
success dialog
Comment 16 Sebastian Trueg 2006-12-07 20:41:25 UTC
SVN commit 611353 by trueg:

Added a little hack that checks for a write error in addition to the growisofs exit code.
growisofs seems to sometimes exit with code 0 even if an error occured.

BUG: 104389


 M  +8 -0      k3bgrowisofshandler.cpp  
 M  +2 -1      k3bgrowisofshandler.h  
 M  +2 -1      k3bgrowisofswriter.cpp  


--- trunk/extragear/multimedia/k3b/libk3b/projects/k3bgrowisofshandler.cpp #611352:611353
@@ -106,6 +106,10 @@
       m_error = ERROR_MEMLOCK;
     }
 
+    else if( line.startsWith( ":-( write failed" ) ) {
+      m_error = ERROR_WRITE_FAILED;
+    }
+
     else  
       emit infoMessage( line, K3bJob::ERROR );
   }
@@ -253,6 +257,10 @@
     emit infoMessage( i18n("...or by lowering the used software buffer size in the advanced K3b settings."), K3bJob::ERROR );
     break;
 
+  case ERROR_WRITE_FAILED:
+    emit infoMessage( i18n("Write error"), K3bJob::ERROR );
+    break;
+
   default:
 
     //
--- trunk/extragear/multimedia/k3b/libk3b/projects/k3bgrowisofshandler.h #611352:611353
@@ -43,7 +43,8 @@
     ERROR_OVERSIZE,
     ERROR_SPEED_SET_FAILED,
     ERROR_OPC,
-    ERROR_MEMLOCK
+    ERROR_MEMLOCK,
+    ERROR_WRITE_FAILED
   };
 
   int error() const { return m_error; }
--- trunk/extragear/multimedia/k3b/libk3b/projects/k3bgrowisofswriter.cpp #611352:611353
@@ -521,7 +521,8 @@
 
   d->finished = true;
 
-  if( p->exitStatus() == 0 ) {
+  // it seems that growisofs sometimes exits with a valid exit code while a write error occured
+  if( p->exitStatus() == 0 && d->gh->error() != K3bGrowisofsHandler::ERROR_WRITE_FAILED ) {
 
     int s = d->speedEst->average();
     if( s > 0 )