{"action":"closed","issue":{"url":"https://api.github.com/repos/raffenet/mpich-migrate-test/issues/1656","repository_url":"https://api.github.com/repos/raffenet/mpich-migrate-test","labels_url":"https://api.github.com/repos/raffenet/mpich-migrate-test/issues/1656/labels{/name}","comments_url":"https://api.github.com/repos/raffenet/mpich-migrate-test/issues/1656/comments","events_url":"https://api.github.com/repos/raffenet/mpich-migrate-test/issues/1656/events","html_url":"https://github.com/raffenet/mpich-migrate-test/issues/1656","id":168683111,"number":1656,"title":"Ref Counting Macro w/ MPICH_DEBUG_HANDLES","user":{"login":"raffenet","id":1410792,"avatar_url":"https://avatars.githubusercontent.com/u/1410792?v=3","gravatar_id":"","url":"https://api.github.com/users/raffenet","html_url":"https://github.com/raffenet","followers_url":"https://api.github.com/users/raffenet/followers","following_url":"https://api.github.com/users/raffenet/following{/other_user}","gists_url":"https://api.github.com/users/raffenet/gists{/gist_id}","starred_url":"https://api.github.com/users/raffenet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raffenet/subscriptions","organizations_url":"https://api.github.com/users/raffenet/orgs","repos_url":"https://api.github.com/users/raffenet/repos","events_url":"https://api.github.com/users/raffenet/events{/privacy}","received_events_url":"https://api.github.com/users/raffenet/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-01T16:08:43Z","updated_at":"2016-08-01T16:08:44Z","closed_at":"2016-08-01T16:08:43Z","body":"**Originally by _michael.jahn@mailbox.tu-dresden.de_ on 2012-07-16 10:16:03 -0500**\n\n___\nHello MPICH Team,\n\nI just tryed to turn on reference counting w/ MPICH_DEBUG_HANDLES and ran across this code:\n[[BR]]\n\n```\nhttps://svn.mcs.anl.gov/repos/mpi/mpich2/trunk/src/include/mpihandlemem.h\n111 /* If we're debugging the handles (including reference counts),\n112    add an additional test.  The check on a max refcount helps to\n113    detect objects whose refcounts are not decremented as many times\n114    as they are incremented */\n115 #ifdef MPICH_DEBUG_HANDLES\n116 #define MPICH_DEBUG_MAX_REFCOUNT 64\n117 #define MPIU_HANDLE_CHECK_REFCOUNT(objptr_,op_)                                                     \\\n118     do {                                                                                            \\\n119         int local_ref_count_ = MPIU_Object_get_ref(objptr_);                                        \\\n120         printf(\"int local_ref_count_ # MPIU_Object_get_ref(objptr_)%d\\n\", MPIU_Object_get_ref(objptr_));\n121         if (local_ref_count_ > MPICH_DEBUG_MAX_REFCOUNT || local_ref_count_ < 0)                    \\\n122         {                                                                                           \\\n123             MPIU_DBG_MSG_FMT(HANDLE,TYPICAL,(MPIU_DBG_FDEST,                                        \\\n124                                              \"Invalid refcount (%d) in %p (0x%08x) %s\",             \\\n125                                              local_ref_count_, (objptr_), (objptr_)->handle, op_)); \\\n126         }                                                                                           \\\n127         MPIU_Assert(local_ref_count_ < 0);                                                          \\\n128     } while (0)\n129 #else\n130 #define MPIU_HANDLE_CHECK_REFCOUNT(objptr_,op_) \\\n131     MPIU_Assert(MPIU_Object_get_ref(objptr_) >= 0)\n132 #endif\n\n```\nI think there is a problem w/ the assert condition in the #if branch. I suggest (the comment & the #else case imply):[[BR]]\n\n127         MPIU_Assert(local_ref_count_ >= 0);                                                          \\[[BR]]\n\nHope this helps, Micha"}}
{"actor":{"display_login":"raffenet"}}