Opened 3 months ago

Last modified 4 weeks ago

#19171 new bug

avrdude crashes after every run

Reported by: danboid Owned by: nobody
Priority: normal Milestone: Unscheduled
Component: Kits/Device Kit Version: R1/beta5
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

I have installed avrdude under Haiku b5 amd64. I have tried using my USB AVR ISPMKII programmer to program my Uzebox and it does work but it crashes at the end of every run.

I have attached a core dump from avrdude after one of these crashes.

Attachments (2)

avrdude-442-debug-19-02-2024-08-15-15.report (11.4 KB ) - added by danboid 3 months ago.
avrdude crash report
avrdude-433-debug-20-02-2024-04-04-47.report (16.2 KB ) - added by danboid 3 months ago.

Download all attachments as: .zip

Change History (22)

comment:1 by danboid, 3 months ago

The core dump was 12 MB when compressed with xz -9 so I'd need to split it to share it on here.

comment:2 by waddlesplash, 3 months ago

Just attach the report, please. But odds are this a bug in the avrdude port and not Haiku itself.

comment:3 by korli, 3 months ago

or a bug in libusb.

comment:4 by danboid, 3 months ago

Yes was unsure about where to post this tbh but I thought better post it somewhere than not raise it at all. Sorry if this is a packaging bug or whatever which I suppose is just as likely.

I have split that beautiful coredump for you.

This crash not only happens after every run of avrdude, I've also seen it on two different machines, a laptop and a desktop both running b5.

comment:5 by danboid, 3 months ago

You should be able to uncompress those split files using the command:

cat Haiku-avrdude-usb-core.tar* | tar xvf -

comment:6 by korli, 3 months ago

danboid, I think waddlesplash asked to just attach the crash report.

comment:7 by waddlesplash, 3 months ago

Indeed, I don't want the core file.

by danboid, 3 months ago

avrdude crash report

comment:8 by waddlesplash, 3 months ago

Component: Drivers/USB/XHCIKits/Device Kit
Owner: changed from waddlesplash to nobody

Could be a bug either in libusb or the USB Kit, not immediately clear from the report.

comment:9 by danboid, 3 months ago

I dunno if it helps you at all but the avrdude command I'm using is:

avrdude -c avrispmkII -P usb -p m644 -U flash:w:Bootloader5.hex

See https://uzebox.org/wiki/Avrdude

Haiku is almost the optimal platform for Uzebox devs. I think it would be if we could fix this.

It is arguably easier to build the Uzebox repo under Haiku than Linux because I can install Haiku faster than most if not all Linux distros, Windows and so much faster than macOS its not worth mentioning.

https://uzebox.org/wiki/Haiku_Software_Installation

comment:10 by waddlesplash, 3 months ago

Can you please try with the guarded heap?

LD_PRELOAD=libroot_debug.so MALLOC_DEBUG=g program...

comment:11 by danboid, 3 months ago

Prefixing avrdude with

LD_PRELOAD=libroot_debug.so MALLOC_DEBUG=g

Didn't stop it from crashing after running.

comment:12 by waddlesplash, 3 months ago

I meant to generate a new debug report and attach it here with the guarded heap; it should crash in a different place and/or with a different message.

comment:13 by danboid, 3 months ago

New debug report attached. Please excuse the incorrect date.

comment:14 by waddlesplash, 3 months ago

There does appear to be at least one issue with the USB Kit here at least.

comment:15 by pulkomandy, 3 months ago

I have not seen crashes in a while, but I think I don't own an avrispmk2 compatible device. So maybe I didn't test this specific combination and avrdude is working fine with other programmer types (I use mainly an stk500 development board, and lufa bootloader these days)

comment:16 by waddlesplash, 3 months ago

PulkoMandy: can you try with the guarded heap with one of the devices you do have and see if a similar crash occurs anyway?

comment:17 by pulkomandy, 3 months ago

The stk500 is accessed through a serial port and doesn't use libusb. I'll see if I can find and test one of my devices using a bootloader

comment:18 by pulkomandy, 4 weeks ago

I checked again and I have no problems with avrdude with the guarded heap, but all my devices are programmed through serial interfaces, not needing avrdude to use any USB libraries.

comment:19 by danboid, 4 weeks ago

How about I buy a cheap USB AVR programmer and if I still have the same problem with it under Haiku I can send it to you, if you are willing to send me your address?

comment:20 by pulkomandy, 4 weeks ago

I could easily buy or build one myself. In fact I have two usb-asp programmers, but both seem broken. I don't really have time to investigate these things at the moment. And no interest in adding more hardware to my junk pile. It will just sit there for a few years while I continue using my perfectly working serial port based one, so that will not really help.

Note: See TracTickets for help on using tickets.