Crash dumping HDD with custom --max-blocks value #796

Closed
opened 2026-01-29 15:29:53 +00:00 by claunia · 0 comments
Owner

Originally created by @TheRogueArchivist on GitHub (Aug 13, 2021).

Prerequisites

  • Are you running the latest version?
  • Can you reproduce the problem in the debug version?

Check and fill as appropriate:

  • I was running Aaru under Windows 10...
  • I was running Aaru under Linux [version here]...
  • I was running Aaru under macOS [version here]...
  • ...in 32-bit
  • ...in 64-bit
  • ...using an Intel / AMD processor
  • ...using an ARM or Apple Silicon processor
  • Device manufacturer:
  • Model:
  • Bus:
    • Parallel ATA
    • Serial ATA
    • SCSI (any)
    • ATAPI (mark above if parallel or serial)
    • USB
      • USB cable manufacturer:
      • USB cable model:
    • FireWire
    • PCMCIA
    • SecureDigital
      • Using a USB card reader
        • USB card reader manufacturer:
        • USB card reader model:
    • MultiMediaCard
      • Using a USB card reader
        • USB card reader manufacturer:
        • USB card reader model:
  • I was dumping media (disk, tape, etc)...
  • I was analyzing media (disk, tape, etc)...
  • I was scanning media (disk, tape, etc)...

Description

When dumping an HDD with a custom --max-blocks value (Tried 256 and 128), Aaru crashes.

Exact command line used:

Aaru m dump \\.\PHYSICALDRIVE1 Test.aaruf --max-blocks 256

Output of command execution with debug output enabled

aaru 5.2.99.3380-alpha+10d286ad built by DESKTOP-8B4K7NM in Debug
Copyright c 2011-2021 Natalia Portillo

