)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"f8ab93d0aa9e212b37ce0c1ce162eda9fb6baeea","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"7540f524_c64ec77c","updated":"2025-07-31 19:21:08.000000000","message":"Huh -- I only ever see us call `init_alg_sig` in tests... I wonder if we could just get rid of this code...\n\nThat said, this seems safe enough and fixes builds for you, so that\u0027s a definite win. Couple comments to look at, though.","commit_id":"480f0fab5e41ff7d773078e0902bd5efda826e36"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"d3a6c35beee3b15cb4fd46da54c97db84f947a07","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"47a05bd3_add46e91","updated":"2025-08-05 07:32:02.000000000","message":"Little update -- there was one more pointer to free, since we won\u0027t be returning `alg_sig_handle` in those branches. Go ahead and merge if you\u0027re on board.","commit_id":"548847e77e37be6339314840bbad7f7e9a3e4ffa"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"8e343e4ad05d020ad1a549ea87cac9ff2708c2f7","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"9c4703b3_ffcf6ac9","updated":"2025-08-06 01:32:35.000000000","message":"Nice, thanks Tim!","commit_id":"548847e77e37be6339314840bbad7f7e9a3e4ffa"}],"src/utils/chksum/alg_sig.c":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"f8ab93d0aa9e212b37ce0c1ce162eda9fb6baeea","unresolved":true,"context_lines":[{"line_number":180,"context_line":""},{"line_number":181,"context_line":"    num_gf_lr_table_syms \u003d 1 \u003c\u003c (w \u003e\u003e 1);"},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"    if (num_components \u003e\u003d 2) {"},{"line_number":184,"context_line":"      alg_sig_handle-\u003etbl1_l \u003d (int*)malloc(sizeof(int) * num_gf_lr_table_syms);"},{"line_number":185,"context_line":"      alg_sig_handle-\u003etbl1_r \u003d (int*)malloc(sizeof(int) * num_gf_lr_table_syms);"},{"line_number":186,"context_line":"    }"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"c19fa8ee_a4f55919","line":183,"updated":"2025-07-31 19:21:08.000000000","message":"Alternatively, I think we should be safe to drop this conditional.","commit_id":"480f0fab5e41ff7d773078e0902bd5efda826e36"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"f8ab93d0aa9e212b37ce0c1ce162eda9fb6baeea","unresolved":true,"context_lines":[{"line_number":182,"context_line":""},{"line_number":183,"context_line":"    if (num_components \u003e\u003d 2) {"},{"line_number":184,"context_line":"      alg_sig_handle-\u003etbl1_l \u003d (int*)malloc(sizeof(int) * num_gf_lr_table_syms);"},{"line_number":185,"context_line":"      alg_sig_handle-\u003etbl1_r \u003d (int*)malloc(sizeof(int) * num_gf_lr_table_syms);"},{"line_number":186,"context_line":"    }"},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"    if (num_components \u003e\u003d 4) {"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"862ba639_ba5ae635","line":185,"updated":"2025-07-31 19:21:08.000000000","message":"Now that I\u0027ve seen it -- it bugs me that we never check the return on these `malloc`s. If we can\u0027t allocate memory, we should fail cleanly rather than seg fault.","commit_id":"480f0fab5e41ff7d773078e0902bd5efda826e36"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"3ef6589e82552d414b5e44d487d5118657936646","unresolved":false,"context_lines":[{"line_number":182,"context_line":""},{"line_number":183,"context_line":"    if (num_components \u003e\u003d 2) {"},{"line_number":184,"context_line":"      alg_sig_handle-\u003etbl1_l \u003d (int*)malloc(sizeof(int) * num_gf_lr_table_syms);"},{"line_number":185,"context_line":"      alg_sig_handle-\u003etbl1_r \u003d (int*)malloc(sizeof(int) * num_gf_lr_table_syms);"},{"line_number":186,"context_line":"    }"},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"    if (num_components \u003e\u003d 4) {"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"cf65ad6e_b7d22d4c","line":185,"in_reply_to":"862ba639_ba5ae635","updated":"2025-08-01 06:04:59.000000000","message":"Done","commit_id":"480f0fab5e41ff7d773078e0902bd5efda826e36"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"1b9215260327124fc4af5204b788cfa55bb265ca","unresolved":true,"context_lines":[{"line_number":182,"context_line":""},{"line_number":183,"context_line":"    if (num_components \u003e\u003d 2) {"},{"line_number":184,"context_line":"      alg_sig_handle-\u003etbl1_l \u003d (int*)malloc(sizeof(int) * num_gf_lr_table_syms);"},{"line_number":185,"context_line":"      alg_sig_handle-\u003etbl1_r \u003d (int*)malloc(sizeof(int) * num_gf_lr_table_syms);"},{"line_number":186,"context_line":"    }"},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"    if (num_components \u003e\u003d 4) {"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"2c4bf9e1_4407011f","line":185,"in_reply_to":"862ba639_ba5ae635","updated":"2025-08-05 06:38:45.000000000","message":"Yeah, possibly, but I erred on the side of matching this guard incase there was some edgecase. Like ehat is there is only 1 component and it\u0027s a waste of memory.\n\nHmm, yeah, maybe checking malloc does make sense.. I can throw that in anyway to the patch, more mocde but less segfault prone is always a positive.","commit_id":"480f0fab5e41ff7d773078e0902bd5efda826e36"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"f8ab93d0aa9e212b37ce0c1ce162eda9fb6baeea","unresolved":true,"context_lines":[{"line_number":226,"context_line":"    return NULL;"},{"line_number":227,"context_line":"  }"},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"  while (valid_pairs[i][0] \u003e -1) {"},{"line_number":230,"context_line":"    if (gf_w \u003d\u003d valid_pairs[i][0] \u0026\u0026"},{"line_number":231,"context_line":"        sig_len \u003d\u003d valid_pairs[i][1]) {"},{"line_number":232,"context_line":"      break;"},{"line_number":233,"context_line":"    }"},{"line_number":234,"context_line":"    i++;"},{"line_number":235,"context_line":"  }"},{"line_number":236,"context_line":""},{"line_number":237,"context_line":"  if (valid_pairs[i][0] \u003d\u003d -1) {"},{"line_number":238,"context_line":"    return NULL;"},{"line_number":239,"context_line":"  }"},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"  if (gf_w \u003d\u003d 8) {"},{"line_number":242,"context_line":"    return init_alg_sig_w8(jerasure_sohandle, sig_len);"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"a504437b_1f6e7529","line":239,"range":{"start_line":229,"start_character":2,"end_line":239,"end_character":3},"updated":"2025-07-31 19:21:08.000000000","message":"Right, so here\u0027s where we do our input validation on `sig_len` (and `gf_w`), ensuring they appear in\n```\nstatic int valid_pairs[][2] \u003d { { 8, 32}, {16, 32}, {16, 64}, {-1, -1} };\n```\nSo `sig_len` is always either 32 or 64, and `num_components` in `init_alg_sig_w16` is always either 2 or 4.","commit_id":"480f0fab5e41ff7d773078e0902bd5efda826e36"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"1b9215260327124fc4af5204b788cfa55bb265ca","unresolved":false,"context_lines":[{"line_number":226,"context_line":"    return NULL;"},{"line_number":227,"context_line":"  }"},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"  while (valid_pairs[i][0] \u003e -1) {"},{"line_number":230,"context_line":"    if (gf_w \u003d\u003d valid_pairs[i][0] \u0026\u0026"},{"line_number":231,"context_line":"        sig_len \u003d\u003d valid_pairs[i][1]) {"},{"line_number":232,"context_line":"      break;"},{"line_number":233,"context_line":"    }"},{"line_number":234,"context_line":"    i++;"},{"line_number":235,"context_line":"  }"},{"line_number":236,"context_line":""},{"line_number":237,"context_line":"  if (valid_pairs[i][0] \u003d\u003d -1) {"},{"line_number":238,"context_line":"    return NULL;"},{"line_number":239,"context_line":"  }"},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"  if (gf_w \u003d\u003d 8) {"},{"line_number":242,"context_line":"    return init_alg_sig_w8(jerasure_sohandle, sig_len);"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"9ed314d7_f82b8e54","line":239,"range":{"start_line":229,"start_character":2,"end_line":239,"end_character":3},"in_reply_to":"a504437b_1f6e7529","updated":"2025-08-05 06:38:45.000000000","message":"Nice thanks!","commit_id":"480f0fab5e41ff7d773078e0902bd5efda826e36"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"3ef6589e82552d414b5e44d487d5118657936646","unresolved":true,"context_lines":[{"line_number":184,"context_line":"      alg_sig_handle-\u003etbl1_l \u003d (int*)malloc(sizeof(int) * num_gf_lr_table_syms);"},{"line_number":185,"context_line":"      alg_sig_handle-\u003etbl1_r \u003d (int*)malloc(sizeof(int) * num_gf_lr_table_syms);"},{"line_number":186,"context_line":"      if (NULL \u003d\u003d alg_sig_handle-\u003etbl1_l || NULL \u003d\u003d alg_sig_handle-\u003etbl1_r) {"},{"line_number":187,"context_line":"        return NULL;"},{"line_number":188,"context_line":"      }"},{"line_number":189,"context_line":"    }"},{"line_number":190,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":2,"id":"bebba759_dba168b3","line":187,"updated":"2025-08-01 06:04:59.000000000","message":"We want to\n```\nfree(alg_sig_handle-\u003etbl1_l);\nfree(alg_sig_handle-\u003etbl1_r);\nfree(alg_sig_handle);\n```\nbefore returning.","commit_id":"e111a5e7837436fcb1984341c0b3cf53998df38a"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"1b9215260327124fc4af5204b788cfa55bb265ca","unresolved":false,"context_lines":[{"line_number":184,"context_line":"      alg_sig_handle-\u003etbl1_l \u003d (int*)malloc(sizeof(int) * num_gf_lr_table_syms);"},{"line_number":185,"context_line":"      alg_sig_handle-\u003etbl1_r \u003d (int*)malloc(sizeof(int) * num_gf_lr_table_syms);"},{"line_number":186,"context_line":"      if (NULL \u003d\u003d alg_sig_handle-\u003etbl1_l || NULL \u003d\u003d alg_sig_handle-\u003etbl1_r) {"},{"line_number":187,"context_line":"        return NULL;"},{"line_number":188,"context_line":"      }"},{"line_number":189,"context_line":"    }"},{"line_number":190,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":2,"id":"3a7db4f3_c0bd97dd","line":187,"in_reply_to":"bebba759_dba168b3","updated":"2025-08-05 06:38:45.000000000","message":"oh yeah, there is a free on line 272 I should probably also wrap in the if statement. \n\nBut yeah, adding a free in this case because we might have created at least 1 table is probably good memory hygene\n\nDone.","commit_id":"e111a5e7837436fcb1984341c0b3cf53998df38a"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"3ef6589e82552d414b5e44d487d5118657936646","unresolved":true,"context_lines":[{"line_number":195,"context_line":"      alg_sig_handle-\u003etbl3_r \u003d (int*)malloc(sizeof(int) * num_gf_lr_table_syms);"},{"line_number":196,"context_line":"      if (NULL \u003d\u003d alg_sig_handle-\u003etbl2_l || NULL \u003d\u003d alg_sig_handle-\u003etbl2_r ||"},{"line_number":197,"context_line":"          NULL \u003d\u003d alg_sig_handle-\u003etbl3_l || NULL \u003d\u003d alg_sig_handle-\u003etbl3_r) {"},{"line_number":198,"context_line":"        return NULL;"},{"line_number":199,"context_line":"      }"},{"line_number":200,"context_line":"    }"},{"line_number":201,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":2,"id":"520846bc_12d79e73","line":198,"updated":"2025-08-01 06:04:59.000000000","message":"Similarly here -- oughta `free` whatever tables might\u0027ve succeeded in allocating then `alg_sig_handle`.","commit_id":"e111a5e7837436fcb1984341c0b3cf53998df38a"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"1b9215260327124fc4af5204b788cfa55bb265ca","unresolved":false,"context_lines":[{"line_number":195,"context_line":"      alg_sig_handle-\u003etbl3_r \u003d (int*)malloc(sizeof(int) * num_gf_lr_table_syms);"},{"line_number":196,"context_line":"      if (NULL \u003d\u003d alg_sig_handle-\u003etbl2_l || NULL \u003d\u003d alg_sig_handle-\u003etbl2_r ||"},{"line_number":197,"context_line":"          NULL \u003d\u003d alg_sig_handle-\u003etbl3_l || NULL \u003d\u003d alg_sig_handle-\u003etbl3_r) {"},{"line_number":198,"context_line":"        return NULL;"},{"line_number":199,"context_line":"      }"},{"line_number":200,"context_line":"    }"},{"line_number":201,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":2,"id":"8c746413_445c7967","line":198,"in_reply_to":"520846bc_12d79e73","updated":"2025-08-05 06:38:45.000000000","message":"Done","commit_id":"e111a5e7837436fcb1984341c0b3cf53998df38a"}]}
