@cryptotaxi247 / netdata-1 / commits / 934c4ccbc

trace crashes No 4 (#20043)

* detect issue at uv_worker job 13 * assertion at journalfile_migrate_to_v2_callback()

Costa Tsaousis committed Apr 3, 2025 at 12:04 UTC 934c4ccbcdd84479708222700455901eb728a6c6
1 file changed +4
src/database/engine/journalfile.c
+4
@@ -1351,6 +1351,7 @@ bool journalfile_migrate_to_v2_callback(Word_t section, unsigned datafile_fileno
1351 return false;
1352 }
1353
1354 + fatal_assert(extent_offset <= total_file_size);
1355 memset(data_start, 0, extent_offset);
1356
1357 // Write header
@@ -1402,12 +1403,15 @@ bool journalfile_migrate_to_v2_callback(Word_t section, unsigned datafile_fileno
1403 while ((PValue = JudyLFirstThenNext(JudyL_metrics, &Index, &first_then_next))) {
1404 metric_info = *PValue;
1405
1406 + fatal_assert(metric_info != NULL);
1407 fatal_assert(count < number_of_metrics);
1408 uuid_list[count++].metric_info = metric_info;
1409 min_time_s = MIN(min_time_s, metric_info->first_time_s);
1410 max_time_s = MAX(max_time_s, metric_info->last_time_s);
1411 }
1412
1413 + fatal_assert(count == number_of_metrics);
1414 +
1415 // Check if not properly set in the loop above to prevent overflow
1416 if (min_time_s == LONG_MAX)
1417 min_time_s = 0;