bugCompact Disc Input and Control Library - Bugs: bug #37394, run_mmc_cmd_win32ioctl() does not...

 
 

bug #37394: run_mmc_cmd_win32ioctl() does not work

Submitted by:  -Deleted Account- <lrn>
Submitted on:  Wed 19 Sep 2012 10:24:04 AM UTC  
 
Category: run-time errorSeverity: 5 - Average
Item Group: libcdioStatus: Fixed
Privacy: PublicAssigned to: Rocky Bernstein <rocky>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Wed 26 Sep 2012 06:19:34 PM UTC, comment #9:

Tried 4c5369, log is attached. Also see the new bug i've made, about srcdir.

Now only two tests fail:

++ WARN: number of minutes (255) truncated to 99.
++ WARN: number of minutes (255) truncated to 99.
++ WARN: sense size returned 2048 is greater buffer size 512

FAIL: testisocd.exe

and

Discmode: CD-DA

CD-Text available in: English German
German selected.
CD-Text for Disc:
TITLE: Freudvolle Nächte
PERFORMER: Vereinigtes Katzenorchester
SONGWRITER: Verschiedene Liedschreiber
COMPOSER: Verschiedene Komponisten
MESSAGE: Für alle unsere Fans
ARRANGER: Tom Cat
UPC_EAN: 1234567890123
GENRE: Katzenhafte Klassik
DISC_ID: 1234567890
CD-Text for Track 1:
TITLE: Lied der Freude
PERFORMER: Felix und Die Schnurrer
SONGWRITER: Friedrich Schiller
COMPOSER: Ludwig van Beethoven
MESSAGE: Fritz und Louie waren einmal Punks
ARRANGER: Tom Cat
ISRC: XYBLG1101234
CD-Text for Track 2:
TITLE: Rubbeldiekatz
PERFORMER: Katzengang Schönheiten
SONGWRITER: Mutter Gans
COMPOSER: unbekannt
MESSAGE: Rupft die Gans
ISRC: XYBLG1100005
CD-Text for Track 3:
TITLE: Mie auu
PERFORMER: Mia Kätzchen
SONGWRITER: Mia Kätzchen
COMPOSER: Mia Kätzchen
ARRANGER: Mia Kätzchen
ISRC: XYBLG1100006
++ WARN: sense size returned 4 is greater buffer size 512

FAIL: cdtext.exe