Output image format: Aaru Format.
Device not in database, please create a device report and attach it to a Github issue.
Requesting ATA IDENTIFY DEVICE.
Initializing reader.
Using ATA READ DMA EXT command.
Unhandled exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.ArgumentException: Destination array was not long enough. Check the destination index, length, and the array's lower bounds. (Parameter 'destinationArray')
   at System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length, Boolean reliable)
   at System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length)
   at Aaru.Devices.Windows.Command.SendAtaCommand(SafeFileHandle fd, AtaRegistersLba48 registers, AtaErrorRegistersLba48& errorRegisters, AtaProtocol protocol, Byte[]& buffer, UInt32 timeout, Double& duration, Boolean& sense) in C:\Users\silas\Desktop\GIT\Aaru\Aaru.Devices\Windows\Command.cs:line 424
   at Aaru.Devices.Command.SendAtaCommand(PlatformID ptId, Object fd, AtaRegistersLba48 registers, AtaErrorRegistersLba48& errorRegisters, AtaProtocol protocol, AtaTransferRegister transferRegister, Byte[]& buffer, UInt32 timeout, Boolean transferBlocks, Double& duration, Boolean& sense) in C:\Users\silas\Desktop\GIT\Aaru\Aaru.Devices\Command.cs:line 376
   at Aaru.Devices.Device.SendAtaCommand(AtaRegistersLba48 registers, AtaErrorRegistersLba48& errorRegisters, AtaProtocol protocol, AtaTransferRegister transferRegister, Byte[]& buffer, UInt32 timeout, Boolean transferBlocks, Double& duration, Boolean& sense) in C:\Users\silas\Desktop\GIT\Aaru\Aaru.Devices\Device\Commands.cs:line 141
   at Aaru.Devices.Device.ReadDma(Byte[]& buffer, AtaErrorRegistersLba48& statusRegisters, UInt64 lba, UInt16 count, UInt32 timeout, Double& duration) in C:\Users\silas\Desktop\GIT\Aaru\Aaru.Devices\Device\AtaCommands\Ata48.cs:line 93
   at Aaru.Core.Devices.Reader.AtaGetBlocksToRead(UInt32 startWithBlocks) in C:\Users\silas\Desktop\GIT\Aaru\Aaru.Core\Devices\ReaderATA.cs:line 294
   at Aaru.Core.Devices.Reader.GetBlocksToRead(UInt32 startWithBlocks) in C:\Users\silas\Desktop\GIT\Aaru\Aaru.Core\Devices\Reader.cs:line 125
   at Aaru.Core.Devices.Dumping.Dump.Ata() in C:\Users\silas\Desktop\GIT\Aaru\Aaru.Core\Devices\Dumping\ATA.cs:line 130
   at Aaru.Core.Devices.Dumping.Dump.Start() in C:\Users\silas\Desktop\GIT\Aaru\Aaru.Core\Devices\Dumping\Dump.cs:line 225
   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 C:\Users\silas\Desktop\GIT\Aaru\Aaru\Commands\Media\Dump.cs:line 680
   --- 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()```

### Media details
<!-- Photo, EAN-13, if possible eBay link -->
Originally created by @TheRogueArchivist on GitHub (Aug 13, 2021). ### Prerequisites * [X] Are you running the latest version? * [X] Can you reproduce the problem in the debug version? ### Check and fill as appropriate: * [X] I was running Aaru under Windows 10... * [ ] I was running Aaru under Linux [version here]... * [ ] I was running Aaru under macOS [version here]... * [ ] ...in 32-bit * [X] ...in 64-bit * [X] ...using an Intel / AMD processor * [ ] ...using an ARM or Apple Silicon processor * **Device manufacturer**: * **Model**: * **Bus**: * [ ] Parallel ATA * [X] Serial ATA * [ ] SCSI (any) * [ ] ATAPI (mark above if parallel or serial) * [ ] USB * **USB cable manufacturer**: * **USB cable model**: * [ ] FireWire * [ ] PCMCIA * [ ] SecureDigital * [ ] Using a USB card reader * **USB card reader manufacturer**: * **USB card reader model**: * [ ] MultiMediaCard * [ ] Using a USB card reader * **USB card reader manufacturer**: * **USB card reader model**: * [X] I was dumping media (disk, tape, etc)... * [ ] I was analyzing media (disk, tape, etc)... * [ ] I was scanning media (disk, tape, etc)... ### Description <!-- Description of the bug --> When dumping an HDD with a custom --max-blocks value (Tried 256 and 128), Aaru crashes. ### Exact command line used: `Aaru m dump \\.\PHYSICALDRIVE1 Test.aaruf --max-blocks 256` ### Output of command execution with debug output enabled ``` aaru 5.2.99.3380-alpha+10d286ad built by DESKTOP-8B4K7NM in Debug Copyright c 2011-2021 Natalia Portillo Output image format: Aaru Format. Device not in database, please create a device report and attach it to a Github issue. Requesting ATA IDENTIFY DEVICE. Initializing reader. Using ATA READ DMA EXT command. Unhandled exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: Destination array was not long enough. Check the destination index, length, and the array's lower bounds. (Parameter 'destinationArray') at System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length, Boolean reliable) at System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length) at Aaru.Devices.Windows.Command.SendAtaCommand(SafeFileHandle fd, AtaRegistersLba48 registers, AtaErrorRegistersLba48& errorRegisters, AtaProtocol protocol, Byte[]& buffer, UInt32 timeout, Double& duration, Boolean& sense) in C:\Users\silas\Desktop\GIT\Aaru\Aaru.Devices\Windows\Command.cs:line 424 at Aaru.Devices.Command.SendAtaCommand(PlatformID ptId, Object fd, AtaRegistersLba48 registers, AtaErrorRegistersLba48& errorRegisters, AtaProtocol protocol, AtaTransferRegister transferRegister, Byte[]& buffer, UInt32 timeout, Boolean transferBlocks, Double& duration, Boolean& sense) in C:\Users\silas\Desktop\GIT\Aaru\Aaru.Devices\Command.cs:line 376 at Aaru.Devices.Device.SendAtaCommand(AtaRegistersLba48 registers, AtaErrorRegistersLba48& errorRegisters, AtaProtocol protocol, AtaTransferRegister transferRegister, Byte[]& buffer, UInt32 timeout, Boolean transferBlocks, Double& duration, Boolean& sense) in C:\Users\silas\Desktop\GIT\Aaru\Aaru.Devices\Device\Commands.cs:line 141 at Aaru.Devices.Device.ReadDma(Byte[]& buffer, AtaErrorRegistersLba48& statusRegisters, UInt64 lba, UInt16 count, UInt32 timeout, Double& duration) in C:\Users\silas\Desktop\GIT\Aaru\Aaru.Devices\Device\AtaCommands\Ata48.cs:line 93 at Aaru.Core.Devices.Reader.AtaGetBlocksToRead(UInt32 startWithBlocks) in C:\Users\silas\Desktop\GIT\Aaru\Aaru.Core\Devices\ReaderATA.cs:line 294 at Aaru.Core.Devices.Reader.GetBlocksToRead(UInt32 startWithBlocks) in C:\Users\silas\Desktop\GIT\Aaru\Aaru.Core\Devices\Reader.cs:line 125 at Aaru.Core.Devices.Dumping.Dump.Ata() in C:\Users\silas\Desktop\GIT\Aaru\Aaru.Core\Devices\Dumping\ATA.cs:line 130 at Aaru.Core.Devices.Dumping.Dump.Start() in C:\Users\silas\Desktop\GIT\Aaru\Aaru.Core\Devices\Dumping\Dump.cs:line 225 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 C:\Users\silas\Desktop\GIT\Aaru\Aaru\Commands\Media\Dump.cs:line 680 --- 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()``` ### Media details <!-- Photo, EAN-13, if possible eBay link -->
claunia added the bug label 2026-01-29 15:29:53 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: aaru-dps/Aaru-aaru-dps#796