AdaCore / adareducer

GNU General Public License v3.0
13 stars 2 forks source link

IndexError: list index out of range #31

Open glacambre opened 2 years ago

glacambre commented 2 years ago

Adareducer version: 34a8ebca8f682ed9d03ef319d8afc6144bc417c3

Traceback (most recent call last):
  File "/homes/lacambre/adareducer/ada_reducer/main.py", line 38, in <module>
    main()
  File "/home/lacambre/uwrap/wave/x86_64-linux/langkit/install/lib/python3.9/site-packages/click/core.py", line 1137, in __call__
    return self.main(*args, **kwargs)
  File "/home/lacambre/uwrap/wave/x86_64-linux/langkit/install/lib/python3.9/site-packages/click/core.py", line 1062, in main
    rv = self.invoke(ctx)
  File "/home/lacambre/uwrap/wave/x86_64-linux/langkit/install/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/lacambre/uwrap/wave/x86_64-linux/langkit/install/lib/python3.9/site-packages/click/core.py", line 763, in invoke
    return __callback(*args, **kwargs)
  File "/homes/lacambre/adareducer/ada_reducer/main.py", line 34, in main
    gui.GUI.run(r)
  File "/homes/lacambre/adareducer/ada_reducer/gui.py", line 19, in run
    self.engine.run()
  File "/homes/lacambre/adareducer/ada_reducer/engine.py", line 256, in run
    self.reduce_file(candidate)
  File "/homes/lacambre/adareducer/ada_reducer/engine.py", line 368, in reduce_file
    chars_removed = self.apply_strategies_on_file(file, buf)
  File "/homes/lacambre/adareducer/ada_reducer/engine.py", line 275, in apply_strategies_on_file
    HollowOutSubprograms().run_on_file(
  File "/homes/lacambre/adareducer/ada_reducer/hollow_body.py", line 98, in run_on_file
    return dichototree(t, predicate, save)
  File "/homes/lacambre/adareducer/ada_reducer/dichotomy.py", line 91, in dichototree
    actioned, not_actioned = dichotomize(to_test, predicate, save)
  File "/homes/lacambre/adareducer/ada_reducer/dichotomy.py", line 17, in dichotomize
    chunk.do()
  File "/homes/lacambre/adareducer/ada_reducer/dichotomy.py", line 48, in do
    self.element.do()
  File "/homes/lacambre/adareducer/ada_reducer/hollow_body.py", line 55, in do
    self.statements_range, self.statements_lines = replace(
  File "/homes/lacambre/adareducer/ada_reducer/types.py", line 75, in replace
    lines[sloc_range.start.line][0 : sloc_range.start.column - 1]
IndexError: list index out of range

I'm attaching the zipped directory that adareducer left after dying. I'll upgrade adareducer to its most recent version and try to figure out where this is coming from.

setton commented 2 years ago

I had a go at it but need uwrap.gpr:2:06: imported project file "libtemplatelang" not found uwrap.gpr:3:06: imported project file "libtestlang" not found

glacambre commented 2 years ago

Right, sorry, you also need to run source env.sh before attempting a reduce. And you might actually need to go through all the steps in the README :/. Uwrap is a pain to work with, don't force yourself to delve into that :)

setton commented 2 years ago

okay, it's running now. Do you have the source file on which this appeared, by any chance, to speed it up?

glacambre commented 2 years ago

I don't (I lost the output of my command, sorry). However I was left with a src/wrapping-runtime-structure.adb.crash file (which is available in the zip file). Could that be the one?

setton commented 2 years ago

I'll try!

setton commented 2 years ago

So, after a lot of processing, I can reproduce - not exactly this, but an inconsistency after processing a file. I'll need to add a master debug mode to understand what's happening.