mkazhdan / PoissonRecon

Poisson Surface Reconstruction
MIT License
1.59k stars 431 forks source link

Hardcoded /tmp files are created #281

Open nh2 opened 1 year ago

nh2 commented 1 year ago

In

https://github.com/mkazhdan/PoissonRecon/blob/d4e87157cf9b2152cd6a46886c8d36bda4acba85/Src/PoissonRecon.client.inl#L163

cacheFiles.emplace_back( std::tmpfile() )

std::tmpfile is used.

This writes large files to /tmp unoverridably (apparenlty std::tmpfile() ignores the TMPDIR environment variable, unlike std::filesystem_temp_directory_path. This can lead to out-of-disk conditions, such as #280.

It is also confusing, especially for programs where --tempDir is given, that then another temp directory is additionally used.

Finally, these cacheFiles are never close()d so they leak file descriptors all the way to the end of the process.

nh2 commented 1 year ago

I made improvements to this in my branch https://github.com/mkazhdan/PoissonRecon/compare/master...nh2:PoissonRecon:nh2fixes-v15.03