{"action":"opened","issue":{"url":"https://api.github.com/repos/PDAL/PDAL/issues/953","labels_url":"https://api.github.com/repos/PDAL/PDAL/issues/953/labels{/name}","comments_url":"https://api.github.com/repos/PDAL/PDAL/issues/953/comments","events_url":"https://api.github.com/repos/PDAL/PDAL/issues/953/events","html_url":"https://github.com/PDAL/PDAL/issues/953","id":93146943,"number":953,"title":"LasWriter writing to bad stream","user":{"login":"hobu","id":87751,"avatar_url":"https://avatars.githubusercontent.com/u/87751?v=3","gravatar_id":"","url":"https://api.github.com/users/hobu","html_url":"https://github.com/hobu","followers_url":"https://api.github.com/users/hobu/followers","following_url":"https://api.github.com/users/hobu/following{/other_user}","gists_url":"https://api.github.com/users/hobu/gists{/gist_id}","starred_url":"https://api.github.com/users/hobu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hobu/subscriptions","organizations_url":"https://api.github.com/users/hobu/orgs","repos_url":"https://api.github.com/users/hobu/repos","events_url":"https://api.github.com/users/hobu/events{/privacy}","received_events_url":"https://api.github.com/users/hobu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-07-05T21:04:18Z","updated_at":"2015-07-05T21:04:18Z","closed_at":null,"body":"There's a situation that seems to only manifest on linux where valgrind reports the following when doing:\r\n```valgrind --tool=memcheck /home/gridusr/local/src/PDAL/bin/pdal translate bad-translate.laz foo.laz &> vgrind.txt```\r\n\r\nI'm convinced this is some kind of heap corruption issue, as @msmitherdc has seen it under `RelWithDebugInfo` and `Release` builds on a specific machine, but it is possible that the compiler is at fault (gcc 4.8.2) or something else is to blame too. I'm just not sure.\r\n\r\n```==9013== Syscall param write(buf) points to uninitialised byte(s)\r\n==9013==    at 0x39BB60E6E0: __write_nocancel (in /lib64/libpthread-2.12.so)\r\n==9013==    by 0x39BE2BA535: ??? (in /usr/lib64/libstdc++.so.6.0.13)\r\n==9013==    by 0x39BE26BDAE: std::basic_filebuf<char, std::char_traits<char> >::_M_convert_to_external(char*, long) (in /usr/lib64/libstdc++.so.6.0.13)\r\n==9013==    by 0x39BE26BECD: std::basic_filebuf<char, std::char_traits<char> >::overflow(int) (in /usr/lib64/libstdc++.so.6.0.13)\r\n==9013==    by 0x39BE26C61D: std::basic_filebuf<char, std::char_traits<char> >::_M_terminate_output() (in /usr/lib64/libstdc++.so.6.0.13)\r\n==9013==    by 0x39BE26EC61: std::basic_filebuf<char, std::char_traits<char> >::_M_seek(long, std::_Ios_Seekdir, __mbstate_t) (in /usr/lib64/libstdc++.so.6.0.13)\r\n==9013==    by 0x39BE26EF49: std::basic_filebuf<char, std::char_traits<char> >::seekoff(long, std::_Ios_Seekdir, std::_Ios_Openmode) (in /usr/lib64/libstdc++.so.6.0.13)\r\n==9013==    by 0x39BE291020: std::ostream::tellp() (in /usr/lib64/libstdc++.so.6.0.13)\r\n==9013==    by 0x4D3860C: pdal::LasWriter::ready(pdal::BasePointTable&) (LasWriter.cpp:267)\r\n==9013==    by 0x4CE54B9: pdal::Stage::execute(pdal::BasePointTable&) (Stage.cpp:112)\r\n==9013==    by 0x4DB5FB9: pdal::TranslateKernel::execute() (TranslateKernel.cpp:358)\r\n==9013==    by 0x4CA026E: pdal::Kernel::innerRun() (Kernel.cpp:323)\r\n==9013==  Address 0x13a04acc is 252 bytes inside a block of size 8,192 alloc'd\r\n==9013==    at 0x4A07192: operator new[](unsigned long) (vg_replace_malloc.c:363)\r\n==9013==    by 0x39BE26B80B: std::basic_filebuf<char, std::char_traits<char> >::_M_allocate_internal_buffer() (in /usr/lib64/libstdc++.so.6.0.13)\r\n==9013==    by 0x39BE26CCF6: std::basic_filebuf<char, std::char_traits<char> >::open(char const*, std::_Ios_Openmode) (in /usr/lib64/libstdc++.so.6.0.13)\r\n==9013==    by 0x64E2A05: pdal::FileUtils::createFile(std::string const&, bool) (fstream:281)\r\n==9013==    by 0x4D38775: pdal::LasWriter::ready(pdal::BasePointTable&) (LasWriter.cpp:232)\r\n==9013==    by 0x4CE54B9: pdal::Stage::execute(pdal::BasePointTable&) (Stage.cpp:112)\r\n==9013==    by 0x4DB5FB9: pdal::TranslateKernel::execute() (TranslateKernel.cpp:358)\r\n==9013==    by 0x4CA026E: pdal::Kernel::innerRun() (Kernel.cpp:323)\r\n==9013==    by 0x4CA0429: pdal::Kernel::do_execution() (Kernel.cpp:149)\r\n==9013==    by 0x4CA0693: pdal::Kernel::run(int, char const**, std::string const&) (Kernel.cpp:208)\r\n==9013==    by 0x40576B: main (pdal.cpp:246)\r\n```"}}