Skip to content

Conversation

@Emin017
Copy link
Contributor

@Emin017 Emin017 commented Jan 16, 2026

The issue occurred when stringAccessor called reifySingleTarget, whichtriggered toString on mapped Data elements, creating an infinite loop: stringAccessor → reifySingleTarget → mapping(l) → toString → stringAccessor

Added a ThreadLocal guard in Data.stringAccessor to prevent recursivecalls to reifySingleTarget. When recursion is detected, the guard returnsthe current Data object without attempting view reification.

Fix #4687.

Contributor Checklist

  • Did you add Scaladoc to every public function/method?
  • Did you add at least one test demonstrating the PR?
  • Did you delete any extraneous printlns/debugging code?
  • Did you specify the type of improvement?
  • Did you add appropriate documentation in docs/src?
  • Did you request a desired merge strategy?
  • Did you add text to be included in the Release Notes for this change?

Type of Improvement

  • API modification
  • Bugfix

Desired Merge Strategy

  • Squash: The PR will be squashed and merged (choose this if you have no preference).

Release Notes

Reviewer Checklist (only modified by reviewer)

  • Did you add the appropriate labels? (Select the most appropriate one based on the "Type of Improvement")
  • Did you mark the proper milestone (Bug fix: 3.6.x, 5.x, or 6.x depending on impact, API modification or big change: 7.0)?
  • Did you review?
  • Did you check whether all relevant Contributor checkboxes have been checked?
  • Did you do one of the following when ready to merge:
    • Squash: You/ the contributor Enable auto-merge (squash) and clean up the commit message.
    • Merge: Ensure that contributor has cleaned up their commit history, then merge with Create a merge commit.

The issue occurred when stringAccessor called reifySingleTarget,
whichtriggered toString on mapped Data elements, creating an infinite
loop:stringAccessor → reifySingleTarget → mapping(l) → toString →
stringAccessor

Added a ThreadLocal guard in Data.stringAccessor to prevent
recursivecalls to reifySingleTarget. When recursion is detected, the
guard returnsthe current Data object without attempting view
reification.

Signed-off-by: Qiming Chu <[email protected]>
Copy link
Contributor

@jackkoenig jackkoenig left a comment

Choose a reason for hiding this comment

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

Thank you for circling back on this @Emin017, we need to fix it. I don't think this is quite the right way to do it though--I have an alternative solution in https://github.com/chipsalliance/chisel/tree/jackkoenig/fix-dataview-overflow that I also don't think is quite right, but I will try to get a proper solution soon.

@Emin017
Copy link
Contributor Author

Emin017 commented Jan 19, 2026

Thank you for circling back on this @Emin017, we need to fix it. I don't think this is quite the right way to do it though--I have an alternative solution in https://github.com/chipsalliance/chisel/tree/jackkoenig/fix-dataview-overflow that I also don't think is quite right, but I will try to get a proper solution soon.

Thanks! I also tried fixing this bug from the DataView side, but didn’t succeed. Looking forward to your solution!

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.

Stack Overflow when connecting Probe in FlatIO

2 participants