Aaru icon indicating copy to clipboard operation
Aaru copied to clipboard

Dumping large hard disks to Aaru format throws OverflowException when hashing image file

Open kkaisershot opened this issue 2 years ago • 1 comments

Version

5.3.0

Commit hash

No response

Tested debug version?

  • [X] Yes

Which operating systems have you used?

  • [ ] Windows
  • [X] Linux
  • [ ] macOS
  • [ ] Other

What is the architectural bit size you're using?

  • [ ] 32-bit
  • [X] 64-bit
  • [ ] Unsure or unknown

What processor are you using?

  • [X] An Intel or AMD
  • [ ] An ARM or Apple Silicon
  • [ ] Unsure or unknown

Device manufacturer

Seagate

Device model

2N1AP5-500

Bus the device uses to attach to the computer

  • [ ] Parallel ATA
  • [ ] Serial ATA
  • [ ] SCSI (any)
  • [ ] ATAPI (mark above if parallel or serial)
  • [X] USB
  • [ ] FireWire
  • [ ] PCMCIA
  • [ ] SecureDigital
  • [ ] MultiMediaCard

USB cable or card reader manufacturer

Unknown; cable included with drive

USB cable or card reader model

Unknown; cable included with drive

What were you doing when it failed?

  • [X] I was dumping media (disk, tape, etc)...
  • [ ] I was retrieving media (disk, tape, etc) information...
  • [ ] I was scanning media (disk, tape, etc)...
  • [ ] I was retrieving device information...

Description

Dumping large hard disks to Aaru format results in a "System.OverflowException: The input exceeds data types" at SpamSumContext.cs:119 upon nearly completing hashing the image file. I encountered this with a 2TB drive.

This is probably related to #722 and #649, however since this throws a different exception with a different drive than #722, and at a different point in the dumping process than #649, I filed this as a separate issue.

As in #722, the dropdown in the bug report form only lets me select 5.3.0 as the latest LTS version, however I was also able to reproduce this in 5.3.1, both release and debug builds.

Exact command line used

./aaru media dump -O compress=False,deduplicate=False -v -d /dev/sdb /mnt/NACM2YNL.aaruf 2>&1 | tee output.txt

Expected behavior

Hashing the image file should complete without error, proceeding to hash sectors and finally close the image.

Actual behavior

Hashing image file byte 221757046784 of 221757282061
Unhandled exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.OverflowException: The input exceeds data types.
   at Aaru.Checksums.SpamSumContext.End() in /home/claunia/Development/Aaru/Aaru/Aaru.Checksums/SpamSumContext.cs:line 119
   at Aaru.Core.Checksum.End() in /home/claunia/Development/Aaru/Aaru/Aaru.Core/Checksum.cs:line 491
   at Aaru.Core.Sidecar.Create() in /home/claunia/Development/Aaru/Aaru/Aaru.Core/Sidecar/Sidecar.cs:line 129
   at Aaru.Core.Devices.Dumping.Dump.Sbc(Dictionary`2 mediaTags, MediaType dskType, Boolean opticalDisc, Dump dvdDecrypt) in /home/claunia/Development/Aaru/Aaru/Aaru.Core/Devices/Dumping/Sbc/Dump.cs:line 1006
   at Aaru.Core.Devices.Dumping.Dump.Scsi() in /home/claunia/Development/Aaru/Aaru/Aaru.Core/Devices/Dumping/SCSI.cs:line 251
   at Aaru.Core.Devices.Dumping.Dump.Start() in /home/claunia/Development/Aaru/Aaru/Aaru.Core/Devices/Dumping/Dump.cs:line 248
   at Aaru.Commands.Media.DumpMediaCommand.Invoke(Boolean debug, Boolean verbose, String cicmXml, String devicePath, Boolean resume, String encoding, Boolean firstPregap, Boolean fixOffset, Boolean force, Boolean metadata, Boolean trim, String outputPath, String options, Boolean persistent, UInt16 retryPasses, UInt32 skip, Byte speed, Boolean stopOnError, String format, String subchannel, Boolean private, Boolean fixSubchannelPosition, Boolean retrySubchannel, Boolean fixSubchannel, Boolean fixSubchannelCrc, Boolean generateSubchannels, Boolean skipCdiReadyHole, Boolean eject, UInt32 maxBlocks, Boolean useBufferedReads, Boolean storeEncrypted, Boolean titleKeys) in /home/claunia/Development/Aaru/Aaru/Aaru/Commands/Media/Dump.cs:line 679
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at System.CommandLine.Invocation.ModelBindingCommandHandler.InvokeAsync(InvocationContext context)
   at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseParseErrorReporting>b__19_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass14_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<<UseVersionOption>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass21_0.<<UseTypoCorrections>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__20_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseParseDirective>b__18_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseDebugDirective>b__10_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__9_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass12_0.<<UseExceptionHandler>b__0>d.MoveNext()
Uploading statistics

Output of command execution with debug output enabled

Using the command line provided, I generated a full log from a debug build, however owing to its large size (11GB), I bzip2 compressed it and am hosting it here on Dropbox:

https://www.dropbox.com/s/f50fby6uy3srew8/output2tb.txt.bz2?dl=0

Media details

Seagate Portable Drive P/N: 2N1AP5-500 2TB

kkaisershot avatar Apr 08 '22 05:04 kkaisershot

Very interesting, it is a different error but it seems to happen in the same line of code as #722. Same general advice to workaround this issue should apply, thank you for being so diligent and noticing that the errors were different!

TheRogueArchivist avatar Apr 11 '22 00:04 TheRogueArchivist