Skip to content

ast: unwrap MacroSource before jl_timing_show_macro#61642

Merged
maleadt merged 1 commit into
masterfrom
tb/timing
May 4, 2026
Merged

ast: unwrap MacroSource before jl_timing_show_macro#61642
maleadt merged 1 commit into
masterfrom
tb/timing

Conversation

@maleadt

@maleadt maleadt commented Apr 24, 2026

Copy link
Copy Markdown
Member

When a macro accepts a Core.MacroSource argument (e.g. @VERSION) and the first method lookup succeeds, margs[1] remains a MacroSource rather than the inner LineNumberNode. Passing it to jl_timing_show_macro then trips an assertion in assertions builds. Use the already-unwrapped retry_lno for the timing call when available.

This was introduced by #60018 (cc @Keno).

Fixes assertion seen locally:

julia: /home/tim/Julia/src/julia/src/timing.c:617: jl_timing_show_macro: Assertion `jl_typetagis(lno, jl_linenumbernode_type)' failed.

Requires assertions + timings to be enabled (e.g. WITH_TRACY=1), which presumably explains why gnuassert didn't catch this.

@maleadt
maleadt requested a review from Keno April 24, 2026 08:22
When a macro accepts a `Core.MacroSource` argument (e.g. `@VERSION`) and
the first method lookup succeeds, `margs[1]` remains a `MacroSource`
rather than the inner `LineNumberNode`. Passing it to
`jl_timing_show_macro` then trips an assertion in assertions builds.
Use the already-unwrapped `retry_lno` for the timing call when
available.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@maleadt
maleadt merged commit 8304540 into master May 4, 2026
10 of 11 checks passed
@maleadt
maleadt deleted the tb/timing branch May 4, 2026 14:03
hardikxk pushed a commit to hardikxk/julia that referenced this pull request May 18, 2026
When a macro accepts a `Core.MacroSource` argument (e.g. `@VERSION`) and
the first method lookup succeeds, `margs[1]` remains a `MacroSource`
rather than the inner `LineNumberNode`. Passing it to
`jl_timing_show_macro` then trips an assertion in assertions builds. Use
the already-unwrapped `retry_lno` for the timing call when available.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
mkitti pushed a commit to mkitti/julia that referenced this pull request May 22, 2026
When a macro accepts a `Core.MacroSource` argument (e.g. `@VERSION`) and
the first method lookup succeeds, `margs[1]` remains a `MacroSource`
rather than the inner `LineNumberNode`. Passing it to
`jl_timing_show_macro` then trips an assertion in assertions builds. Use
the already-unwrapped `retry_lno` for the timing call when available.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant