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

"Parse error (RangeError): invalid or out-of-range index" after changing KSY in editor #143

Open
Mingun opened this issue Aug 8, 2022 · 1 comment

Comments

@Mingun
Copy link

Mingun commented Aug 8, 2022

Sometimes after changing KSY in editor (commenting part of the code, actually, to debug KSY), the clicking on the rows in the resulting parse tree does not select corresponding regions in HEX viewer. When I notice that for the first time, it was just silently broken, but after another occurrence of this bug I was an error in the Errors panel and that exception in the console:

Parse error (RangeError): invalid or out-of-range index
Call stack: get@https://ide.kaitai.io/devel/js/v1/app.js:141:32
update@https://ide.kaitai.io/devel/js/ui/Components/ConverterPanel.js:59:37
onHexViewerSelectionChanged@https://ide.kaitai.io/devel/js/v1/app.js:179:41
exports.app.ui.hexViewer.onSelectionChanged@https://ide.kaitai.io/devel/js/v1/app.js:203:73
reparse@https://ide.kaitai.io/devel/js/v1/app.js:99:35
 RangeError: invalid or out-of-range index
    get https://ide.kaitai.io/devel/js/v1/app.js:141
    update https://ide.kaitai.io/devel/js/ui/Components/ConverterPanel.js:59
    onHexViewerSelectionChanged https://ide.kaitai.io/devel/js/v1/app.js:179
    onSelectionChanged https://ide.kaitai.io/devel/js/v1/app.js:203
    reparse https://ide.kaitai.io/devel/js/v1/app.js:99
[raven.js:51:37](https://cdn.ravenjs.com/3.17.0/raven.js)
    2]</d/a[b raven.js:51
    show app.errors.js:11
    handle app.errors.js:46
    reparse app.js:116

Kaitai WebIDE version: 0.1-SNAPSHOT-e824b3e (2022-07-08 23:13:36, license)
Kaitai compiler version: 0.10-SNAPSHOT20220707.221105.bdee2103 (2022-07-07T22:11:05+00:00)

Probably to trigger the error you should:

  • trigger parse error, like invalid data for contents field: Parse error (ValidationNotEqualError): not equal, expected [30], but got [67]
  • comment out that part of KSY that triggers error, after commenting parsing should finished without errors (result tree is updated and contains expected data)
@Mingun
Copy link
Author

Mingun commented Aug 8, 2022

Still, freezing the selection the region in HEX viewer is not associated with this exception -- after reloading the page and experimenting a little with commenting/uncommenting my KSY, I see the freeze, but without exceptions in the console.

While I was writing this comment the freezing is gone and selecting node in the tree now again selects the region in HEX viewer.

Actually, behavior is very unstable, while I was writing update the HEX viewer again stop responding on the selection in the tree, but after some clicking on bytes the correct behavior was restored.

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