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

Avrdude segfaults when writing ihex or srec files for some parts #1390

Closed
stefanrueger opened this issue Jun 10, 2023 · 2 comments · Fixed by #1392
Closed

Avrdude segfaults when writing ihex or srec files for some parts #1390

stefanrueger opened this issue Jun 10, 2023 · 2 comments · Fixed by #1392
Assignees
Labels
bug Something isn't working

Comments

@stefanrueger
Copy link
Collaborator

While reviewing fileio.c I could not help noticing that memory offsets of some parts are not dealt with correctly and can cause segmentation faults when writing Intel Hex or Motorola S-Record files:

$ avrdude -qq -p AT32UC3A0512 -c dryrun -A -U flash:r:out.hex:i
Segmentation fault (core dumped)

$ avrdude -qq -p AT32UC3A0512 -c dryrun -A -U flash:r:out.srec:s
Segmentation fault (core dumped)
@stefanrueger stefanrueger added the bug Something isn't working label Jun 10, 2023
@stefanrueger stefanrueger self-assigned this Jun 10, 2023
@mcuee
Copy link
Collaborator

mcuee commented Jun 10, 2023

BTW, avrdude does not support AVR32 well in reality, since only one chip is supported.

Previously Joerg mentioned that we do not want to spend time on avr32 as the family is not popular and kind of obsoleted. So I closed the old enhancement feature requests (without PR) for avr32.

But of course we should fix the issue of this particular avr32 chip supported (I can not test since I do not have board with this chip). And in case people raise PR and with good test results, we may incorporate the PR.

There are actually two closed issue with patches for AVR32.

@mcuee
Copy link
Collaborator

mcuee commented Jun 11, 2023

Indeed there is an issue in git main and PR #1392 fixes the issue.

$ ./avrdude_git -qq -p AT32UC3A0512 -c dryrun -A -U flash:r:out.hex:i
Segmentation fault

$ ./avrdude_git -qq -p AT32UC3A0512 -c dryrun -A -U flash:r:out.srec:s
Segmentation fault

$ ./avrdude_pr1392 -q -p AT32UC3A0512 -c dryrun -A -U flash:r:out.hex:i
avrdude_pr1392: AVR device initialized and ready to accept instructions

avrdude_pr1392: processing -U flash:r:out.hex:i
avrdude_pr1392: reading flash memory ...
avrdude_pr1392: writing output file out.hex

avrdude_pr1392 done.  Thank you.

$ ./avrdude_pr1392 -q -p AT32UC3A0512 -c dryrun -A -U flash:r:out.srec:s
avrdude_pr1392: AVR device initialized and ready to accept instructions

avrdude_pr1392: processing -U flash:r:out.srec:s
avrdude_pr1392: reading flash memory ...
avrdude_pr1392: writing output file out.srec

avrdude_pr1392 done.  Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants