{"action":"created","issue":{"url":"https://api.github.com/repos/libevent/libevent/issues/315","labels_url":"https://api.github.com/repos/libevent/libevent/issues/315/labels{/name}","comments_url":"https://api.github.com/repos/libevent/libevent/issues/315/comments","events_url":"https://api.github.com/repos/libevent/libevent/issues/315/events","html_url":"https://github.com/libevent/libevent/issues/315","id":126516681,"number":315,"title":"event_errx processing a read callback on a cancelled evhttp_request","user":{"login":"akrieger","id":667719,"avatar_url":"https://avatars.githubusercontent.com/u/667719?v=3","gravatar_id":"","url":"https://api.github.com/users/akrieger","html_url":"https://github.com/akrieger","followers_url":"https://api.github.com/users/akrieger/followers","following_url":"https://api.github.com/users/akrieger/following{/other_user}","gists_url":"https://api.github.com/users/akrieger/gists{/gist_id}","starred_url":"https://api.github.com/users/akrieger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akrieger/subscriptions","organizations_url":"https://api.github.com/users/akrieger/orgs","repos_url":"https://api.github.com/users/akrieger/repos","events_url":"https://api.github.com/users/akrieger/events{/privacy}","received_events_url":"https://api.github.com/users/akrieger/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-13T21:17:12Z","updated_at":"2016-01-14T01:05:28Z","closed_at":null,"body":"I'm falling into an internal libevent assert case when cancelling an active evhttp request from outside of its chunk callback. This reproduces fairly regularly, where I start a download, cancel it, create a new download (same resource, using Range headers to do a partial download), and cancelling it again. I've hit this assert 3/5 attempts (twice in a row, twice okay, then again). I'm using libevent master at commit 809bb39b2b7b632c86337877b483520d997cd5db\r\nAuthor: Azat Khuzhin <a3at.mail@gmail.com>\r\nDate:   Mon Nov 23 13:52:31 2015 +0300\r\n\r\n![libevent_bad](https://cloud.githubusercontent.com/assets/667719/12307935/39b28924-b9f7-11e5-83a0-9602f108adfe.PNG)\r\n\r\n\r\nhttps://github.com/libevent/libevent/blob/master/http.c#L1120-L1125\r\n\r\nStack trace:\r\n![libevent_stack](https://cloud.githubusercontent.com/assets/667719/12307960/69c6913c-b9f7-11e5-91cc-e2b0f6b13840.PNG)\r\n\r\nevent_exit:108\r\nevent_errx:163\r\nevhttp_read_cb:1127\r\nbufferevent_run_deferred_callbacks_locked:152\r\nevent_process_active_single_queue:1650\r\nevent_process_active:1735\r\nevent_base_loop:1957\r\nevent_base_dispatch:1769"},"comment":{"url":"https://api.github.com/repos/libevent/libevent/issues/comments/171489984","html_url":"https://github.com/libevent/libevent/issues/315#issuecomment-171489984","issue_url":"https://api.github.com/repos/libevent/libevent/issues/315","id":171489984,"user":{"login":"azat","id":430798,"avatar_url":"https://avatars.githubusercontent.com/u/430798?v=3","gravatar_id":"","url":"https://api.github.com/users/azat","html_url":"https://github.com/azat","followers_url":"https://api.github.com/users/azat/followers","following_url":"https://api.github.com/users/azat/following{/other_user}","gists_url":"https://api.github.com/users/azat/gists{/gist_id}","starred_url":"https://api.github.com/users/azat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azat/subscriptions","organizations_url":"https://api.github.com/users/azat/orgs","repos_url":"https://api.github.com/users/azat/repos","events_url":"https://api.github.com/users/azat/events{/privacy}","received_events_url":"https://api.github.com/users/azat/received_events","type":"User","site_admin":false},"created_at":"2016-01-14T01:05:28Z","updated_at":"2016-01-14T01:05:28Z","body":"On Wed, Jan 13, 2016 at 01:17:15PM -0800, akrieger wrote:\n> I'm falling into an internal libevent assert case when cancelling an active evhttp request from outside of its chunk callback. This reproduces fairly regularly, where I start a download, cancel it, create a new download (same resource, using Range headers to do a partial download), and cancelling it again. I've hit this assert 3/5 attempts (twice in a row, twice okay, then again). I'm using libevent master at commit 809bb39b2b7b632c86337877b483520d997cd5db\n\nCan you post a small reproducer?\n(And if you can write a regression for http layer, that would be great).\n\nThanks,\nAzat.\n"}}