Skip to content
This repository was archived by the owner on Mar 7, 2026. It is now read-only.

Fix NULL jtagtap_cycle() which crashed BMDA#2179

Merged
dragonmux merged 3 commits into
blackmagic-debug:mainfrom
ALTracer:fix/jtagtap_cycle
Jan 29, 2026
Merged

Fix NULL jtagtap_cycle() which crashed BMDA#2179
dragonmux merged 3 commits into
blackmagic-debug:mainfrom
ALTracer:fix/jtagtap_cycle

Conversation

@ALTracer
Copy link
Copy Markdown
Contributor

Detailed description

  • No real new features.
  • The existing problem is SIGSEGV in BMDA when trying to invoke jtag_proc.jtagtap_cycle() in initial JTAG scan.
  • This PR solves it by providing simplified wrappers for that (around jtagtap_next()).

Affected backends are FTDI MPSSE, J-Link, and CMSIS-DAP.
Unaffected backends are BMP HL remote, STLINK. BMF was not affected either.
Tested with FT2232HL against a RV32I target, the other 3 callsites are not fixed.

Your checklist for this pull request

Closing issues

@dragonmux dragonmux added this to the v2.1 release milestone Jan 28, 2026
@dragonmux dragonmux added Bug Confirmed bug BMD App Black Magic Debug App (aka. PC hosted) (not firmware) labels Jan 28, 2026
Comment thread src/platforms/hosted/dap_jtag.c Outdated
@ALTracer ALTracer force-pushed the fix/jtagtap_cycle branch 3 times, most recently from 1967df4 to a98061e Compare January 28, 2026 19:32
@ALTracer
Copy link
Copy Markdown
Contributor Author

Now that all three affected backends have got some implementations of that, commits 1-2 can be discarded (explicit NULL and a nullcheck at callsite).

Copy link
Copy Markdown
Member

@dragonmux dragonmux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking better - we've got one review note that applies in a couple of places which is just about layout, otherwise LGTM 👍🏼

Comment thread src/platforms/hosted/dap_jtag.c Outdated
Copy link
Copy Markdown
Member

@dragonmux dragonmux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, merging. Thank you for the contribution! We'll backport this just like we did the JTAG scan fix as this fixes a v2.0 bug.

@dragonmux dragonmux merged commit 7e35068 into blackmagic-debug:main Jan 29, 2026
38 of 39 checks passed
@dragonmux dragonmux linked an issue Jan 29, 2026 that may be closed by this pull request
@ALTracer ALTracer deleted the fix/jtagtap_cycle branch February 21, 2026 21:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

BMD App Black Magic Debug App (aka. PC hosted) (not firmware) Bug Confirmed bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inconsistent jtagtap_cycle() implementations

2 participants