Ticket #57 (assigned defect)

Opened 2 years ago

Last modified 19 months ago

Crash when trying negative offset

Reported by: https://www.google.com/accounts/o8/id?id=aitoawlw7vrimfrdvxg14x_fdyasjdl5lxrcanw Owned by: https://www.google.com/accounts/o8/id?id=aitoawlw7vrimfrdvxg14x_fdyasjdl5lxrcanw
Priority: major Milestone: future
Component: morituri Version: 0.1.1
Keywords: Cc:

Description

Any time I try to use 'rip offset find' to find the offset of my drive, morituri will crash when it gets to testing a negative offset. (it also crashes if I manually specify a negative offset in the list of ones to try).

It also crashes when ripping using a negative offset. See the final output for details.

I am using the Ubuntu packages for this software.

Below are the list of error outputs I get for various command lines. I removed the backtrace in some cases, as it is always substationally similar.

$ rip offset find
Trying read offset 6 ...
Message: pygobject_register_sinkfunc is deprecated (GstObject?)
Trying read offset 48 ...
Trying read offset 102 ...
Trying read offset 667 ...
Trying read offset 12 ...
Trying read offset 30 ...
Trying read offset 618 ...
Trying read offset 594 ...
Trying read offset 738 ...
Trying read offset -472 ...
ERROR: -1 frames difference
Traceback (most recent call last):

File "/usr/bin/rip", line 35, in <module>

sys.exit(main.main(sys.argv[1:]))

File "/usr/lib/python2.6/dist-packages/morituri/rip/main.py", line 12, in main

ret = c.parse(argv)

File "/usr/lib/python2.6/dist-packages/morituri/extern/command/command.py", line 329, in parse

return self.subCommands[command].parse(args[1:])

File "/usr/lib/python2.6/dist-packages/morituri/extern/command/command.py", line 329, in parse

return self.subCommands[command].parse(args[1:])

File "/usr/lib/python2.6/dist-packages/morituri/extern/command/command.py", line 300, in parse

ret = self.do(args)

File "/usr/lib/python2.6/dist-packages/morituri/rip/offset.py", line 139, in do

archecksum = self._arcs(runner, table, 1, offset)

File "/usr/lib/python2.6/dist-packages/morituri/rip/offset.py", line 183, in _arcs

runner.run(t)

File "/usr/lib/python2.6/dist-packages/morituri/common/task.py", line 390, in run

raise TaskException?(task.exception, message=task.exceptionMessage)

morituri.common.task.TaskException?: (FileSizeError?(u'/tmp/tmpmJIJdl.track01.offset-472.morituri.wav',), None)

$ rip offset find -o -472
Trying read offset -472 ...
ERROR: -1 frames difference
Traceback (most recent call last):

File "/usr/bin/rip", line 35, in <module>

sys.exit(main.main(sys.argv[1:]))

...

File "/usr/lib/python2.6/dist-packages/morituri/common/task.py", line 390, in run

raise TaskException?(task.exception, message=task.exceptionMessage)

morituri.common.task.TaskException?: (FileSizeError?(u'/tmp/tmp8u41Wt.track01.offset-472.morituri.wav',), None)

$ rip offset find -o 98,-94
Trying read offset 98 ...
Message: pygobject_register_sinkfunc is deprecated (GstObject?)
Trying read offset -94 ...
ERROR: -1 frames difference
Traceback (most recent call last):

File "/usr/bin/rip", line 35, in <module>

sys.exit(main.main(sys.argv[1:]))

...

File "/usr/lib/python2.6/dist-packages/morituri/common/task.py", line 390, in run

raise TaskException?(task.exception, message=task.exceptionMessage)

morituri.common.task.TaskException?: (FileSizeError?(u'/tmp/tmph8kV2w.track01.offset-94.morituri.wav',), None)

$ rip cd rip -o -472
Checking device /dev/sr0
CDDB disc id 60095509
MusicBrainz? disc id jCkpWS7EslCGIaSc4vqKg_p1suY-
Submit this disc to MusicBrainz? at:
 http://mm.musicbrainz.org/bare/cdlookup.html?toc=1+9+179332+150+22040+38565+55315+80185+98127+112590+135000+152565&tracks=9&id=jCkpWS7EslCGIaSc4vqKg_p1suY-

WARNING: pycdio not installed, cannot identify drive
Ripping track 1 of 9: 01. Unknown Artist - Unknown Track 1.flac
Message: pygobject_register_sinkfunc is deprecated (GstObject?)
ERROR: -1 frames difference
Traceback (most recent call last):

File "/usr/bin/rip", line 35, in <module>

sys.exit(main.main(sys.argv[1:]))

File "/usr/lib/python2.6/dist-packages/morituri/rip/main.py", line 12, in main

ret = c.parse(argv)

File "/usr/lib/python2.6/dist-packages/morituri/extern/command/command.py", line 329, in parse

return self.subCommands[command].parse(args[1:])

File "/usr/lib/python2.6/dist-packages/morituri/extern/command/command.py", line 329, in parse

return self.subCommands[command].parse(args[1:])

File "/usr/lib/python2.6/dist-packages/morituri/extern/command/command.py", line 300, in parse

ret = self.do(args)

File "/usr/lib/python2.6/dist-packages/morituri/rip/cd.py", line 228, in do

ripIfNotRipped(i + 1)

File "/usr/lib/python2.6/dist-packages/morituri/rip/cd.py", line 185, in ripIfNotRipped

taglist=prog.getTagList(number))

File "/usr/lib/python2.6/dist-packages/morituri/common/program.py", line 450, in ripTrack

runner.run(t)

File "/usr/lib/python2.6/dist-packages/morituri/common/task.py", line 390, in run

raise TaskException?(task.exception, message=task.exceptionMessage)

morituri.common.task.TaskException?: (FileSizeError?(u'/tmp/tmpRwKOkS.morituri.wav',), None)

Change History

comment:1 Changed 2 years ago by https://thomasvs.myopenid.com/

I can reproduce this.

I'm not sure what cdparanoia is doing; consider this:

$ cdparanoia --sample-offset=0 1[00:00:00.00]-1[00:00:46.15] /tmp/offset0.wav
cdparanoia III release 10.2 (September 11, 2008)

 
Ripping from sector       0 (track  1 [0:00.00])
	  to sector    3465 (track  1 [0:46.15])

outputting to /tmp/offset0.wav

 (== PROGRESS == [                              | 003465 00 ] == :^D * ==)   

Done.


[morituri-trunk] [thomas@otto trunk]$ cdparanoia --sample-offset=-1 1[00:00:00.00]-1[00:00:46.15] /tmp/offset-1.wav
cdparanoia III release 10.2 (September 11, 2008)

 
Ripping from sector       0 (track  1 [0:00.01])
	  to sector    3464 (track  1 [0:46.15])

outputting to /tmp/offset-1.wav

 (== PROGRESS == [                              | 003464 00 ] == :^D * ==)   

Done.


[morituri-trunk] [thomas@otto trunk]$ 
[morituri-trunk] [thomas@otto trunk]$ cdparanoia --sample-offset=1 1[00:00:00.00]-1[00:00:46.15] /tmp/offset1.wav
cdparanoia III release 10.2 (September 11, 2008)

 
Ripping from sector       0 (track  1 [0:00.00])
	  to sector    3465 (track  1 [0:46.15])

outputting to /tmp/offset1.wav

 (== PROGRESS == [                              | 003465 00 ] == :^D * ==)   

Done.


and

$ ls -l /tmp/offset*wav
-rw-r--r--. 1 thomas sbox 8152076 Mar 20 19:00 /tmp/offset0.wav
-rw-r--r--. 1 thomas sbox 8149724 Mar 20 19:01 /tmp/offset-1.wav
-rw-r--r--. 1 thomas sbox 8152076 Mar 20 19:03 /tmp/offset1.wav

