{"action":"created","issue":{"url":"https://api.github.com/repos/fluent/fluent-bit/issues/774","repository_url":"https://api.github.com/repos/fluent/fluent-bit","labels_url":"https://api.github.com/repos/fluent/fluent-bit/issues/774/labels{/name}","comments_url":"https://api.github.com/repos/fluent/fluent-bit/issues/774/comments","events_url":"https://api.github.com/repos/fluent/fluent-bit/issues/774/events","html_url":"https://github.com/fluent/fluent-bit/issues/774","id":361779936,"node_id":"MDU6SXNzdWUzNjE3Nzk5MzY=","number":774,"title":"Fluent-bit crashes with a long input in ES output","user":{"login":"newtoncorp","id":185297,"node_id":"MDQ6VXNlcjE4NTI5Nw==","avatar_url":"https://avatars0.githubusercontent.com/u/185297?v=4","gravatar_id":"","url":"https://api.github.com/users/newtoncorp","html_url":"https://github.com/newtoncorp","followers_url":"https://api.github.com/users/newtoncorp/followers","following_url":"https://api.github.com/users/newtoncorp/following{/other_user}","gists_url":"https://api.github.com/users/newtoncorp/gists{/gist_id}","starred_url":"https://api.github.com/users/newtoncorp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/newtoncorp/subscriptions","organizations_url":"https://api.github.com/users/newtoncorp/orgs","repos_url":"https://api.github.com/users/newtoncorp/repos","events_url":"https://api.github.com/users/newtoncorp/events{/privacy}","received_events_url":"https://api.github.com/users/newtoncorp/received_events","type":"User","site_admin":false},"labels":[{"id":669489922,"node_id":"MDU6TGFiZWw2Njk0ODk5MjI=","url":"https://api.github.com/repos/fluent/fluent-bit/labels/troubleshooting","name":"troubleshooting","color":"fef2c0","default":false}],"state":"open","locked":false,"assignee":{"login":"edsiper","id":369718,"node_id":"MDQ6VXNlcjM2OTcxOA==","avatar_url":"https://avatars3.githubusercontent.com/u/369718?v=4","gravatar_id":"","url":"https://api.github.com/users/edsiper","html_url":"https://github.com/edsiper","followers_url":"https://api.github.com/users/edsiper/followers","following_url":"https://api.github.com/users/edsiper/following{/other_user}","gists_url":"https://api.github.com/users/edsiper/gists{/gist_id}","starred_url":"https://api.github.com/users/edsiper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edsiper/subscriptions","organizations_url":"https://api.github.com/users/edsiper/orgs","repos_url":"https://api.github.com/users/edsiper/repos","events_url":"https://api.github.com/users/edsiper/events{/privacy}","received_events_url":"https://api.github.com/users/edsiper/received_events","type":"User","site_admin":false},"assignees":[{"login":"edsiper","id":369718,"node_id":"MDQ6VXNlcjM2OTcxOA==","avatar_url":"https://avatars3.githubusercontent.com/u/369718?v=4","gravatar_id":"","url":"https://api.github.com/users/edsiper","html_url":"https://github.com/edsiper","followers_url":"https://api.github.com/users/edsiper/followers","following_url":"https://api.github.com/users/edsiper/following{/other_user}","gists_url":"https://api.github.com/users/edsiper/gists{/gist_id}","starred_url":"https://api.github.com/users/edsiper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edsiper/subscriptions","organizations_url":"https://api.github.com/users/edsiper/orgs","repos_url":"https://api.github.com/users/edsiper/repos","events_url":"https://api.github.com/users/edsiper/events{/privacy}","received_events_url":"https://api.github.com/users/edsiper/received_events","type":"User","site_admin":false}],"milestone":null,"comments":4,"created_at":"2018-09-19T14:36:07Z","updated_at":"2018-09-21T17:32:09Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"## Bug Report\r\n\r\n**Describe the bug**\r\nFluent-bit completely crashes on a realloc failure. This is probably due to a heap corruption in flb_msgpack_raw_to_json_str (https://github.com/fluent/fluent-bit/blob/45a85275adb69d92e57339671558be9f787fe0f8/src/flb_pack.c#L643)\r\n\r\n**To Reproduce**\r\n\r\nCreate a regex with a bunch of keys and flush to ES.\r\nWill explain with details how to reproduce in a controlled environment in a followup comment.\r\n\r\n**Expected behavior**\r\n\r\nNot crashing.\r\n\r\n**Your Environment**\r\n* Version used: head on master\r\n* Configuration: syslog udp input with haproxy logs, huge regex parser, es output\r\n* Environment name and version (e.g. Kubernetes? What version?): Compiled on Xenial, ran on Bionic\r\n* Server type and version: VM\r\n* Operating System and version: Bionic\r\n* Filters and plugins: syslog udp, regex parser, es output\r\n\r\n**Additional context**\r\n\r\nProgram crashes.\r\n\r\nI have a local bypass of the issue which is the following :\r\n```\r\n@@ -628,7 +629,7 @@ int flb_msgpack_raw_to_json_str(char *buf, size_t buf_size,\r\n         return -1;\r\n     }\r\n\r\n-    json_size = (buf_size * 1.2);\r\n+    json_size = (buf_size * 5);\r\n     json_buf = flb_calloc(1, json_size);\r\n     if (!json_buf) {\r\n         flb_errno();\r\n```"},"comment":{"url":"https://api.github.com/repos/fluent/fluent-bit/issues/comments/423614505","html_url":"https://github.com/fluent/fluent-bit/issues/774#issuecomment-423614505","issue_url":"https://api.github.com/repos/fluent/fluent-bit/issues/774","id":423614505,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMzYxNDUwNQ==","user":{"login":"edsiper","id":369718,"node_id":"MDQ6VXNlcjM2OTcxOA==","avatar_url":"https://avatars3.githubusercontent.com/u/369718?v=4","gravatar_id":"","url":"https://api.github.com/users/edsiper","html_url":"https://github.com/edsiper","followers_url":"https://api.github.com/users/edsiper/followers","following_url":"https://api.github.com/users/edsiper/following{/other_user}","gists_url":"https://api.github.com/users/edsiper/gists{/gist_id}","starred_url":"https://api.github.com/users/edsiper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edsiper/subscriptions","organizations_url":"https://api.github.com/users/edsiper/orgs","repos_url":"https://api.github.com/users/edsiper/repos","events_url":"https://api.github.com/users/edsiper/events{/privacy}","received_events_url":"https://api.github.com/users/edsiper/received_events","type":"User","site_admin":false},"created_at":"2018-09-21T17:32:09Z","updated_at":"2018-09-21T17:32:09Z","author_association":"CONTRIBUTOR","body":"thanks for confirming, I was not able to reproduce in Xenial without the code change.\r\n\r\nIf your reproducible case is fixed with 'json_size -1' I will go ahead and merge that change."}}
{"actor":{"display_login":"edsiper"}}