{"action":"created","issue":{"url":"https://api.github.com/repos/owncloud/files_antivirus/issues/125","repository_url":"https://api.github.com/repos/owncloud/files_antivirus","labels_url":"https://api.github.com/repos/owncloud/files_antivirus/issues/125/labels{/name}","comments_url":"https://api.github.com/repos/owncloud/files_antivirus/issues/125/comments","events_url":"https://api.github.com/repos/owncloud/files_antivirus/issues/125/events","html_url":"https://github.com/owncloud/files_antivirus/issues/125","id":171048978,"number":125,"title":"Antivirus data stream problem fills log file","user":{"login":"ms270169","id":7106023,"avatar_url":"https://avatars.githubusercontent.com/u/7106023?v=3","gravatar_id":"","url":"https://api.github.com/users/ms270169","html_url":"https://github.com/ms270169","followers_url":"https://api.github.com/users/ms270169/followers","following_url":"https://api.github.com/users/ms270169/following{/other_user}","gists_url":"https://api.github.com/users/ms270169/gists{/gist_id}","starred_url":"https://api.github.com/users/ms270169/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ms270169/subscriptions","organizations_url":"https://api.github.com/users/ms270169/orgs","repos_url":"https://api.github.com/users/ms270169/repos","events_url":"https://api.github.com/users/ms270169/events{/privacy}","received_events_url":"https://api.github.com/users/ms270169/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/owncloud/files_antivirus/labels/blue-ticket","name":"blue-ticket","color":"0052cc"},{"url":"https://api.github.com/repos/owncloud/files_antivirus/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"VicDeo","id":991300,"avatar_url":"https://avatars.githubusercontent.com/u/991300?v=3","gravatar_id":"","url":"https://api.github.com/users/VicDeo","html_url":"https://github.com/VicDeo","followers_url":"https://api.github.com/users/VicDeo/followers","following_url":"https://api.github.com/users/VicDeo/following{/other_user}","gists_url":"https://api.github.com/users/VicDeo/gists{/gist_id}","starred_url":"https://api.github.com/users/VicDeo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VicDeo/subscriptions","organizations_url":"https://api.github.com/users/VicDeo/orgs","repos_url":"https://api.github.com/users/VicDeo/repos","events_url":"https://api.github.com/users/VicDeo/events{/privacy}","received_events_url":"https://api.github.com/users/VicDeo/received_events","type":"User","site_admin":false},"assignees":[{"login":"VicDeo","id":991300,"avatar_url":"https://avatars.githubusercontent.com/u/991300?v=3","gravatar_id":"","url":"https://api.github.com/users/VicDeo","html_url":"https://github.com/VicDeo","followers_url":"https://api.github.com/users/VicDeo/followers","following_url":"https://api.github.com/users/VicDeo/following{/other_user}","gists_url":"https://api.github.com/users/VicDeo/gists{/gist_id}","starred_url":"https://api.github.com/users/VicDeo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VicDeo/subscriptions","organizations_url":"https://api.github.com/users/VicDeo/orgs","repos_url":"https://api.github.com/users/VicDeo/repos","events_url":"https://api.github.com/users/VicDeo/events{/privacy}","received_events_url":"https://api.github.com/users/VicDeo/received_events","type":"User","site_admin":false},{"login":"DeepDiver1975","id":1005065,"avatar_url":"https://avatars.githubusercontent.com/u/1005065?v=3","gravatar_id":"","url":"https://api.github.com/users/DeepDiver1975","html_url":"https://github.com/DeepDiver1975","followers_url":"https://api.github.com/users/DeepDiver1975/followers","following_url":"https://api.github.com/users/DeepDiver1975/following{/other_user}","gists_url":"https://api.github.com/users/DeepDiver1975/gists{/gist_id}","starred_url":"https://api.github.com/users/DeepDiver1975/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DeepDiver1975/subscriptions","organizations_url":"https://api.github.com/users/DeepDiver1975/orgs","repos_url":"https://api.github.com/users/DeepDiver1975/repos","events_url":"https://api.github.com/users/DeepDiver1975/events{/privacy}","received_events_url":"https://api.github.com/users/DeepDiver1975/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/owncloud/files_antivirus/milestones/70","html_url":"https://github.com/owncloud/files_antivirus/milestones/9.1.3","labels_url":"https://api.github.com/repos/owncloud/files_antivirus/milestones/70/labels","id":2018791,"number":70,"title":"9.1.3","description":null,"creator":{"login":"PVince81","id":277525,"avatar_url":"https://avatars.githubusercontent.com/u/277525?v=3","gravatar_id":"","url":"https://api.github.com/users/PVince81","html_url":"https://github.com/PVince81","followers_url":"https://api.github.com/users/PVince81/followers","following_url":"https://api.github.com/users/PVince81/following{/other_user}","gists_url":"https://api.github.com/users/PVince81/gists{/gist_id}","starred_url":"https://api.github.com/users/PVince81/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PVince81/subscriptions","organizations_url":"https://api.github.com/users/PVince81/orgs","repos_url":"https://api.github.com/users/PVince81/repos","events_url":"https://api.github.com/users/PVince81/events{/privacy}","received_events_url":"https://api.github.com/users/PVince81/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":0,"state":"open","created_at":"2016-09-21T10:35:12Z","updated_at":"2016-10-20T14:39:34Z","due_on":null,"closed_at":null},"comments":12,"created_at":"2016-08-14T08:47:47Z","updated_at":"2016-10-23T22:35:12Z","closed_at":null,"body":"In _OCA\\Files_Antivirus\\Scanner.initScanner()_ the nINSTREAM method is prepared to scan for a virus. In the clamav config file (_/etc/clamav/clamd.conf_) you can configure the maximum stream size with the line _StreamMaxLength 4095M_\r\nWith the value 4095M the maximum value of 4GiB is used, a bigger value is not supported by clamav.\r\n\r\nNow in the function [OCA\\Files_Antivirus\\Scanner.scan(IScannable $item)](https://github.com/owncloud/files_antivirus/blob/master/lib/scanner.php#L61)  the scanning is done by cutting the file in small chunks (chunk size configureable, default size is 1024 bytes). Each chunk is streamed to the clamav-daemon.\r\n\r\nIf you have an video file with 5 GiB, there are 5368709120 chunks used. For the first 4294967296 chunks everything works fine.\r\n\r\nBut then the streaming size limit is reached and clamav-daemon closes the stream.\r\nFrom this moment for each chunk the call to _fwrite()_ will throw an exception and cause a line in the log file.\r\n\r\nFor the example of a 5GiB video file, 1073741824 exceptions and log file lines will be created.\r\nThat needs a lot of time (several minutes), trashes full the log file and is a risc to running out of memory in the filesystem.\r\n\r\nCorrect behavior would be:\r\n1) Not to use INSTREAM in case of file size over the stream limit\r\n2) In case of exception to stop reading the file and only to log one error in the log file"},"comment":{"url":"https://api.github.com/repos/owncloud/files_antivirus/issues/comments/255619541","html_url":"https://github.com/owncloud/files_antivirus/issues/125#issuecomment-255619541","issue_url":"https://api.github.com/repos/owncloud/files_antivirus/issues/125","id":255619541,"user":{"login":"VicDeo","id":991300,"avatar_url":"https://avatars.githubusercontent.com/u/991300?v=3","gravatar_id":"","url":"https://api.github.com/users/VicDeo","html_url":"https://github.com/VicDeo","followers_url":"https://api.github.com/users/VicDeo/followers","following_url":"https://api.github.com/users/VicDeo/following{/other_user}","gists_url":"https://api.github.com/users/VicDeo/gists{/gist_id}","starred_url":"https://api.github.com/users/VicDeo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VicDeo/subscriptions","organizations_url":"https://api.github.com/users/VicDeo/orgs","repos_url":"https://api.github.com/users/VicDeo/repos","events_url":"https://api.github.com/users/VicDeo/events{/privacy}","received_events_url":"https://api.github.com/users/VicDeo/received_events","type":"User","site_admin":false},"created_at":"2016-10-23T22:35:12Z","updated_at":"2016-10-23T22:35:12Z","body":"I think this is worth reading http://www.gossamer-threads.com/lists/clamav/users/67033#67033"}}
{"actor":{"display_login":"VicDeo"}}