{"action":"created","issue":{"url":"https://api.github.com/repos/CGAL/cgal/issues/584","labels_url":"https://api.github.com/repos/CGAL/cgal/issues/584/labels{/name}","comments_url":"https://api.github.com/repos/CGAL/cgal/issues/584/comments","events_url":"https://api.github.com/repos/CGAL/cgal/issues/584/events","html_url":"https://github.com/CGAL/cgal/issues/584","id":124560505,"number":584,"title":"Bad Access in CGAL::Handle for CGAL::Epeck","user":{"login":"alecjacobson","id":2241689,"avatar_url":"https://avatars.githubusercontent.com/u/2241689?v=3","gravatar_id":"","url":"https://api.github.com/users/alecjacobson","html_url":"https://github.com/alecjacobson","followers_url":"https://api.github.com/users/alecjacobson/followers","following_url":"https://api.github.com/users/alecjacobson/following{/other_user}","gists_url":"https://api.github.com/users/alecjacobson/gists{/gist_id}","starred_url":"https://api.github.com/users/alecjacobson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alecjacobson/subscriptions","organizations_url":"https://api.github.com/users/alecjacobson/orgs","repos_url":"https://api.github.com/users/alecjacobson/repos","events_url":"https://api.github.com/users/alecjacobson/events{/privacy}","received_events_url":"https://api.github.com/users/alecjacobson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-01T20:36:27Z","updated_at":"2016-01-04T13:45:22Z","closed_at":null,"body":"Here's a little program that causes a memory violation.\r\n\r\n```cpp\r\n#include <CGAL/Exact_predicates_exact_constructions_kernel.h>\r\nint main()\r\n{\r\n  CGAL::Epeck::FT v = 0;\r\n  for(int i = 0;i<30825; i++)\r\n  {\r\n    v += 0;\r\n  }\r\n}\r\n```\r\n\r\nI'm using Apple LLVM version 7.0.2 (clang-700.1.81) on Mac OS X. If I change `30825` to `30824`, it runs OK. The problem seems to be related to the number of times `+=` is called.\r\n\r\nIf I switch to gcc 5.2 then the magic number is `43668`."},"comment":{"url":"https://api.github.com/repos/CGAL/cgal/issues/comments/168679279","html_url":"https://github.com/CGAL/cgal/issues/584#issuecomment-168679279","issue_url":"https://api.github.com/repos/CGAL/cgal/issues/584","id":168679279,"user":{"login":"afabri","id":3263539,"avatar_url":"https://avatars.githubusercontent.com/u/3263539?v=3","gravatar_id":"","url":"https://api.github.com/users/afabri","html_url":"https://github.com/afabri","followers_url":"https://api.github.com/users/afabri/followers","following_url":"https://api.github.com/users/afabri/following{/other_user}","gists_url":"https://api.github.com/users/afabri/gists{/gist_id}","starred_url":"https://api.github.com/users/afabri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/afabri/subscriptions","organizations_url":"https://api.github.com/users/afabri/orgs","repos_url":"https://api.github.com/users/afabri/repos","events_url":"https://api.github.com/users/afabri/events{/privacy}","received_events_url":"https://api.github.com/users/afabri/received_events","type":"User","site_admin":false},"created_at":"2016-01-04T13:45:22Z","updated_at":"2016-01-04T13:45:22Z","body":"The Exact_predicates_exact_constructions_kernel stores a directed acyclic graph of the operations, where each node stores an approximation (interval of doubles) the operation, and handles of the child nodes.  The error happens in the destructor, when it calls the destructor of the child of the destructror of the grand child ...   and the error is a stackoverflow. \r\n\r\nWe could derecursify this (and we then better at the same time derecursified the function `exact()`), but I am wondering if your usage of this lazy kernel is appropriate. When we present CGAL, we state that this lazy approach is not well suited for  iterative algorithms, and  I guess that is what your real application is about (thank you for having boiled it  down)."}}