Closed dxxb closed 6 years ago
Segfault happens in memcpy() and is caused by simavr's load_hex function. There was another report of this and current suspicion is that another version of libsimavr is being linked (probably a system wide installed one).
I'm experiencing a similar issue after updating the repo and removing osx-cross/avr/simavr
in favor of libelf
as mentioned here.
./sim_arduboy ../crates/crates.ino.leonardo.hex
Keymap: 1073741906,1073741905,1073741904,1073741903,122,120
[1] 44410 segmentation fault ./sim_arduboy ../crates/crates.ino.leonardo.hex
@jessemillar, it's hard to debug this without visibility into what happens at compile time. Removing all other copies of libsimavr.a (the ones outside the simavr subdirectory) and rebuilding from scratch should fix this. I'll check the makefile to see if it can be improved by giving the 'private' version of libsimavr priority over systemwide ones.
FYI libelf is needed to satisfy simavr build process and not used by sim_arduboy because .hex file are much simpler representation of the MCUs firmware.
Hi @jessemillar, I just pushed some changes to the Makefile which could fix the issue. Previously the Makefile was relying on common makefile rules from simavr which may have resulted in the wrong library being linked into the final executable. Please let me know if this helps.
That seems to have fixed it for me. Compilation and running works both before and after running brew remove osx-cross/avr/simavr && brew untap osx-cross/avr
.
Great, if only I had a way or notifying the original creator of this issue >.<!
@dxxb I just posted a comment in the original issue thread pointing here and mentioned the original reporter. That's probably good enough. https://github.com/arduboy-emulator/sim-arduboy/issues/3#issuecomment-377381855
Dave Stanley reports: