Repository navigation
Fix a crash when learning the trace with a small initial hash table - #414
Open
jerebertho wants to merge 1 commit into
Open
jerebertho wants to merge 1 commit into
jerebertho wants to merge 1 commit into
Conversation
ederc
approved these changes
Nov 25, 2026
Batch insertions such as the one of the pair lcms in insert_and_update_spairs() only enlarge the hash table while it has fewer free entries than elements to insert, so they may leave it completely full (eld == esz). The checks before inserting a single multiplier in symbol.c only enlarged it when eld == esz-1, so the next insertion wrote past the end of the table. This made msolve crash while learning the trace with a small initial hash table, e.g. on elim-qq.ms with -g 2 -s 1. The checks now also enlarge a full table, and diff_elim-qq.sh tests -s 1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jerebertho
force-pushed
the
fix-elim-qq-segfault
branch
from
November 27, 2026 15:26
3202475 to
c37ce85
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.
On master,
./msolve -f input_files/elim-qq.ms -g 2 -s 1crashes while learning thetrace modulo the first prime, with or without
-t 1and-e 1. It works with thedefault hash table size.
Some batch insertions in the basis hash table, such as the one of the lcms of the new
pairs in
insert_and_update_spairs(), enlarge the table only while it has fewer freeentries than elements to insert (
while (esz - eld < n)). They may therefore leave thetable completely full, i.e.
eld == esz. Before inserting a single multiplier insymbol.c, the table was enlarged only wheneld == esz - 1, so a full table was notenlarged and the next insertion wrote past its end. With
-s 1the table has 8 entriesand gets full after the first update.
This PR enlarges the table in these checks as soon as
eld >= esz - 1(4 places insrc/neogb/symbol.c). It also adds-e 1 -g 2 -s 1with-t 1and-t 2totest/diff/diff_elim-qq.sh; this test fails on master.Checks:
-sfrom 1 to 20, with and without-t 1, and with-e 1; the outputs do not depend on-s;input_files, the outputs of-g 2,-g 2 -t 2and the default call with-s 1are the same as with-s 17, with no AddressSanitizer error;make checkpasses.🤖 Generated with Claude Code