Repository navigation
Fix crash when running vpr a second time in one process - #2835
Open
ganeshgore wants to merge 2 commits into
Open
ganeshgore wants to merge 2 commits into
ganeshgore wants to merge 2 commits into
Conversation
ganeshgore
force-pushed
the
gg_vpr_double_run_crash
branch
from
November 5, 2026 04:01
fb260fa to
68e293e
Compare
ganeshgore
force-pushed
the
gg_vpr_double_run_crash
branch
2 times, most recently
from
November 10, 2026 06:59
953fff5 to
c56d43a
Compare
tangxifan
force-pushed
the
gg_vpr_double_run_crash
branch
from
November 12, 2026 05:43
c56d43a to
cd04756
Compare
ganeshgore
force-pushed
the
gg_vpr_double_run_crash
branch
from
November 20, 2026 05:13
cd04756 to
709a14e
Compare
ganeshgore
force-pushed
the
gg_vpr_double_run_crash
branch
2 times, most recently
from
November 27, 2026 04:45
460ec7e to
ae133a5
Compare
ganeshgore
force-pushed
the
gg_vpr_double_run_crash
branch
from
December 1, 2026 03:42
ae133a5 to
63d346b
Compare
ganeshgore
force-pushed
the
gg_vpr_double_run_crash
branch
from
December 2, 2026 05:22
63d346b to
dc2f7a1
Compare
The vpr command keeps its data in the global VPR contexts for the commands that follow, and never freed it. Running vpr again loaded the architecture on top of the previous run and crashed in link_physical_logical_types. The same happened after a run that failed once the architecture was loaded. - Keep the architecture, options and setup of the last vpr run in a process-wide holder - Free the previous run (vpr_free_all) before any new vpr or vpr_standalone - Free the data of a vpr run that fails, as vpr_standalone already does - Add tests for repeated runs, mixed vpr/vpr_standalone runs, retries after failures, and commands that follow a second run
vpr_free_all() leaves the packing of the circuit in the clustering context. Running vpr a second time with another circuit then failed the check of the clusters against the atoms of the new circuit. Clear it when the data of a run is freed, and test running vpr with different circuits in one process.
tangxifan
force-pushed
the
gg_vpr_double_run_crash
branch
from
December 2, 2026 21:59
dc2f7a1 to
c39796f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #2833 (which is stacked on #2832). Review those first; this PR's diff is only the last commit.
Running
vpra second time in one process segfaulted, in the nativeopenfpgabinary as well as from Python.vprkeeps its data in the global VPR contexts for the commands that follow (link_openfpga_arch,build_fabric, ...), and never freed it. The second run loaded the architecture on top of the previous one and crashed inlink_physical_logical_types, called fromxml_read_arch. The same crash followed avprrun that failed after the architecture was loaded.vpr_standalonewas not affected, because it frees its data at the end.Changes
Everything is in
openfpga/src/vpr_wrapper/vpr_main.cpp. VTR is not patched.vprrun are kept in a process-wide holder, likeg_vpr_ctx.vpr_free_allbefore any newvprorvpr_standalone.vprrun that fails frees its data, asvpr_standalonealready does. Commands that depend onvprare already blocked by the fatal status.Behavior change: running
vpragain now replaces the previous VPR state. Because the holder is process-wide, likeg_vpr_ctx, a secondOpenfpgaShellobject in the same process also resets the first one's VPR state.Testing
vprrun twice and three times;vprandvpr_standalonemixed in both orders;link_openfpga_archandbuild_fabricsucceeding after a secondvpr.vprtwice and three times, andvprmixed withvpr_standalone. Also a stage-by-stagevpr_standalone --pack/--place/--routethenvpr --analysisthenbuild_fabricflow, which finished with 0 errors.basic_tests/generate_fabricpasses.basic_tests/vpr_standalonetask here, because its Yosys step needs a Yosys build.