brendan-duncan / archive

Dart library to encode and decode various archive and compression formats, such as Zip, Tar, GZip, ZLib, and BZip2.
MIT License
411 stars 141 forks source link

Crash when extracting XZ archive #209

Closed omnicron-llc closed 1 year ago

omnicron-llc commented 2 years ago

Extracting an archive file created with tar -J gives the following error:

022-05-25 16:39:44.090115-0600 Runner[27991:37388133] [VERBOSE-2:ui_dart_state.cc(198)] Unhandled Exception: LateInitializationError: Field '_input@76520520' has already been initialized.

0 LateError._throwFieldAlreadyInitialized (dart:_internal-patch/internal_patch.dart:194:5)

1 RangeDecoder._input= (package:archive/src/lzma/range_decoder.dart:33:30)

2 RangeDecoder.input= (package:archive/src/lzma/range_decoder.dart:45:39)

3 LzmaDecoder.decode (package:archive/src/lzma/lzma_decoder.dart:142:12)

4 _XZStreamDecoder._readLZMA2 (package:archive/src/xz_decoder.dart:287:26)

5 _XZStreamDecoder._readBlock (package:archive/src/xz_decoder.dart:143:5)

6 _XZStreamDecoder.decode (package:archive/src/xz_decoder.dart:59:7)

7 XZDecoder.decodeBuffer (package:archive/src/xz_decoder.dart:22:20)

8 main (package:unity_mlm/main.dart:46:30)

mz2 commented 2 years ago

I am seeing this too (with version 3.3.1 of archive):

  LateInitializationError: Field '_input@80520520' has already been initialized.
  dart:_internal                                                            LateError._throwFieldAlreadyInitialized
  package:archive/src/lzma/range_decoder.dart 33:30                         RangeDecoder._input=
  package:archive/src/lzma/range_decoder.dart 45:39                         RangeDecoder.input=
  package:archive/src/lzma/lzma_decoder.dart 142:12                         LzmaDecoder.decode
  package:archive/src/xz_decoder.dart 287:26                                _XZStreamDecoder._readLZMA2
  package:archive/src/xz_decoder.dart 143:5                                 _XZStreamDecoder._readBlock
  package:archive/src/xz_decoder.dart 59:7                                  _XZStreamDecoder.decode
  package:archive/src/xz_decoder.dart 22:20                                 XZDecoder.decodeBuffer
  package:archive/src/xz_decoder.dart 17:12                                 XZDecoder.decodeBytes
brendan-duncan commented 2 years ago

Can you include a repo xz?

craigmparis commented 1 year ago

@brendan-duncan

I am seeing this when trying to extract NodeJS 16.18.0

https://nodejs.org/dist/v16.18.0/node-v16.18.0-linux-x64.tar.xz

brendan-duncan commented 1 year ago

Thanks. I'll look into it as soon as I can.

Areopagitics commented 1 year ago

Any luck with this? I have the same error

brendan-duncan commented 1 year ago

Sorry, I forgot about this one. I'll start looking at it now.

brendan-duncan commented 1 year ago

I pushed out some fixes in Archive 3.3.6. Sorry it took a while, it was a hard to find bug.