{"action":"created","issue":{"url":"https://api.github.com/repos/jdugge/BufferByPercentage/issues/9","labels_url":"https://api.github.com/repos/jdugge/BufferByPercentage/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/jdugge/BufferByPercentage/issues/9/comments","events_url":"https://api.github.com/repos/jdugge/BufferByPercentage/issues/9/events","html_url":"https://github.com/jdugge/BufferByPercentage/issues/9","id":112548326,"number":9,"title":"The plugin causes a segfault","user":{"login":"pcav","id":691842,"avatar_url":"https://avatars.githubusercontent.com/u/691842?v=3","gravatar_id":"","url":"https://api.github.com/users/pcav","html_url":"https://github.com/pcav","followers_url":"https://api.github.com/users/pcav/followers","following_url":"https://api.github.com/users/pcav/following{/other_user}","gists_url":"https://api.github.com/users/pcav/gists{/gist_id}","starred_url":"https://api.github.com/users/pcav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pcav/subscriptions","organizations_url":"https://api.github.com/users/pcav/orgs","repos_url":"https://api.github.com/users/pcav/repos","events_url":"https://api.github.com/users/pcav/events{/privacy}","received_events_url":"https://api.github.com/users/pcav/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-21T09:35:23Z","updated_at":"2015-10-21T10:34:32Z","closed_at":null,"body":"Both when writing to memory layer and to a shapefile.\r\nIt does not happen on all PCs on a course here, but we had it both on Win and on Debian."},"comment":{"url":"https://api.github.com/repos/jdugge/BufferByPercentage/issues/comments/149850009","html_url":"https://github.com/jdugge/BufferByPercentage/issues/9#issuecomment-149850009","issue_url":"https://api.github.com/repos/jdugge/BufferByPercentage/issues/9","id":149850009,"user":{"login":"jdugge","id":2399255,"avatar_url":"https://avatars.githubusercontent.com/u/2399255?v=3","gravatar_id":"","url":"https://api.github.com/users/jdugge","html_url":"https://github.com/jdugge","followers_url":"https://api.github.com/users/jdugge/followers","following_url":"https://api.github.com/users/jdugge/following{/other_user}","gists_url":"https://api.github.com/users/jdugge/gists{/gist_id}","starred_url":"https://api.github.com/users/jdugge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdugge/subscriptions","organizations_url":"https://api.github.com/users/jdugge/orgs","repos_url":"https://api.github.com/users/jdugge/repos","events_url":"https://api.github.com/users/jdugge/events{/privacy}","received_events_url":"https://api.github.com/users/jdugge/received_events","type":"User","site_admin":false},"created_at":"2015-10-21T10:34:32Z","updated_at":"2015-10-21T10:34:32Z","body":"Maybe this is caused by the iterative method not converging. Could you try replacing the `secant` method in `bufferbypercentage.py` with the following:\r\n\r\n```\r\ndef secant(func, oldx, x, *args, **kwargs):\r\n    \"\"\"Find the root of a function\"\"\"\r\n    TOL = kwargs.pop('TOL', 1e-6)\r\n    oldf, f = func(oldx, *args), func(x, *args)\r\n    iterations = 0\r\n    if (abs(f) > abs(oldf)):\r\n        oldx, x = x, oldx\r\n        oldf, f = f, oldf\r\n    while iterations < 100:\r\n        dx = f * (x - oldx) / float(f - oldf)\r\n        if abs(dx) < TOL * (1 + abs(x)):\r\n            return x - dx\r\n        oldx, x = x, x - dx\r\n        oldf, f = f, func(x, *args)\r\n        iterations += 1\r\n    print \"Maximum number of iterations reached, no convergence.\"\r\n    return x\r\n```"}}