Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RS03 is using the wrong image size for exhaustive scan when the user correctly specifies no-DM, causing random failures #99

Open
jjr90 opened this issue Aug 1, 2024 · 2 comments

Comments

@jjr90
Copy link

jjr90 commented Aug 1, 2024

When the user correctly specifies --no-bdr-defect-management, in exhaustive scan mode (bypassing the "Easy shot: Locate the ecc header"), dvdisaster will determine the disc as the next size up (dual-layer instead of single-layer, etc).

This is causing the exhaustive scan to fail unpredictably, in cases when it's needed:

In rs03-recognize.c:

      else if(image_sectors < BD_SL_SIZE)
         layer_size = (Closure->noBdrDefectManagement ? BD_SL_SIZE_NODM : BD_SL_SIZE)/GF_FIELDMAX;
      else if(image_sectors < BD_DL_SIZE)
         layer_size = (Closure->noBdrDefectManagement ? BD_DL_SIZE_NODM : BD_DL_SIZE)/GF_FIELDMAX;

As you can see, an SL image that's been augmented with no defect management will have an image_sectors GREATER THAN BD_SL_SIZE, and will thus match the image_sectors < BD_DL_SIZE instead.

dvdisaster thus detects a single-layer disc as a dual-layer disc, etc. This causes the layer_size variable to be double what it should be, and the exhaustive scan MAY fail, depending on how the scan alignment works out.

I can provide a test case to reproduce the unpredictability, but the wrong logic is easy to see there.

Disclaimer: I haven't looked at any of the RS01/02 code, don't know what might be applicable there.

@jjr90 jjr90 changed the title RS03 is detecting the image size incorrectly for no-DM discs RS03 is detecting the image size incorrectly for no-DM media in the exhaustive scan, causing random failures Aug 3, 2024
@jjr90
Copy link
Author

jjr90 commented Aug 3, 2024

The quick fix would be to determine the thresholds the same way you're determining the image size in the statements below (i.e. with the ?: operator again, or perhaps factor that out..)

@jjr90
Copy link
Author

jjr90 commented Aug 4, 2024

To clarify, this is a bug when the user correctly specifies --no-bdr-defect-management.

This is not caused by a user error.

@jjr90 jjr90 changed the title RS03 is detecting the image size incorrectly for no-DM media in the exhaustive scan, causing random failures RS03 is using the wrong image size for exhaustive scan when the user correctly specifies no-DM, causing random failures Aug 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant