)]}'
{"src/transactions/transactions.cxx":[{"author":{"_account_id":1000201,"name":"Sergey Avseyev","email":"sergey.avseyev@gmail.com","username":"avsej","avatars":[{"url":"https://www.gravatar.com/avatar/dd70f9d8cc5f9ee488d68e7a787ba526.jpg?d\u003didenticon\u0026r\u003dpg\u0026s\u003d32","height":32},{"url":"https://www.gravatar.com/avatar/dd70f9d8cc5f9ee488d68e7a787ba526.jpg?d\u003didenticon\u0026r\u003dpg\u0026s\u003d56","height":56},{"url":"https://www.gravatar.com/avatar/dd70f9d8cc5f9ee488d68e7a787ba526.jpg?d\u003didenticon\u0026r\u003dpg\u0026s\u003d100","height":100},{"url":"https://www.gravatar.com/avatar/dd70f9d8cc5f9ee488d68e7a787ba526.jpg?d\u003didenticon\u0026r\u003dpg\u0026s\u003d120","height":120}]},"change_message_id":"aefa4050d49ef8465ab272c416cea94bee5a5ee7","unresolved":true,"context_lines":[{"line_number":35,"context_line":"void"},{"line_number":36,"context_line":"pycbc::txns::dealloc_transactions(PyObject* obj)"},{"line_number":37,"context_line":"{"},{"line_number":38,"context_line":"  auto txns \u003d reinterpret_cast\u003cpycbc::txns::transactions*\u003e(PyCapsule_GetPointer(obj, \"txns_\"));"},{"line_number":39,"context_line":"  Py_BEGIN_ALLOW_THREADS txns-\u003etxns-\u003eclose();"},{"line_number":40,"context_line":"  Py_END_ALLOW_THREADS delete txns;"},{"line_number":41,"context_line":"  CB_LOG_DEBUG(\"dealloc transactions\");"},{"line_number":42,"context_line":"}"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"void"}],"source_content_type":"text/x-c++src","patch_set":1,"id":"b2c0dcc9_86cc4f97","line":41,"range":{"start_line":38,"start_character":1,"end_line":41,"end_character":39},"updated":"2026-07-24 20:20:35.000000000","message":"If the capsule was never fully initialized, or if error handling during initialization triggered destruction on a partially formed capsule, `PyCapsule_GetPointer` will return `nullptr`. \n\nAttempting to execute `txns-\u003etxns-\u003eclose()` on a `nullptr` results in an immediate crash. We must add a null safety check before proceeding.\n\n```suggestion\n  auto txns \u003d reinterpret_cast\u003cpycbc::txns::transactions*\u003e(PyCapsule_GetPointer(obj, \"txns_\"));\n  if (txns !\u003d nullptr) {\n    Py_BEGIN_ALLOW_THREADS txns-\u003etxns-\u003eclose();\n    Py_END_ALLOW_THREADS delete txns;\n  }\n  CB_LOG_DEBUG(\"dealloc transactions\");\n```","commit_id":"dd0b579643e9799e05d1ef91da7e079f77c11c56"},{"author":{"_account_id":1004568,"name":"Jared Casey","email":"jared.casey@couchbase.com","username":"thejcfactor","avatars":[{"url":"https://www.gravatar.com/avatar/20ac69da8a1fb4cc11bdd1c880389132.jpg?d\u003didenticon\u0026r\u003dpg\u0026s\u003d32","height":32},{"url":"https://www.gravatar.com/avatar/20ac69da8a1fb4cc11bdd1c880389132.jpg?d\u003didenticon\u0026r\u003dpg\u0026s\u003d56","height":56},{"url":"https://www.gravatar.com/avatar/20ac69da8a1fb4cc11bdd1c880389132.jpg?d\u003didenticon\u0026r\u003dpg\u0026s\u003d100","height":100},{"url":"https://www.gravatar.com/avatar/20ac69da8a1fb4cc11bdd1c880389132.jpg?d\u003didenticon\u0026r\u003dpg\u0026s\u003d120","height":120}]},"change_message_id":"61737343ce3058f635880dc032c417482a4dd5b0","unresolved":false,"context_lines":[{"line_number":35,"context_line":"void"},{"line_number":36,"context_line":"pycbc::txns::dealloc_transactions(PyObject* obj)"},{"line_number":37,"context_line":"{"},{"line_number":38,"context_line":"  auto txns \u003d reinterpret_cast\u003cpycbc::txns::transactions*\u003e(PyCapsule_GetPointer(obj, \"txns_\"));"},{"line_number":39,"context_line":"  Py_BEGIN_ALLOW_THREADS txns-\u003etxns-\u003eclose();"},{"line_number":40,"context_line":"  Py_END_ALLOW_THREADS delete txns;"},{"line_number":41,"context_line":"  CB_LOG_DEBUG(\"dealloc transactions\");"},{"line_number":42,"context_line":"}"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"void"}],"source_content_type":"text/x-c++src","patch_set":1,"id":"bea5a97a_9120fd22","line":41,"range":{"start_line":38,"start_character":1,"end_line":41,"end_character":39},"in_reply_to":"b2c0dcc9_86cc4f97","updated":"2026-07-25 00:59:17.000000000","message":"So, the change I made was in `create_transactions` to handle if `PyCapsule_New()` returns a `nullptr`.\n\nPreviously, if `PyCapsule_New()` were to fail, the destructor would never be set so we could not even get to `dealloc_transactions()`\n\nhttps://github.com/python/cpython/blob/59e67c284d3e8dcb708e473cfca02b1307c9cd0a/Objects/capsule.c#L59-L77\n```\nPyObject *\nPyCapsule_New(void *pointer, const char *name, PyCapsule_Destructor destructor)\n{\n    PyCapsule *capsule;\n\n\n    if (!pointer) {\n        PyErr_SetString(PyExc_ValueError, \"PyCapsule_New called with null pointer\");\n        return NULL;\n    }\n\n\n    capsule \u003d PyObject_GC_New(PyCapsule, \u0026PyCapsule_Type);\n    if (capsule \u003d\u003d NULL) {\n        return NULL;\n    }\n\n\n    capsule-\u003epointer \u003d pointer;\n    capsule-\u003ename \u003d name;\n    capsule-\u003econtext \u003d NULL;\n    capsule-\u003edestructor \u003d destructor;\n```","commit_id":"dd0b579643e9799e05d1ef91da7e079f77c11c56"},{"author":{"_account_id":1000201,"name":"Sergey Avseyev","email":"sergey.avseyev@gmail.com","username":"avsej","avatars":[{"url":"https://www.gravatar.com/avatar/dd70f9d8cc5f9ee488d68e7a787ba526.jpg?d\u003didenticon\u0026r\u003dpg\u0026s\u003d32","height":32},{"url":"https://www.gravatar.com/avatar/dd70f9d8cc5f9ee488d68e7a787ba526.jpg?d\u003didenticon\u0026r\u003dpg\u0026s\u003d56","height":56},{"url":"https://www.gravatar.com/avatar/dd70f9d8cc5f9ee488d68e7a787ba526.jpg?d\u003didenticon\u0026r\u003dpg\u0026s\u003d100","height":100},{"url":"https://www.gravatar.com/avatar/dd70f9d8cc5f9ee488d68e7a787ba526.jpg?d\u003didenticon\u0026r\u003dpg\u0026s\u003d120","height":120}]},"change_message_id":"309204832416a2089a689928039c146b6ad54e30","unresolved":true,"context_lines":[{"line_number":36,"context_line":"pycbc::txns::dealloc_transactions(PyObject* obj)"},{"line_number":37,"context_line":"{"},{"line_number":38,"context_line":"  auto txns \u003d reinterpret_cast\u003cpycbc::txns::transactions*\u003e(PyCapsule_GetPointer(obj, \"txns_\"));"},{"line_number":39,"context_line":"  Py_BEGIN_ALLOW_THREADS txns-\u003etxns-\u003eclose();"},{"line_number":40,"context_line":"  delete txns;"},{"line_number":41,"context_line":"  Py_END_ALLOW_THREADS CB_LOG_DEBUG(\"dealloc transactions\");"},{"line_number":42,"context_line":"}"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"void"}],"source_content_type":"text/x-c++src","patch_set":3,"id":"75430187_941a2575","line":41,"range":{"start_line":39,"start_character":0,"end_line":41,"end_character":60},"updated":"2026-07-27 14:42:58.000000000","message":"If the capsule was never fully initialized, or if error handling during initialization triggered destruction of a partially formed capsule, `PyCapsule_GetPointer` will return `nullptr`. \n\nAttempting to call `txns-\u003etxns-\u003eclose()` and `delete txns` on a `nullptr` results in an immediate interpreter segmentation fault. We must add a null safety check before proceeding.\n\n\n```suggestion\n  if (txns !\u003d nullptr) {\n    Py_BEGIN_ALLOW_THREADS txns-\u003etxns-\u003eclose();\n    delete txns;\n    Py_END_ALLOW_THREADS CB_LOG_DEBUG(\"dealloc transactions\");\n  }\n```","commit_id":"cb57ba2316bb4b2f0b58c114206f861c4e02d27c"},{"author":{"_account_id":1000201,"name":"Sergey Avseyev","email":"sergey.avseyev@gmail.com","username":"avsej","avatars":[{"url":"https://www.gravatar.com/avatar/dd70f9d8cc5f9ee488d68e7a787ba526.jpg?d\u003didenticon\u0026r\u003dpg\u0026s\u003d32","height":32},{"url":"https://www.gravatar.com/avatar/dd70f9d8cc5f9ee488d68e7a787ba526.jpg?d\u003didenticon\u0026r\u003dpg\u0026s\u003d56","height":56},{"url":"https://www.gravatar.com/avatar/dd70f9d8cc5f9ee488d68e7a787ba526.jpg?d\u003didenticon\u0026r\u003dpg\u0026s\u003d100","height":100},{"url":"https://www.gravatar.com/avatar/dd70f9d8cc5f9ee488d68e7a787ba526.jpg?d\u003didenticon\u0026r\u003dpg\u0026s\u003d120","height":120}]},"change_message_id":"756a26f32e4bcd8974ec5e7f63fc7ebfc316a160","unresolved":false,"context_lines":[{"line_number":36,"context_line":"pycbc::txns::dealloc_transactions(PyObject* obj)"},{"line_number":37,"context_line":"{"},{"line_number":38,"context_line":"  auto txns \u003d reinterpret_cast\u003cpycbc::txns::transactions*\u003e(PyCapsule_GetPointer(obj, \"txns_\"));"},{"line_number":39,"context_line":"  Py_BEGIN_ALLOW_THREADS txns-\u003etxns-\u003eclose();"},{"line_number":40,"context_line":"  delete txns;"},{"line_number":41,"context_line":"  Py_END_ALLOW_THREADS CB_LOG_DEBUG(\"dealloc transactions\");"},{"line_number":42,"context_line":"}"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"void"}],"source_content_type":"text/x-c++src","patch_set":3,"id":"2d3a1511_7a4de665","line":41,"range":{"start_line":39,"start_character":0,"end_line":41,"end_character":60},"in_reply_to":"75430187_941a2575","updated":"2026-07-27 16:14:01.000000000","message":"Acknowledged","commit_id":"cb57ba2316bb4b2f0b58c114206f861c4e02d27c"}]}
