From: Tanaka Akira Date: 2013-11-14T20:31:24+09:00 Subject: [ruby-core:58335] Re: [ruby-trunk - Bug #9102][Open] ObjectSpace.dump_all creates a FD without close-on-exec flag 2013/11/11 akr (Akira Tanaka) : > Bug #9102: ObjectSpace.dump_all creates a FD without close-on-exec flag > https://bugs.ruby-lang.org/issues/9102 > I think we cannot use mkstemp(). Another reason we should avoid mkstemp() is that it doesn't respect TMPDIR environment variable. It makes CI difficult to remove temporary files reliably. It seems test/objspace/test_objspace.rb retains a temporary variable in /tmp. % ./ruby test/objspace/test_objspace.rb Run options: # Running tests: Finished tests in 0.626708s, 22.3390 tests/s, 101369.4049 assertions/s. 14 tests, 63529 assertions, 0 failures, 0 errors, 0 skips ruby -v: ruby 2.1.0dev (2013-11-14 trunk 43675) [x86_64-linux] % ls /tmp/rubyheap* /tmp/rubyheapIPCDjl chkbuild (CI used by rubyci.org) sets TMPDIR to a unique directory for each build to remove temporary files even if a test aborts. But temporary files created by mkstemp() are not removable because TMPDIR is not in effect. -- Tanaka Akira