Bug #110

gdp_gcl_close() raises assertion failure with active subscriptions

Added by Nitesh Mor about 3 years ago. Updated about 3 years ago.

Start date:
Due date:
% Done:



If there are active subscription on a GCL, a call to gdp_gcl_close() causes assertion failures (see relevant output below). The expected behavior is that if the gcl is not being referenced elsewhere (other than subscriptions, multireads, etc), it should be freed cleanly and any active subscriptions be terminated. (source:gdp/gdp_gcl_ops.c#L522)

*** Processing ack/nak 128=ACK_SUCCESS from socket 7
gdp_pdu_proc_resp(0x7fc128000f90 ACK_SUCCESS) gcl 0x215b900
_gdp_req_dispatch >>> ACK_SUCCESS (128) [gcl->refcnt 1]
ack_success: received ACK_SUCCESS for CMD_CLOSE
_gdp_req_dispatch <<< ACK_SUCCESS [gcl->refcnt 1]
    OK [200 = 0xc8]
<<< _gdp_invoke(0x215cc40 rid=0) CMD_CLOSE: OK [200 = 0xc8]
Assertion failed at gdp-reader:gdp_req.c:282: mutex &req->gcl->mutex (0x215b900) is not locked (should be 836)

A quick way to reproduce this behavior is

  1. Apply the attached patch to apps/gdp-reader.c, which intentionally calls gdp_gcl_close() with an active subscription.
  2. Invoke something like gdp-reader -D *=20 -s -f 0 -n 5 LOGNAME.
  3. Start appending data to LOGNAME using gdp-writer.

gdp-reader.patch Magnifier - Patch to gdp-reader (577 Bytes) Nitesh Mor, 06/21/2017 11:54 AM


#1 Updated by Eric Allman about 3 years ago

  • Status changed from New to Feedback

I believe this to be fixed in commit:c89b74ec, but with the network problems today I haven't been able to push the changes to the repo yet. Please check it and verify when I can push it out, probably tomorrow. Or you can apply the patch manually (below). Thanks.

------------------------------ gdp/gdp_gcl_ops.c ------------------------------
index afcd038..d195777 100644
@@ -154,12 +154,12 @@ _gdp_gcl_freehandle(gdp_gcl_t *gcl)
    // drop it from the name -> handle cache

-   // should be inacessible now
-   _gdp_gcl_unlock(gcl);
    // release any remaining requests
    _gdp_req_freeall(&gcl->reqs, NULL);

+   // should be inacessible now
+   _gdp_gcl_unlock(gcl);
    // free any additional per-GCL resources
    if (gcl->freefunc != NULL)

(Hmm, I guess I forgot to correct the spelling on "inaccessible".)

#2 Updated by Nitesh Mor about 3 years ago

  • Status changed from Feedback to Closed

Yes, it works. Thanks.
Closing the issue.

Also available in: Atom PDF