imchillin / CMTool

MIT License
206 stars 49 forks source link

I have an exception. The exception tells you that you are trying to access elements that do not exist 'out of bounds' - 'greater than the number of elements'. #77

Closed ProphStar closed 3 years ago

ProphStar commented 3 years ago

Concept Matirx ran into an error.

Please submit a bug report with the following information.

====================================================== System.AggregateException: A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread. ---> System.ArgumentException: Offset plus count is larger than the length of target array. at System.IO.Compression.DeflateStream.ValidateParameters(Byte[] array, Int32 offset, Int32 count) at System.IO.Compression.DeflateStream.Read(Byte[] array, Int32 offset, Int32 count) at Lumina.Data.SqPackStream.ReadFileBlock(Int64 offset, MemoryStream dest, Byte[] buffer, Boolean resetPosition) at Lumina.Data.SqPackStream.ReadTextureFile(FileResource resource, Byte[] buffer, MemoryStream ms) at Lumina.Data.SqPackStream.ReadFile[T](Int64 offset) at Lumina.Data.SqPack.ReadFile[T](Int64 offset) at Lumina.Data.Category.GetFile[T](ParsedFilePath path) at Lumina.Data.Repository.GetFile[T](Byte cat, ParsedFilePath path) at Lumina.Data.Repository.GetFile[T](String cat, ParsedFilePath path) at Lumina.GameData.GetFile[T](String path) at Lumina.Extensions.LuminaExtensions.GetIcon(GameData gameData, Int32 iconId) at ConceptMatrix.Utility.ExdCsvReader.<>c.b27_1(Status s) at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext() at MS.Internal.Data.EnumerableCollectionView.LoadSnapshotCore(IEnumerable source) at MS.Internal.Data.EnumerableCollectionView..ctor(IEnumerable source) at MS.Internal.Data.ViewManager.GetViewRecord(Object collection, CollectionViewSource cvs, Type collectionViewType, Boolean createView, Func2 GetSourceItem) at MS.Internal.Data.DataBindEngine.GetViewRecord(Object collection, CollectionViewSource key, Type collectionViewType, Boolean createView, Func2 GetSourceItem) at System.Windows.Data.CollectionViewSource.GetDefaultCollectionView(Object source, Boolean createView, Func2 GetSourceItem) at System.Windows.Data.CollectionViewSource.GetDefaultCollectionView(Object source, DependencyObject d, Func2 GetSourceItem) at System.Windows.Controls.ItemCollection.SetItemsSource(IEnumerable value, Func2 GetSourceItem) at System.Windows.Controls.ItemsControl.OnItemsSourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e) at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e) at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args) at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType) at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal) at System.Windows.Controls.ItemsControl.set_ItemsSource(IEnumerable value) at ConceptMatrix.ViewModel.MainViewModel.<>c.b42_20() at System.Windows.Threading.DispatcherOperation1.InvokeDelegateCore() at System.Windows.Threading.DispatcherOperation.InvokeImpl() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Windows.Threading.DispatcherOperation.Wait(TimeSpan timeout) at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherOperation operation, CancellationToken cancellationToken, TimeSpan timeout) at System.Windows.Threading.Dispatcher.Invoke[TResult](Func1 callback, DispatcherPriority priority, CancellationToken cancellationToken, TimeSpan timeout) at System.Windows.Threading.Dispatcher.Invoke[TResult](Func1 callback) at System.Threading.Tasks.Task.Execute() --- End of inner exception stack trace --- ---> (Inner Exception #0) System.ArgumentException: Offset plus count is larger than the length of target array. at System.IO.Compression.DeflateStream.ValidateParameters(Byte[] array, Int32 offset, Int32 count) at System.IO.Compression.DeflateStream.Read(Byte[] array, Int32 offset, Int32 count) at Lumina.Data.SqPackStream.ReadFileBlock(Int64 offset, MemoryStream dest, Byte[] buffer, Boolean resetPosition) at Lumina.Data.SqPackStream.ReadTextureFile(FileResource resource, Byte[] buffer, MemoryStream ms) at Lumina.Data.SqPackStream.ReadFile[T](Int64 offset) at Lumina.Data.SqPack.ReadFile[T](Int64 offset) at Lumina.Data.Category.GetFile[T](ParsedFilePath path) at Lumina.Data.Repository.GetFile[T](Byte cat, ParsedFilePath path) at Lumina.Data.Repository.GetFile[T](String cat, ParsedFilePath path) at Lumina.GameData.GetFile[T](String path) at Lumina.Extensions.LuminaExtensions.GetIcon(GameData gameData, Int32 iconId) at ConceptMatrix.Utility.ExdCsvReader.<>c.<GetStatuses>b__27_1(Status s) at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext() at MS.Internal.Data.EnumerableCollectionView.LoadSnapshotCore(IEnumerable source) at MS.Internal.Data.EnumerableCollectionView..ctor(IEnumerable source) at MS.Internal.Data.ViewManager.GetViewRecord(Object collection, CollectionViewSource cvs, Type collectionViewType, Boolean createView, Func2 GetSourceItem) at MS.Internal.Data.DataBindEngine.GetViewRecord(Object collection, CollectionViewSource key, Type collectionViewType, Boolean createView, Func2 GetSourceItem) at System.Windows.Data.CollectionViewSource.GetDefaultCollectionView(Object source, Boolean createView, Func2 GetSourceItem) at System.Windows.Data.CollectionViewSource.GetDefaultCollectionView(Object source, DependencyObject d, Func2 GetSourceItem) at System.Windows.Controls.ItemCollection.SetItemsSource(IEnumerable value, Func2 GetSourceItem) at System.Windows.Controls.ItemsControl.OnItemsSourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e) at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e) at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args) at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType) at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal) at System.Windows.Controls.ItemsControl.set_ItemsSource(IEnumerable value) at ConceptMatrix.ViewModel.MainViewModel.<>c.<Initialize>b__42_20() at System.Windows.Threading.DispatcherOperation1.InvokeDelegateCore() at System.Windows.Threading.DispatcherOperation.InvokeImpl() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Windows.Threading.DispatcherOperation.Wait(TimeSpan timeout) at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherOperation operation, CancellationToken cancellationToken, TimeSpan timeout) at System.Windows.Threading.Dispatcher.Invoke[TResult](Func1 callback, DispatcherPriority priority, CancellationToken cancellationToken, TimeSpan timeout) at System.Windows.Threading.Dispatcher.Invoke[TResult](Func1 callback) at System.Threading.Tasks.Task.Execute()<---

======================================================

Copy to clipboard?

ProphStar commented 3 years ago

CMtool issue

ProphStar commented 3 years ago

I have an exception. The exception tells you that you are trying to access elements that do not exist 'out of bounds' - 'greater than the number of elements'.

Put a breakpoint on the offending line.

Run your code.

When execution pauses at the breakpoint

Q1) how many elements are there in 'numbers'?

Q2) What is the value of 'i'? How does that compare with the answer to Q1?

Q3) What is the value of 'range'?

Q4) What does 'i+range' equal? What is the value used for? (Check the MSDN documentation if you don't know).

Q5) Given the values of I and range and the definition of the 'Range' method which elements of 'numbers are you attempting to access? How does that compare with the answer to Q1?

(I don't need to know the answers to these questions - TSoftware has already given you the answers. They are the sorts of questions you should get used to asking yourself when you are debugging)

LeonBlade commented 3 years ago

This likely originated from a corrupted index file or something with installing mods. Starting over in TexTools should fix it.