You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// BCH 12/1/2025: In the multichrom case we need to protect against a segfault inside
5685
+
// tsk_table_collection_truncate() for the secondary table collections. This is because
5686
+
// they have NULL for their various column pointers, and tsk_table_collection_truncate()
5687
+
// accesses index 0 of every offset column to get the offset for row 0. (It is always
5688
+
// for row 0 in the shared tables because they are zeroed out; their num_rows was zero
5689
+
// in RecordTablePosition().) See https://github.com/MesserLab/SLiM/issues/579 for details.
5690
+
// BEWARE: This code will need updating if new shared tables are added, or new columns
5691
+
// are added within the existing shared table. Any offset column that is accessed in the
5692
+
// ..._truncate() functions for the shared tables needs to be protected here.
5693
+
tsk_size_t zero_value = 0;
5694
+
tsk_size_t *pointer_to_zero_value = &zero_value;
5695
+
5696
+
for (size_t trees_index = 1; trees_index < trees_count; ++trees_index)
5697
+
{
5698
+
TreeSeqInfo &tsinfo_i = treeseq_[trees_index];
5699
+
5700
+
#if DEBUG
5701
+
// This protection scheme relies upon the bookmarked row being zero for shared tables;
5702
+
// only the zeroth element of each offset column is set up by the hack here.
5703
+
if ((tsinfo_i.table_position_.nodes != 0) ||
5704
+
(tsinfo_i.table_position_.individuals != 0) ||
5705
+
(tsinfo_i.table_position_.populations != 0))
5706
+
EIDOS_TERMINATION << "ERROR (Species::RetractNewIndividual): (internal error) tree sequence bookmark for a shared table in a secondary table collection is non-zero." << EidosTerminate();
0 commit comments