{"action":"created","issue":{"url":"https://api.github.com/repos/DynamoRIO/dynamorio/issues/1762","labels_url":"https://api.github.com/repos/DynamoRIO/dynamorio/issues/1762/labels{/name}","comments_url":"https://api.github.com/repos/DynamoRIO/dynamorio/issues/1762/comments","events_url":"https://api.github.com/repos/DynamoRIO/dynamorio/issues/1762/events","html_url":"https://github.com/DynamoRIO/dynamorio/issues/1762","id":100236864,"number":1762,"title":"Create callback_list in drcontainers","user":{"login":"byron-hawkins","id":1156776,"avatar_url":"https://avatars.githubusercontent.com/u/1156776?v=3","gravatar_id":"","url":"https://api.github.com/users/byron-hawkins","html_url":"https://github.com/byron-hawkins","followers_url":"https://api.github.com/users/byron-hawkins/followers","following_url":"https://api.github.com/users/byron-hawkins/following{/other_user}","gists_url":"https://api.github.com/users/byron-hawkins/gists{/gist_id}","starred_url":"https://api.github.com/users/byron-hawkins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/byron-hawkins/subscriptions","organizations_url":"https://api.github.com/users/byron-hawkins/orgs","repos_url":"https://api.github.com/users/byron-hawkins/repos","events_url":"https://api.github.com/users/byron-hawkins/events{/privacy}","received_events_url":"https://api.github.com/users/byron-hawkins/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/DynamoRIO/dynamorio/labels/Component-API","name":"Component-API","color":"FFFFFF"},{"url":"https://api.github.com/repos/DynamoRIO/dynamorio/labels/Component-Extension","name":"Component-Extension","color":"FFFFFF"},{"url":"https://api.github.com/repos/DynamoRIO/dynamorio/labels/OpSys-All","name":"OpSys-All","color":"FFFFFF"},{"url":"https://api.github.com/repos/DynamoRIO/dynamorio/labels/Priority-High","name":"Priority-High","color":"eb6420"},{"url":"https://api.github.com/repos/DynamoRIO/dynamorio/labels/Type-Feature","name":"Type-Feature","color":"84b6eb"},{"url":"https://api.github.com/repos/DynamoRIO/dynamorio/labels/Usability","name":"Usability","color":"FFFFFF"}],"state":"open","locked":false,"assignee":{"login":"byron-hawkins","id":1156776,"avatar_url":"https://avatars.githubusercontent.com/u/1156776?v=3","gravatar_id":"","url":"https://api.github.com/users/byron-hawkins","html_url":"https://github.com/byron-hawkins","followers_url":"https://api.github.com/users/byron-hawkins/followers","following_url":"https://api.github.com/users/byron-hawkins/following{/other_user}","gists_url":"https://api.github.com/users/byron-hawkins/gists{/gist_id}","starred_url":"https://api.github.com/users/byron-hawkins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/byron-hawkins/subscriptions","organizations_url":"https://api.github.com/users/byron-hawkins/orgs","repos_url":"https://api.github.com/users/byron-hawkins/repos","events_url":"https://api.github.com/users/byron-hawkins/events{/privacy}","received_events_url":"https://api.github.com/users/byron-hawkins/received_events","type":"User","site_admin":false},"milestone":null,"comments":8,"created_at":"2015-08-11T06:26:29Z","updated_at":"2015-08-11T14:28:01Z","closed_at":null,"body":"The new Dr. Fuzz feature of Dr. Memory (xref drmem [#1734](https://github.com/DynamoRIO/drmemory/issues/1734)) needs a generic callback list. Since drmgr already has one, we can just move it to drcontainers and make it available to all clients. \r\n\r\nA couple of changes should be made to the implementation to make it more friendly for general use:\r\n\r\n1. In the add function, when the `before` priority is not `NULL`, the list should return an error if that priority is not found in the list\r\n2. The resize function should remove invalid entries (i.e., not copy them to the new array) to minimize fragmentation for frequently modified callback lists\r\n\r\nTo avoid complications in the remove function, the list will need to allow direct index-based iteration, since existing usage by drmgr does not have a single key per entry (see `drmgr_bb_cb_remove()` in `drmgr.c`). "},"comment":{"url":"https://api.github.com/repos/DynamoRIO/dynamorio/issues/comments/129904809","html_url":"https://github.com/DynamoRIO/dynamorio/issues/1762#issuecomment-129904809","issue_url":"https://api.github.com/repos/DynamoRIO/dynamorio/issues/1762","id":129904809,"user":{"login":"derekbruening","id":6509618,"avatar_url":"https://avatars.githubusercontent.com/u/6509618?v=3","gravatar_id":"","url":"https://api.github.com/users/derekbruening","html_url":"https://github.com/derekbruening","followers_url":"https://api.github.com/users/derekbruening/followers","following_url":"https://api.github.com/users/derekbruening/following{/other_user}","gists_url":"https://api.github.com/users/derekbruening/gists{/gist_id}","starred_url":"https://api.github.com/users/derekbruening/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/derekbruening/subscriptions","organizations_url":"https://api.github.com/users/derekbruening/orgs","repos_url":"https://api.github.com/users/derekbruening/repos","events_url":"https://api.github.com/users/derekbruening/events{/privacy}","received_events_url":"https://api.github.com/users/derekbruening/received_events","type":"User","site_admin":false},"created_at":"2015-08-11T14:28:00Z","updated_at":"2015-08-11T14:28:00Z","body":"Originally we only had numeric orderings, and we added the before and after as hints.\r\n\r\nIn order for your scenario to work, you have to *change the callback order* later on.  That means that originally A is called first and then B.  Once C registers and wants to be after B but before A, you now have to *reorder* A and B.  This is a different concept from how we've been thinking about this all along.  This could break any existing users who are depending on the static ordering for ties of registration order (which I thought was documented -- but I don't see it now).\r\n\r\nI suppose we could switch to a dynamic ordering (documenting the change in the release notes) though to me it does not seem to be higher priority than many other features we'd like to have."}}