(file #26650)

-Deleted Account- <lrn>
Wed 26 Sep 2012 04:50:36 AM UTC, comment #8:

OK, there was no mystery after all. I didn't patch the source with the structure-packing patch (see https://savannah.gnu.org/bugs/?37392 ), and that was the source of the problems.
Attached make check log. - now it's much better.

So yes, this bug is fixed.

(file #26640)

-Deleted Account- <lrn>
Wed 26 Sep 2012 12:56:57 AM UTC, comment #7:

Yes, probably more byte versus int problems. On my cygwin and mingw setups I don't get the size mismatches.

Thanks in advance for tracking down.

Rocky Bernstein <rocky>
Project AdministratorIn charge of this item.
Wed 26 Sep 2012 12:28:28 AM UTC, comment #6:

make check -k log is attached.

Don't mind the "can't find the file" errors. Common problem with check-based testsuites.

What worries me:

Assertion failed: sizeof (buf) == 12, file image/nrg.c, line 194

and this:

checking sizeof (msf_t) ...ok!
checking sizeof (iso_volume_descriptor_t) ...ok!
checking sizeof (iso9660_pvd_t) ...failed!
==> sizeof (iso9660_pvd_t) == 2060 (but should be 2048)
checking sizeof (iso_path_table_t) ...failed!
==> sizeof (iso_path_table_t) == 10 (but should be 8)
checking sizeof (iso9660_dir_t) ...failed!
==> sizeof (iso9660_dir_t) == 41 (but should be 33)
checking sizeof (iso9660_xa_t) ...ok!
FAIL: check_sizeof.exe

This was fixed by one of my previous patches, and now it rears its ugly head again.

I'll try to track it down again.

(file #26637)

-Deleted Account- <lrn>
Tue 25 Sep 2012 08:22:24 PM UTC, comment #5:

I think this is fixed in commit b2180ff and 3b7ae05

All regression tests work for me on cygwin and MinGW.

Rocky Bernstein <rocky>
Project AdministratorIn charge of this item.
Fri 21 Sep 2012 05:53:26 PM UTC, comment #4:

A wild guess (the other structure field nearby was 512, so i guessed that this would be a good buffer to have).

You mean dw_bytes_returned?

Both pieces of code are DeviceIoControl-based. The difference is that one uses passthrough, while the other uses passthroughdirect. I'm not sure how to do midifications you suggest (i have absolutely no idea how SCSI works in general, and how libcdio works in particular). Maybe a patch?

NT 6.1.7601
IDE\CdRomOptiarc_DVD_RW_AD-7241S_________________1.01____
IDE\Optiarc_DVD_RW_AD-7241S_________________1.01____
IDE\CdRomOptiarc_DVD_RW_AD-7241S_________________
Optiarc_DVD_RW_AD-7241S_________________1.01____
GenCdRom
using generic cdrom.sys 6.1.7600.16385 from MS.

-Deleted Account- <lrn>
Fri 21 Sep 2012 05:24:28 PM UTC, comment #3:

I can't find googling on the internet any justification for having a sense response buffer be 512 bytes. In fact somewhat the opposite: that for larger reponses there is an "extra" request thing around.

What is it that lead you to use 512 bytes? You may have done this, but one can modify win32_ioctl.c so that it display the sense repsonse length. I would be interested to know exactly what that number is.

Did you also try increasing the buffer length to 512 on the DeviceIOControl based code?

Finally, I would like know what version of MSWindows you are using and the model and manufacturer of your drive.

Thanks.

Rocky Bernstein <rocky>
Project AdministratorIn charge of this item.
Fri 21 Sep 2012 06:01:56 AM UTC, comment #2:

Please, don't link to osdir.com, it forbids accessing archives from my country.

No, if i modify my hack-patch to have 252 bytes for sense buffer instead of 512, mmc_write starts to fail with the same message again, mmc2a can't get any data, again.

-Deleted Account- <lrn>
Fri 21 Sep 2012 02:27:13 AM UTC, comment #1:

It is possible that the SCSI sense buffer size has changed over time from 16, to 64, to 252.

See linux.scsi sense buffer size thread for example.

Does changing the 512 to 252 value still keep this working?

If so, does change line 104 of include/cdio/mmc.h asb[46] to a asb[238] keep things fixed?

Rocky Bernstein <rocky>
Project AdministratorIn charge of this item.
Wed 19 Sep 2012 10:24:04 AM UTC, original submission:

run_mmc_cmd_win32ioctl() fails during mmc* tests.
This is mmc tests' output for vanilla libcdio-8f44259:

Wait for drive error
FAIL: mmc_read.exe
Error: Drive not ready. Only 4 sense bytes. Expected >= 18.
FAIL: mmc_write.exe
PASS: nrg.exe

Vendor: Optiarc
Model: DVD RW AD-7241S
Revision: 1.01
Can't determine if disc is erasable.
disc type: profile is DVD+R - DVD Recordable (0x1B)
PASS: mmc1.exe
Didn't get all feature codes.
CD-ROM is an ATAPI interface.
PASS: mmc2.exe
Couldn't get MODE_SENSE 6 data.
Couldn't get MODE_SENSE 10 data.
PASS: mmc2a.exe
CD-ROM drive \\.\H: is closed.
CD-ROM drive \\.\H: media not changed since last test.
++ WARN: mciSendCommand() error: The specified file cannot be played on the specified MCI device. The file may be corrupt, not in the correct format, or no file handler available for this format.
CD-ROM drive \\.\H: is closed.
CD-ROM drive \\.\H: media not changed since last test.
++ WARN: mciSendCommand() error: The specified file cannot be played on the specified MCI device. The file may be corrupt, not in the correct format, or no file handler available for this format.
PASS: mmc3.exe

I've noticed that there's another version of this function, disabled with #if 1. I enabled it, patched the code a bit to compile again (patch is attached; it's not release-quality). Here's test output:

Error: Deliberately illegal command yields only 1 sense bytes. Expected >= 18.
FAIL: mmc_read.exe
Warning: test_rwr_mode_page() had minor failure.
test_rwr_mode_page: Cannot set mode page 05h.
PASS: mmc_write.exe

Vendor: Optiarc
Model: DVD RW AD-7241S
Revision: 1.01
Disc is not erasable.
disc type: profile is DVD+R - DVD Recordable (0x1B)
PASS: mmc1.exe
Didn't get all feature codes.
CD-ROM is an ATAPI interface.
PASS: mmc2.exe
Mode sense 6 information for \\.\H::
Delivers composition A/V stream.
Supports digital output on port 1.
Reads Mode-2 form 2 media.
READ CD data stream is accurate.
Reads R-W subchannel information.
Supports C2 error pointers.
Reads ISRC information.
PREVENT/ALLOW may lock media.
Lock state is locked.
PREVENT/ALLOW jumper is present.
Ejects media with START STOP UNIT.
Loading mechanism type is 1: tray type loading mechanism.
Volume controls each channel separately.
Has a changer that supports disc present reporting.
Can load empty slot in changer.
Reads raw R-W subchannel information from lead in.
Maximum read speed is 61815 K bytes/sec (about 351X)
Number of Volume levels is 10528
Buffers size for data is 22160 KB
Current read speed is 0 KB
Maximum write speed is 22160 KB
Current write speed is 27700 KB
Mode sense 10 information for \\.\H::
Reads CD-R media.
Reads DVD-RAM media.
Lock state is unlocked.
PREVENT/ALLOW jumper is not present.
Loading mechanism type is 0: caddy type loading mechanism.
Maximum read speed is 10806 K bytes/sec (about 61X)
Number of Volume levels is 16183
Buffers size for data is 61815 KB
Current read speed is 10528 KB
Maximum write speed is 0 KB
Current write speed is 27700 KB
PASS: mmc2a.exe
CD-ROM drive \\.\H: is closed.
CD-ROM drive \\.\H: media not changed since last test.
++ WARN: mciSendCommand() error: The specified file cannot be played on the specified MCI device. The file may be corrupt, not in the correct format, or no file handler available for this format.
CD-ROM drive \\.\H: is closed.
CD-ROM drive \\.\H: media not changed since last test.
++ WARN: mciSendCommand() error: The specified file cannot be played on the specified MCI device. The file may be corrupt, not in the correct format, or no file handler available for this format.
PASS: mmc3.exe

So, mmc2a gets mode sense info, and mmc_write passes with this alternative implementation. I still have no idea why DeviceIoControl() would fail though.

-Deleted Account- <lrn>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #26650:  check.log added by lrn (15KiB - application/octet-stream)
file #26640:  check.log added by lrn (15KiB - application/octet-stream - Log from `make check -k')
file #26637:  check.log added by lrn (18KiB - application/octet-stream)
file #26588:  0009-Fix-DeviceIOControl-invocation.all.patch added by lrn (950B - text/x-diff - A hack to switch to the other run_mmc_cmd_win32ioctl() implementation)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rocky (Posted a comment)
  • -unavailable- added by lrn (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 27 Sep 2012 01:08:47 AM UTCrockyStatusNone=>Fixed
      Assigned toNone=>rocky
      Open/ClosedOpen=>Closed
    Wed 26 Sep 2012 06:19:34 PM UTClrnAttached File-=>Added check.log, #26650
    Wed 26 Sep 2012 04:50:36 AM UTClrnAttached File-=>Added check.log, #26640
    Wed 26 Sep 2012 12:28:28 AM UTClrnAttached File-=>Added check.log, #26637
    Wed 19 Sep 2012 10:24:04 AM UTClrnAttached File-=>Added 0009-Fix-DeviceIOControl-invocation.all.patch, #26588

    Back to the top


    Powered by Savane 3.1-cleanup1