{"action":"created","issue":{"url":"https://api.github.com/repos/carols10cents/zopfli/issues/36","repository_url":"https://api.github.com/repos/carols10cents/zopfli","labels_url":"https://api.github.com/repos/carols10cents/zopfli/issues/36/labels{/name}","comments_url":"https://api.github.com/repos/carols10cents/zopfli/issues/36/comments","events_url":"https://api.github.com/repos/carols10cents/zopfli/issues/36/events","html_url":"https://github.com/carols10cents/zopfli/issues/36","id":192070778,"number":36,"title":"Stack overflow in zopfli","user":{"login":"shssoichiro","id":5951392,"avatar_url":"https://avatars.githubusercontent.com/u/5951392?v=3","gravatar_id":"","url":"https://api.github.com/users/shssoichiro","html_url":"https://github.com/shssoichiro","followers_url":"https://api.github.com/users/shssoichiro/followers","following_url":"https://api.github.com/users/shssoichiro/following{/other_user}","gists_url":"https://api.github.com/users/shssoichiro/gists{/gist_id}","starred_url":"https://api.github.com/users/shssoichiro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shssoichiro/subscriptions","organizations_url":"https://api.github.com/users/shssoichiro/orgs","repos_url":"https://api.github.com/users/shssoichiro/repos","events_url":"https://api.github.com/users/shssoichiro/events{/privacy}","received_events_url":"https://api.github.com/users/shssoichiro/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-11-28T17:44:29Z","updated_at":"2016-12-05T15:03:48Z","closed_at":"2016-12-01T17:41:59Z","body":"First, thank you for your work creating this library. I am attempting to integrate zopfli into my rust application, oxipng, using the following function to call zopfli:\r\n\r\n    pub fn zopfli_deflate(data: &[u8]) -> Result<Vec<u8>, PngError> {\r\n        let mut output = Vec::with_capacity(max(1024, data.len() / 20));\r\n        let options = zopfli::Options::default();\r\n        match zopfli::compress(&options, &zopfli::Format::Zlib, data, &mut output) {\r\n            Ok(_) => (),\r\n            Err(_) => return Err(PngError::new(\"Failed to compress in zopfli\")),\r\n        };\r\n        output.shrink_to_fit();\r\n        Ok(output)\r\n    }\r\n\r\nUpon running my suite of integration tests, my test for zopfli runs for about 90 seconds then crashes with the following error:\r\n\r\n    running 1 test\r\n    test zopfli_mode has been running for over 60 seconds\r\n    \r\n    thread 'zopfli_mode' has overflowed its stack\r\n    fatal runtime error: stack overflow\r\n    error: process didn't exit successfully: `/home/soichiro/repos/oxipng/target/debug/deps/flags-c3b726640fb23cfd zopfli` (signal: 6, SIGABRT: process abort signal)\r\n\r\nIf I run the test suite in release mode, the test crashes quickly with the following different error message (segfault):\r\n\r\n    running 1 test\r\n    error: process didn't exit successfully: `/home/soichiro/repos/oxipng/target/release/deps/flags-6d76a8384c81188c zopfli` (signal: 11, SIGSEGV: invalid memory reference)\r\n\r\nThe input data to zopfli is uncompressed PNG image data of around 600kb. Unfortunately, running with RUST_BACKTRACE=1 doesn't produce any additional information or a backtrace. The only test that crashes or fails is the one that uses zopfli."},"comment":{"url":"https://api.github.com/repos/carols10cents/zopfli/issues/comments/264876676","html_url":"https://github.com/carols10cents/zopfli/issues/36#issuecomment-264876676","issue_url":"https://api.github.com/repos/carols10cents/zopfli/issues/36","id":264876676,"user":{"login":"carols10cents","id":193874,"avatar_url":"https://avatars.githubusercontent.com/u/193874?v=3","gravatar_id":"","url":"https://api.github.com/users/carols10cents","html_url":"https://github.com/carols10cents","followers_url":"https://api.github.com/users/carols10cents/followers","following_url":"https://api.github.com/users/carols10cents/following{/other_user}","gists_url":"https://api.github.com/users/carols10cents/gists{/gist_id}","starred_url":"https://api.github.com/users/carols10cents/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carols10cents/subscriptions","organizations_url":"https://api.github.com/users/carols10cents/orgs","repos_url":"https://api.github.com/users/carols10cents/repos","events_url":"https://api.github.com/users/carols10cents/events{/privacy}","received_events_url":"https://api.github.com/users/carols10cents/received_events","type":"User","site_admin":false},"created_at":"2016-12-05T15:03:48Z","updated_at":"2016-12-05T15:03:48Z","body":"Yeah, there probably are, my rust code was benchmarking at slightly slower than the C code, but 25 seconds does seem excessive :-/ I've filed #37 for investigating with oxipng's images further.\r\n\r\nThere is a whole zopfli PNG part of the C code that I haven't even attempted porting yet, I'm not sure what the differences are and if it affects performance, compression ratio, both, neither. \r\n\r\nThank you for using the library, please keep reporting any issues you find!!! ❤️ ❤️ ❤️ "}}
{"actor":{"display_login":"carols10cents"}}