Scott Todd

Results 405 comments of Scott Todd

Minimal repro for the Python AddressSanitizer report (note: this shows up when using iree-turbine with example code like https://github.com/iree-org/iree-turbine/blob/4b451f84b03f87af21a9b785b0ddd68094f43ed8/examples/aot_mlp/mlp_export_simple.py#L45-L49) Seems to be related to `VmModule.wrap_buffer()` and `map_memory()` on a compiler...

> Try with copy_buffer instead of wrap_buffer just to eliminate variables. Removes any potential alignment or ownership issues. My tests pass a clean ASan report when I use `copy_buffer` instead...

Sorta figured out my python bindings debug setup: * Building with CMake and setting `PYTHONPATH` was not enough to get updated C++ code in the runtime, at least when I...

Sure. I'm not sure if there's actually an issue with `index_put_` at all... possibly all red herrings in my testing that were caused by `wrap_buffer`. Can still start a more...

This test looks quite similar to what I'm testing: https://github.com/iree-org/iree/blob/main/compiler/bindings/python/test/api/output_buffer_reference_test.py, and that is ASan-clean. I'll see where the code diverges and try to file a more focused issue once I...

* output_buffer_reference_test stops at ```python module = VmModule.wrap_buffer(instance, mapped_memory) context = VmContext(instance, modules=[module]) ``` * my test stops at ```python vm_module = ireert.load_vm_module( ireert.VmModule.wrap_buffer(config.vm_instance, out.map_memory()), config, ) ``` The setup...

> * Building with CMake and setting `PYTHONPATH` was not enough to get updated C++ code in the runtime, at least when I already had `iree-runtime` installed from pip. Maybe...

So the VM is trying to run the `__deinit` function on the module, but the module was already freed...? https://github.com/iree-org/iree/blob/71c07faba52f527b08abc73c652ba140f1d8aa54/runtime/src/iree/vm/context.c#L269-L270

Yeah, ASan is happy if I clear the loaded module before letting the program exit on its own: ```diff loaded_module = ireert.load_vm_module( wrapped_buffer, config, ) +loaded_module = None ```

This passes ASan, finishing with no leaks or segfaults: ```python instance = VmInstance() output = Output.open_membuffer() output.write(vmfb_contents) mapped_memory = output.map_memory() module = VmModule.wrap_buffer(instance, mapped_memory) context = VmContext(instance, modules=[module]) ``` This...