Skip to content

[clang] Fix two RAIIs for recursive parsing #19137

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

Merged
merged 5 commits into from
Jul 1, 2025

Conversation

hahnjo
Copy link
Member

@hahnjo hahnjo commented Jun 23, 2025

Fixes #18972, partially a reincarnation of #14230 because we lost the fix when upgrading to LLVM 18.

Ideally we would have a roottest for the reset of FunctionScopesStart, but it seems hard outside of O2...

@hahnjo hahnjo requested a review from silverweed June 23, 2025 11:25
@hahnjo hahnjo self-assigned this Jun 23, 2025
@hahnjo hahnjo changed the title [clang] Save and restore BacktrackPositions [clang] Save and restore BacktrackPositions Jun 23, 2025
@ktf
Copy link
Contributor

ktf commented Jun 23, 2025

For the record, this still breaks for me with a slightly different stacktrace.

@pcanal
Copy link
Member

pcanal commented Jun 23, 2025

For the record, this still breaks for me with a slightly different stacktrace.

Can you upload the new backtrace?

@ktf
Copy link
Contributor

ktf commented Jun 23, 2025

Done see #18972

Copy link

github-actions bot commented Jun 23, 2025

Test Results

    20 files      20 suites   3d 10h 27m 48s ⏱️
 3 047 tests  3 047 ✅ 0 💤 0 ❌
59 350 runs  59 350 ✅ 0 💤 0 ❌

Results for commit d094b79.

♻️ This comment has been updated with latest results.

@silverweed
Copy link
Contributor

I am trying to get a stack trace with the full debug info to see if it crashes in a different place than before.

@silverweed
Copy link
Contributor

silverweed commented Jun 24, 2025

I just tested the GetAndSave repro with a local build of O2 (on archlinux) with this patch applied on top of v6-36-00-alice2 and the crash disappeared for me.

ROOT build:

 Built for linuxx8664gcc on Jun 24 2025, 08:42:09                         
 From tags/v6-36-00-alice2-2-g06c609bb91e@v6-36-00-alice2-2-g06c609bb91e 
 With c++ (GCC) 14.2.0

O2 commit: ead329bb619c79251b1b2aba50556364198ecfe5 (on the dev branch)

@hahnjo hahnjo force-pushed the pp-backtrack-positions branch from 9802958 to e18033a Compare June 24, 2025 13:09
@hahnjo hahnjo changed the title [clang] Save and restore BacktrackPositions [clang] Fix two RAIIs for recursive parsing Jun 24, 2025
@ktf
Copy link
Contributor

ktf commented Jun 25, 2025

@hahnjo @silverweed 3734d16 does not apply for me on top of vanilla v6-36-00. What am I missing?

@hahnjo
Copy link
Member Author

hahnjo commented Jun 25, 2025

@ktf

3734d16 does not apply for me on top of vanilla v6-36-00. What am I missing?

roottest was merged into root.git after branching v6-36-00-patches. You can ignore that part of the patch if you manually want to apply the commit, but we will also provide backports after this PR is merged.

@ktf
Copy link
Contributor

ktf commented Jun 25, 2025

@hahnjo ok, thanks. I can confirm that with the 4 commits things are ok.

hahnjo and others added 5 commits June 26, 2025 09:02
CachedTokens comes before CachedLexPos in Preprocessor.
Found while investigating root-project#18972

Co-authored-by: silverweed <giacomo.parolini@cern.ch>
FunctionScopesStart and InventedParameterInfosStart were introduced
by upstream commit
llvm/llvm-project@5c845c1
and are handled in ContextRAII, but not our ContextAndScopeRAII.

(cherry picked from commit b702391,
it was lost during the upgrade to LLVM 18)
(cherry picked from commit 07021ea,
it was lost during the upgrade to LLVM 18)
@hahnjo hahnjo force-pushed the pp-backtrack-positions branch from e18033a to d094b79 Compare June 26, 2025 07:14
@hahnjo hahnjo marked this pull request as ready for review June 26, 2025 07:19
Copy link
Member

@pcanal pcanal left a comment

Choose a reason for hiding this comment

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

LGTM.

Copy link
Member

@vgvassilev vgvassilev left a comment

Choose a reason for hiding this comment

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

LGTM!

@hahnjo hahnjo merged commit c26a958 into root-project:master Jul 1, 2025
26 checks passed
@hahnjo hahnjo deleted the pp-backtrack-positions branch July 1, 2025 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Segmentation fault while running interpreted macro
5 participants