it's not clear to me why cdparanoia decides to rip a sector less when using a negative offset; will have to ask upstream.
}}}

comment:2 Changed 2 years ago by thomas

In [428]:

  • morituri/program/cdparanoia.py: Extend FileSizeError? with an extra message.
  • morituri/rip/offset.py: Print a reasonable warning when we cannot rip with a certain offset. See #57.

comment:3 Changed 2 years ago by https://thomasvs.myopenid.com/

Feedback is that this seems to be a known bug.

See  https://bugzilla.redhat.com/show_bug.cgi?id=635925 which includes a patch. Any chance you could try out that patch and tell me if that fixes it for you ? I may not get to that in the next few weeks.

comment:4 Changed 2 years ago by https://www.google.com/accounts/o8/id?id=aitoawlw7vrimfrdvxg14x_fdyasjdl5lxrcanw

I tried that patch, to no avail. Still one sector short with offset of -1.

comment:5 Changed 2 years ago by http://thomasvs.myopenid.com/

I added some code to at least error out more nicely; I also added code to stop trying if it throws scsi errors.

Can you try again and let me know if it finds your offset now ?

comment:6 Changed 2 years ago by http://thomasvs.myopenid.com/

  • Owner changed from https://thomasvs.myopenid.com/ to https://thomas.apestaart.org/morituri/trac/query?status=%21closed&reporter=https%3A%2F%2Fwww.google.com%2Faccounts%2Fo8%2Fid%3Fid%3Daitoawlw7vrimfrdvxg14x_fdyasjdl5lxrcanw
  • Status changed from new to assigned

comment:7 Changed 2 years ago by http://thomasvs.myopenid.com/

  • Owner changed from https://thomas.apestaart.org/morituri/trac/query?status=%21closed&reporter=https%3A%2F%2Fwww.google.com%2Faccounts%2Fo8%2Fid%3Fid%3Daitoawlw7vrimfrdvxg14x_fdyasjdl5lxrcanw to https://www.google.com/accounts/o8/id?id=aitoawlw7vrimfrdvxg14x_fdyasjdl5lxrcanw

comment:8 Changed 2 years ago by http://thomasvs.myopenid.com/

  • Milestone changed from 0.1.2 to future

comment:9 Changed 19 months ago by https://www.google.com/accounts/o8/id?id=aitoawkad9alfynukc51o7rypuoylxx_algep3e

It will now find my offset without crashing, but it won’t rip (version 1.2):

Ripping track 0 of 15: 00. Various Artists - Hidden Track One Audio.flac
Traceback (most recent call last):

File "/usr/lib/python2.7/dist-packages/morituri/common/task.py", line 451, in c

callable(*args, kwargs)

File "/usr/lib/python2.7/dist-packages/morituri/program/cdparanoia.py", line 283, in _read

self._done()

File "/usr/lib/python2.7/dist-packages/morituri/program/cdparanoia.py", line 356, in _done

self.quality = self._parser.getTrackQuality()

File "/usr/lib/python2.7/dist-packages/morituri/program/cdparanoia.py", line 179, in getTrackQuality

return min(frames * 2.0 / reads, 1.0)

ZeroDivisionError?: float division by zero
Checksums match for track 0
Traceback (most recent call last):

File "/usr/bin/rip", line 35, in <module>

sys.exit(main.main(sys.argv[1:]))

File "/usr/lib/python2.7/dist-packages/morituri/rip/main.py", line 14, in main

ret = c.parse(argv)

File "/usr/lib/python2.7/dist-packages/morituri/rip/main.py", line 82, in parse

logcommand.LogCommand?.parse(self, argv)

File "/usr/lib/python2.7/dist-packages/morituri/extern/command/command.py", line 335, in parse

return self.subCommands[command].parse(args[1:])

File "/usr/lib/python2.7/dist-packages/morituri/extern/command/command.py", line 335, in parse

return self.subCommands[command].parse(args[1:])

File "/usr/lib/python2.7/dist-packages/morituri/extern/command/command.py", line 304, in parse

ret = self.do(args)

File "/usr/lib/python2.7/dist-packages/morituri/rip/cd.py", line 260, in do

ripIfNotRipped(0)

File "/usr/lib/python2.7/dist-packages/morituri/rip/cd.py", line 236, in ripIfNotRipped

print 'Peak level: %.2f %%' % (math.sqrt(trackResult.peak) * 100.0, )

TypeError?: a float is required

comment:10 Changed 19 months ago by https://www.google.com/accounts/o8/id?id=aitoawkad9alfynukc51o7rypuoylxx_algep3e

Here’s a debug version, with RIP_DEBUG=5:

DEBUG [ 9232] "<ReadTrackTask?>" Task Oct 20 15:18:54 set exception, "exception FileSizeError? at /usr/lib/python2.7/dist-packages/morituri/program/cdparanoia.py:347: _done(): (u'/tmp/tmpQfMmu5.morituri.wav', 'File size 0 did not match expected size 75308')" (morituri/common/task.py:145)
DEBUG [ 9232] "<SyncRunner?>" TaskRunner? Oct 20 15:18:54 exception when calling scheduled callable <bound method ReadTrackTask?._read of <morituri.program.cdparanoia.ReadTrackTask? object at 0xa0ce9cc>> (morituri/common/task.py:455)
DEBUG [ 9232] "<ReadTrackTask?>" Task Oct 20 15:18:54 set exception, ZeroDivisionError?('float division by zero',), 'exception ZeroDivisionError? at morituri/program/cdparanoia.py:179: getTrackQuality(): float division by zero' (morituri/common/task.py:159)
DEBUG [ 9232] "<SyncRunner?>" TaskRunner? Oct 20 15:18:54 stopped task <morituri.program.cdparanoia.ReadTrackTask? object at 0xa0ce9cc> (morituri/common/task.py:493)
Traceback (most recent call last):

File "/usr/lib/python2.7/dist-packages/morituri/common/task.py", line 451, in c

callable(*args, kwargs)

File "/usr/lib/python2.7/dist-packages/morituri/program/cdparanoia.py", line 283, in _read

self._done()

File "/usr/lib/python2.7/dist-packages/morituri/program/cdparanoia.py", line 356, in _done

self.quality = self._parser.getTrackQuality()

File "/usr/lib/python2.7/dist-packages/morituri/program/cdparanoia.py", line 179, in getTrackQuality

return min(frames * 2.0 / reads, 1.0)

ZeroDivisionError?: float division by zero
DEBUG [ 9232] "<SyncRunner?>" TaskRunner? Oct 20 15:18:54 done running task <morituri.program.cdparanoia.ReadVerifyTrackTask? object at 0x9eb1c0c> (morituri/common/task.py:423)
Checksums match for track 0
Traceback (most recent call last):

File "/usr/bin/rip", line 35, in <module>

sys.exit(main.main(sys.argv[1:]))

File "/usr/lib/python2.7/dist-packages/morituri/rip/main.py", line 14, in main

ret = c.parse(argv)

File "/usr/lib/python2.7/dist-packages/morituri/rip/main.py", line 82, in parse

logcommand.LogCommand?.parse(self, argv)

File "/usr/lib/python2.7/dist-packages/morituri/extern/command/command.py", line 335, in parse

return self.subCommands[command].parse(args[1:])

File "/usr/lib/python2.7/dist-packages/morituri/extern/command/command.py", line 335, in parse

return self.subCommands[command].parse(args[1:])

File "/usr/lib/python2.7/dist-packages/morituri/extern/command/command.py", line 304, in parse

ret = self.do(args)

File "/usr/lib/python2.7/dist-packages/morituri/rip/cd.py", line 260, in do

ripIfNotRipped(0)

File "/usr/lib/python2.7/dist-packages/morituri/rip/cd.py", line 236, in ripIfNotRipped

print 'Peak level: %.2f %%' % (math.sqrt(trackResult.peak) * 100.0, )

TypeError?: a float is required

Note: See TracTickets for help on using tickets.