{"action":"created","issue":{"url":"https://api.github.com/repos/rdkit/rdkit/issues/1196","repository_url":"https://api.github.com/repos/rdkit/rdkit","labels_url":"https://api.github.com/repos/rdkit/rdkit/issues/1196/labels{/name}","comments_url":"https://api.github.com/repos/rdkit/rdkit/issues/1196/comments","events_url":"https://api.github.com/repos/rdkit/rdkit/issues/1196/events","html_url":"https://github.com/rdkit/rdkit/issues/1196","id":194290055,"number":1196,"title":"instability of pyAvalonTools.InitCheckMol","user":{"login":"rvianello","id":383098,"avatar_url":"https://avatars.githubusercontent.com/u/383098?v=3","gravatar_id":"","url":"https://api.github.com/users/rvianello","html_url":"https://github.com/rvianello","followers_url":"https://api.github.com/users/rvianello/followers","following_url":"https://api.github.com/users/rvianello/following{/other_user}","gists_url":"https://api.github.com/users/rvianello/gists{/gist_id}","starred_url":"https://api.github.com/users/rvianello/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rvianello/subscriptions","organizations_url":"https://api.github.com/users/rvianello/orgs","repos_url":"https://api.github.com/users/rvianello/repos","events_url":"https://api.github.com/users/rvianello/events{/privacy}","received_events_url":"https://api.github.com/users/rvianello/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-12-08T09:48:33Z","updated_at":"2016-12-08T12:52:55Z","closed_at":null,"body":"The struchk initialization function in the C++ bindings to the AvalonTools package\r\n\r\n`  int initCheckMol(const std::string &optString) {\r\n    return InitCheckMol((char *) optString.c_str());\r\n  }`\r\n\r\nreceives the options string as a `const std::string &` and casts the result of `optString.c_str()` to `(char *)` before passing it to the C implementation.\r\n\r\nA comment in the AvalonTools code (also present in version 1.2.0 from sourceforge) includes the following warning:\r\n\r\n`Note: The opt string is modified and used to provide storage for '\\0' terminated strings\r\ncollected as 'argument' strings.`\r\n\r\nI suspect the current C++ `initCheckMol` implementation could be therefore responsible for some of the instabilities related to this struchk initialization step and that it should be therefore modified to forward a copy of the options string."},"comment":{"url":"https://api.github.com/repos/rdkit/rdkit/issues/comments/265733111","html_url":"https://github.com/rdkit/rdkit/issues/1196#issuecomment-265733111","issue_url":"https://api.github.com/repos/rdkit/rdkit/issues/1196","id":265733111,"user":{"login":"rvianello","id":383098,"avatar_url":"https://avatars.githubusercontent.com/u/383098?v=3","gravatar_id":"","url":"https://api.github.com/users/rvianello","html_url":"https://github.com/rvianello","followers_url":"https://api.github.com/users/rvianello/followers","following_url":"https://api.github.com/users/rvianello/following{/other_user}","gists_url":"https://api.github.com/users/rvianello/gists{/gist_id}","starred_url":"https://api.github.com/users/rvianello/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rvianello/subscriptions","organizations_url":"https://api.github.com/users/rvianello/orgs","repos_url":"https://api.github.com/users/rvianello/repos","events_url":"https://api.github.com/users/rvianello/events{/privacy}","received_events_url":"https://api.github.com/users/rvianello/received_events","type":"User","site_admin":false},"created_at":"2016-12-08T12:52:55Z","updated_at":"2016-12-08T12:52:55Z","body":"Like other bugs that include writing things at random into someone else's dynamically allocated memory, the problem is not strictly reproducible, so I don't know if a specific test-case would make sense, the code fails at performing a basic init operation. If pyAvalonTools.InitCheckMol is passed an ill-formed random string, you may get a successful return value (that would be unexpected), garbage error messages and more rarely a segmentation fault terminating the interpreter."}}
{"actor":{"display_login":"rvianello"}}