{"payload":{"feedbackUrl":"https://github.com/orgs/community/discussions/53140","repo":{"id":708997504,"defaultBranch":"main","name":"snaphu","ownerLogin":"gmgunter","currentUserCanPush":false,"isFork":false,"isEmpty":false,"createdAt":"2023-10-23T20:04:15.000Z","ownerAvatar":"https://github.com/avatars/u/12984092?v=4","public":true,"private":false,"isOrgOwned":false},"refInfo":{"name":"","listCacheKey":"v0:1710349930.0","currentOid":""},"activityList":{"items":[{"before":"4b7ca6c08eec6b7e6a61d739237b8c182f0ce795","after":"5981e65f3c267906b32dd5411bc27e0c4844f216","ref":"refs/heads/main","pushedAt":"2024-03-13T17:11:58.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"gmgunter","name":"Geoffrey Gunter","path":"/gmgunter","primaryAvatarUrl":"https://github.com/avatars/u/12984092?s=80&v=4"},"commit":{"message":"snaphu-v2.0.7 (February 2024)","shortMessageHtmlLink":"snaphu-v2.0.7 (February 2024)"}},{"before":"2c1362dc9cdfedf8c5c9632ddeb8e67724605e5c","after":null,"ref":"refs/heads/conncomp-realloc","pushedAt":"2024-03-13T17:05:52.000Z","pushType":"branch_deletion","commitsCount":0,"pusher":{"login":"gmgunter","name":"Geoffrey Gunter","path":"/gmgunter","primaryAvatarUrl":"https://github.com/avatars/u/12984092?s=80&v=4"}},{"before":null,"after":"2c1362dc9cdfedf8c5c9632ddeb8e67724605e5c","ref":"refs/heads/conncomp-realloc","pushedAt":"2024-02-23T22:21:02.000Z","pushType":"branch_creation","commitsCount":0,"pusher":{"login":"gmgunter","name":"Geoffrey Gunter","path":"/gmgunter","primaryAvatarUrl":"https://github.com/avatars/u/12984092?s=80&v=4"},"commit":{"message":"Fix zero-size realloc with glibc\n\nFixes an issue that could cause SNAPHU to report \"Out of memory\" and\nabort in tile mode when the first two tiles both contained no connected\ncomponents.\n\n* During the tile reassembly phase, the `AssembleTileConnComps` function\n maintains an array of connected component descriptors which is\n iteratively resized by calls to `realloc` as it loops over tiles.\n* Each time we reach the call to `realloc`, if we haven't yet\n encountered any connected components, we try to resize the array to\n size zero.\n* The behavior of `realloc` when the new size is zero depends on the\n underlying C library, as described here:\n https://open-std.org/JTC1/SC22/WG14/www/docs/n2396.htm#dr_400. In\n glibc, when the new size is zero, `realloc` fails (i.e. returns NULL)\n if the input pointer was not NULL.\n\nSo what happens is:\n\n1. We initialize the `conncompsizes` pointer to NULL.\n2. We begin the loop over tiles. The first tile contains no connected\n components so we try to resize the array to size zero by calling\n `realloc(NULL,0)` which (in the glibc implementation) returns a\n non-NULL pointer.\n3. We continue to the second tile which also contains no connected\n components, so the total number of connected components is still\n zero. We again try to resize the array to size zero but this time,\n the input pointer is non-NULL, so `realloc` returns NULL.\n4. SNAPHU interprets the NULL return value from `realloc` as an \"Out of\n memory\" error and aborts.\n\nThe patch guards the call to `realloc` behind a check that ensures that\nthe number of connected components is >0. If there are no connected\ncomponents, we simply skip the `realloc` call.","shortMessageHtmlLink":"Fix zero-size realloc with glibc"}},{"before":null,"after":"4b7ca6c08eec6b7e6a61d739237b8c182f0ce795","ref":"refs/heads/main","pushedAt":"2023-10-23T20:06:01.000Z","pushType":"branch_creation","commitsCount":0,"pusher":{"login":"gmgunter","name":"Geoffrey Gunter","path":"/gmgunter","primaryAvatarUrl":"https://github.com/avatars/u/12984092?s=80&v=4"},"commit":{"message":"snaphu-v2.0.6 (April 2023)","shortMessageHtmlLink":"snaphu-v2.0.6 (April 2023)"}}],"hasNextPage":false,"hasPreviousPage":false,"activityType":"all","actor":null,"timePeriod":"all","sort":"DESC","perPage":30,"cursor":"djE6ks8AAAAEFL91QgA","startCursor":null,"endCursor":null}},"title":"Activity ยท gmgunter/snaphu"}