Re: [tor-bugs] #33087 [Core Tor/Tor]: closing stdio fds on exit can interfere with LeakSanitizer, etc

2020-04-16 Thread Tor Bug Tracker & Wiki
#33087: closing stdio fds on exit can interfere with LeakSanitizer, etc
-+-
 Reporter:  catalyst |  Owner:  teor
 Type:  defect   | Status:
 |  merge_ready
 Priority:  Medium   |  Milestone:  Tor:
 |  0.4.2.x-final
Component:  Core Tor/Tor |Version:  Tor:
 |  0.4.1.6
 Severity:  Normal   | Resolution:
 Keywords:  tor-log, 043-should, consider-   |  Actual Points:  0.5
  backport-after-0433, 041-backport, |
  042-backport   |
Parent ID:   | Points:  0.2
 Reviewer:  dgoulet  |Sponsor:
-+-

Comment (by arma):

 See also #33850, where they find that Tor (0.4.1.7 and 0.4.2.x) doesn't
 release its handles on log files during HUP, which means that in the deb
 package, logrotate (a) accumulates more and more file handles inside Tor,
 and (b) fills up your disk because nothing ever gets deleted. They
 narrowed it down to the fix in commit 8a23393eda which is part of this
 ticket. So: that would seem to be another reason to backport at the
 appropriate time.

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #33087 [Core Tor/Tor]: closing stdio fds on exit can interfere with LeakSanitizer, etc

2020-04-09 Thread Tor Bug Tracker & Wiki
#33087: closing stdio fds on exit can interfere with LeakSanitizer, etc
-+-
 Reporter:  catalyst |  Owner:  teor
 Type:  defect   | Status:
 |  merge_ready
 Priority:  Medium   |  Milestone:  Tor:
 |  0.4.2.x-final
Component:  Core Tor/Tor |Version:  Tor:
 |  0.4.1.6
 Severity:  Normal   | Resolution:
 Keywords:  tor-log, 043-should, consider-   |  Actual Points:  0.5
  backport-after-0433, 041-backport, |
  042-backport   |
Parent ID:   | Points:  0.2
 Reviewer:  dgoulet  |Sponsor:
-+-
Changes (by nickm):

 * milestone:  Tor: 0.4.3.x-final => Tor: 0.4.2.x-final


Comment:

 I've merged this to 0.4.3, and added a small tweak as
 c4da0a5094e21241db8ce0d8b12c2e4272fa49ef. (The tweak is to add fsync to
 the list of syscalls that our sandbox permits. Let's not duplicate the
 drama we had with the dup syscall.)

 Marking for backport. No need to backport the tweak, since the version of
 this branch targeting 0.4.1 doesn't use fsync.

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #33087 [Core Tor/Tor]: closing stdio fds on exit can interfere with LeakSanitizer, etc

2020-03-09 Thread Tor Bug Tracker & Wiki
#33087: closing stdio fds on exit can interfere with LeakSanitizer, etc
-+-
 Reporter:  catalyst |  Owner:  teor
 Type:  defect   | Status:
 |  merge_ready
 Priority:  Medium   |  Milestone:  Tor:
 |  0.4.3.x-final
Component:  Core Tor/Tor |Version:  Tor:
 |  0.4.1.6
 Severity:  Normal   | Resolution:
 Keywords:  tor-log, 043-should, consider-   |  Actual Points:  0.5
  backport-after-0433, 041-backport, |
  042-backport   |
Parent ID:   | Points:  0.2
 Reviewer:  dgoulet  |Sponsor:
-+-
Changes (by dgoulet):

 * status:  needs_review => merge_ready


Comment:

 lgtm. Merged PR 1723 to master.

 Leaving in 043 milestone for backport consideration.

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #33087 [Core Tor/Tor]: closing stdio fds on exit can interfere with LeakSanitizer, etc

2020-02-18 Thread Tor Bug Tracker & Wiki
#33087: closing stdio fds on exit can interfere with LeakSanitizer, etc
-+-
 Reporter:  catalyst |  Owner:  teor
 Type:  defect   | Status:
 |  needs_review
 Priority:  Medium   |  Milestone:  Tor:
 |  0.4.3.x-final
Component:  Core Tor/Tor |Version:  Tor:
 |  0.4.1.6
 Severity:  Normal   | Resolution:
 Keywords:  tor-log, 043-should, consider-   |  Actual Points:  0.5
  backport-after-0433, 041-backport, |
  042-backport   |
Parent ID:   | Points:  0.2
 Reviewer:  dgoulet  |Sponsor:
-+-
Changes (by dgoulet):

 * reviewer:   => dgoulet


--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #33087 [Core Tor/Tor]: closing stdio fds on exit can interfere with LeakSanitizer, etc

2020-02-12 Thread Tor Bug Tracker & Wiki
#33087: closing stdio fds on exit can interfere with LeakSanitizer, etc
-+-
 Reporter:  catalyst |  Owner:  teor
 Type:  defect   | Status:
 |  needs_review
 Priority:  Medium   |  Milestone:  Tor:
 |  0.4.3.x-final
Component:  Core Tor/Tor |Version:  Tor:
 |  0.4.1.6
 Severity:  Normal   | Resolution:
 Keywords:  tor-log, 043-should, consider-   |  Actual Points:  0.5
  backport-after-0433, 041-backport, |
  042-backport   |
Parent ID:   | Points:  0.2
 Reviewer:   |Sponsor:
-+-
Changes (by teor):

 * status:  needs_revision => needs_review
 * actualpoints:  0.4 => 0.5


Comment:

 See my PRs:

 Delete close():
 * 0.4.1: ​https://github.com/torproject/tor/pull/1722

 Replace close() with fsync():
 * 0.4.3: ​https://github.com/torproject/tor/pull/1723

 All the test branches are here:
 * ​https://github.com/teor2345/tor/branches/all?query=33087

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #33087 [Core Tor/Tor]: closing stdio fds on exit can interfere with LeakSanitizer, etc

2020-02-12 Thread Tor Bug Tracker & Wiki
#33087: closing stdio fds on exit can interfere with LeakSanitizer, etc
-+-
 Reporter:  catalyst |  Owner:  teor
 Type:  defect   | Status:
 |  needs_revision
 Priority:  Medium   |  Milestone:  Tor:
 |  0.4.3.x-final
Component:  Core Tor/Tor |Version:  Tor:
 |  0.4.1.6
 Severity:  Normal   | Resolution:
 Keywords:  tor-log, 043-should, consider-   |  Actual Points:  0.4
  backport-after-0433, 041-backport, |
  042-backport   |
Parent ID:   | Points:  0.2
 Reviewer:   |Sponsor:
-+-
Changes (by teor):

 * status:  needs_review => needs_revision


Comment:

 In fact, they'd be almost exactly like the issues we created by closing
 stderr early :-)

 Ok, I'll add fsync to configure, and use it when it's available. I think
 we should probably merge the fsync() fix to 0.4.3-alpha and later. fsync()
 is a very low risk function call.

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #33087 [Core Tor/Tor]: closing stdio fds on exit can interfere with LeakSanitizer, etc

2020-02-12 Thread Tor Bug Tracker & Wiki
#33087: closing stdio fds on exit can interfere with LeakSanitizer, etc
-+-
 Reporter:  catalyst |  Owner:  teor
 Type:  defect   | Status:
 |  needs_review
 Priority:  Medium   |  Milestone:  Tor:
 |  0.4.3.x-final
Component:  Core Tor/Tor |Version:  Tor:
 |  0.4.1.6
 Severity:  Normal   | Resolution:
 Keywords:  tor-log, 043-should, consider-   |  Actual Points:  0.4
  backport-after-0433, 041-backport, |
  042-backport   |
Parent ID:   | Points:  0.2
 Reviewer:   |Sponsor:
-+-

Comment (by nickm):

 Replying to [comment:12 nickm]:
 > I think it couldn't hurt to use fsync() if present.

 Rationale: The kind of problems that we might miss if we _don't_ use fsync
 would be very tricky to notice or debug otherwise.

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #33087 [Core Tor/Tor]: closing stdio fds on exit can interfere with LeakSanitizer, etc

2020-02-12 Thread Tor Bug Tracker & Wiki
#33087: closing stdio fds on exit can interfere with LeakSanitizer, etc
-+-
 Reporter:  catalyst |  Owner:  teor
 Type:  defect   | Status:
 |  needs_review
 Priority:  Medium   |  Milestone:  Tor:
 |  0.4.3.x-final
Component:  Core Tor/Tor |Version:  Tor:
 |  0.4.1.6
 Severity:  Normal   | Resolution:
 Keywords:  tor-log, 043-should, consider-   |  Actual Points:  0.4
  backport-after-0433, 041-backport, |
  042-backport   |
Parent ID:   | Points:  0.2
 Reviewer:   |Sponsor:
-+-

Comment (by nickm):

 I think it couldn't hurt to use fsync() if present.

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #33087 [Core Tor/Tor]: closing stdio fds on exit can interfere with LeakSanitizer, etc

2020-02-12 Thread Tor Bug Tracker & Wiki
#33087: closing stdio fds on exit can interfere with LeakSanitizer, etc
-+-
 Reporter:  catalyst |  Owner:  teor
 Type:  defect   | Status:
 |  needs_review
 Priority:  Medium   |  Milestone:  Tor:
 |  0.4.3.x-final
Component:  Core Tor/Tor |Version:  Tor:
 |  0.4.1.6
 Severity:  Normal   | Resolution:
 Keywords:  tor-log, 043-should, consider-   |  Actual Points:  0.4
  backport-after-0433, 041-backport, |
  042-backport   |
Parent ID:   | Points:  0.2
 Reviewer:   |Sponsor:
-+-
Changes (by teor):

 * actualpoints:  0.3 => 0.4


Comment:

 Replying to [comment:10 teor]:
 > fsync() doesn't exist on Windows, so I made the flush functions depend
 on HAVE_UNISTD_H.

 Windows doesn't have `fsync()`, but it does have `unistd.h`. So I just
 deleted the close functions for the backport branches, and cleaned up the
 log fd duplication on master.

 Do you think it's worth checking for `fsync()` at configure time, and
 flushing the files if it exists? I'd only make this change in master.

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #33087 [Core Tor/Tor]: closing stdio fds on exit can interfere with LeakSanitizer, etc

2020-02-11 Thread Tor Bug Tracker & Wiki
#33087: closing stdio fds on exit can interfere with LeakSanitizer, etc
-+-
 Reporter:  catalyst |  Owner:  teor
 Type:  defect   | Status:
 |  needs_review
 Priority:  Medium   |  Milestone:  Tor:
 |  0.4.3.x-final
Component:  Core Tor/Tor |Version:  Tor:
 |  0.4.1.6
 Severity:  Normal   | Resolution:
 Keywords:  tor-log, 043-should, consider-   |  Actual Points:  0.3
  backport-after-0433, 041-backport, |
  042-backport   |
Parent ID:   | Points:  0.2
 Reviewer:   |Sponsor:
-+-
Changes (by teor):

 * actualpoints:  0.2 => 0.3


Comment:

 fsync() doesn't exist on Windows, so I made the flush functions depend on
 HAVE_UNISTD_H.

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #33087 [Core Tor/Tor]: closing stdio fds on exit can interfere with LeakSanitizer, etc

2020-02-11 Thread Tor Bug Tracker & Wiki
#33087: closing stdio fds on exit can interfere with LeakSanitizer, etc
-+-
 Reporter:  catalyst |  Owner:  teor
 Type:  defect   | Status:
 |  needs_review
 Priority:  Medium   |  Milestone:  Tor:
 |  0.4.3.x-final
Component:  Core Tor/Tor |Version:  Tor:
 |  0.4.1.6
 Severity:  Normal   | Resolution:
 Keywords:  tor-log, 043-should, consider-   |  Actual Points:  0.2
  backport-after-0433, 041-backport, |
  042-backport   |
Parent ID:   | Points:  0.2
 Reviewer:   |Sponsor:
-+-
Changes (by teor):

 * status:  assigned => needs_review
 * points:   => 0.2
 * actualpoints:   => 0.2


--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #33087 [Core Tor/Tor]: closing stdio fds on exit can interfere with LeakSanitizer, etc

2020-02-11 Thread Tor Bug Tracker & Wiki
#33087: closing stdio fds on exit can interfere with LeakSanitizer, etc
-+-
 Reporter:  catalyst |  Owner:  teor
 Type:  defect   | Status:
 |  assigned
 Priority:  Medium   |  Milestone:  Tor:
 |  0.4.3.x-final
Component:  Core Tor/Tor |Version:  Tor:
 |  0.4.1.6
 Severity:  Normal   | Resolution:
 Keywords:  tor-log, 043-should, consider-   |  Actual Points:
  backport-after-0433, 041-backport, |
  042-backport   |
Parent ID:   | Points:
 Reviewer:   |Sponsor:
-+-
Changes (by teor):

 * owner:  (none) => teor
 * status:  needs_review => assigned


--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #33087 [Core Tor/Tor]: closing stdio fds on exit can interfere with LeakSanitizer, etc

2020-02-11 Thread Tor Bug Tracker & Wiki
#33087: closing stdio fds on exit can interfere with LeakSanitizer, etc
-+-
 Reporter:  catalyst |  Owner:  (none)
 Type:  defect   | Status:
 |  needs_review
 Priority:  Medium   |  Milestone:  Tor:
 |  0.4.3.x-final
Component:  Core Tor/Tor |Version:  Tor:
 |  0.4.1.6
 Severity:  Normal   | Resolution:
 Keywords:  tor-log, 043-should, consider-   |  Actual Points:
  backport-after-0433, 041-backport, |
  042-backport   |
Parent ID:   | Points:
 Reviewer:   |Sponsor:
-+-
Changes (by teor):

 * status:  new => needs_review
 * version:   => Tor: 0.4.1.6


Comment:

 fsync() is required to be async signal safe by POSIX, see:
 http://manpages.ubuntu.com/manpages/bionic/man7/signal-safety.7.html

 See my PRs:
 * 0.4.1: https://github.com/torproject/tor/pull/1722
 * 0.4.3: https://github.com/torproject/tor/pull/1723
   * trivial merge of two function renames
 * master: https://github.com/torproject/tor/pull/1724
   * extra commit to remove a redundant array of log fds

 All the test branches are here:
 * https://github.com/teor2345/tor/branches/all?query=33087

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #33087 [Core Tor/Tor]: closing stdio fds on exit can interfere with LeakSanitizer, etc

2020-01-29 Thread Tor Bug Tracker & Wiki
#33087: closing stdio fds on exit can interfere with LeakSanitizer, etc
-+-
 Reporter:  catalyst |  Owner:  (none)
 Type:  defect   | Status:  new
 Priority:  Medium   |  Milestone:  Tor:
 |  0.4.3.x-final
Component:  Core Tor/Tor |Version:
 Severity:  Normal   | Resolution:
 Keywords:  tor-log, 043-should, consider-   |  Actual Points:
  backport-after-0433, 041-backport, |
  042-backport   |
Parent ID:   | Points:
 Reviewer:   |Sponsor:
-+-

Comment (by teor):

 fsync() seems to be pretty standard on recent macOS:
 {{{
  fsync() causes all modified data and attributes of fildes to be moved
 to
  a permanent storage device.  This normally results in all in-core
 modi-
  fied copies of buffers for the associated file to be written to a
 disk.
 }}}

 There are other macOS functions for a complete flush to disk, but they are
 specifically for disks and power failures:
 {{{
  For applications that require tighter guarantees about the integrity
 of
  their data, Mac OS X provides the F_FULLFSYNC fcntl.  The F_FULLFSYNC
  fcntl asks the drive to flush all buffered data to permanent storage.
  Applications, such as databases, that require a strict ordering of
 writes
  should use F_FULLFSYNC to ensure that their data is written in the
 order
  they expect.  Please see fcntl(2) for more detail.
 }}}

 If fsync() is interrupt-safe, we should use it.

 If it's not, maybe we should do nothing?
 (The other related tickets to#31594 already write an extra newline to all
 of the error fds. So that should flush any line-oriented buffers.)

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #33087 [Core Tor/Tor]: closing stdio fds on exit can interfere with LeakSanitizer, etc

2020-01-29 Thread Tor Bug Tracker & Wiki
#33087: closing stdio fds on exit can interfere with LeakSanitizer, etc
-+-
 Reporter:  catalyst |  Owner:  (none)
 Type:  defect   | Status:  new
 Priority:  Medium   |  Milestone:  Tor:
 |  0.4.3.x-final
Component:  Core Tor/Tor |Version:
 Severity:  Normal   | Resolution:
 Keywords:  tor-log, 043-should, consider-   |  Actual Points:
  backport-after-0433, 041-backport, |
  042-backport   |
Parent ID:   | Points:
 Reviewer:   |Sponsor:
-+-

Comment (by nickm):

 Ah, right, fsync().  It wouldn't be terrible to try that.  ISTR that on
 some platforms (OSX?) fsync might do a bit more than it does elsewhere,
 but I could be wrong about that.  It can't hurt to true it.  (If we do,
 let's remember to list it in the sandbox.c table this time)

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #33087 [Core Tor/Tor]: closing stdio fds on exit can interfere with LeakSanitizer, etc

2020-01-29 Thread Tor Bug Tracker & Wiki
#33087: closing stdio fds on exit can interfere with LeakSanitizer, etc
-+-
 Reporter:  catalyst |  Owner:  (none)
 Type:  defect   | Status:  new
 Priority:  Medium   |  Milestone:  Tor:
 |  0.4.3.x-final
Component:  Core Tor/Tor |Version:
 Severity:  Normal   | Resolution:
 Keywords:  tor-log, 043-should, consider-   |  Actual Points:
  backport-after-0433, 041-backport, |
  042-backport   |
Parent ID:   | Points:
 Reviewer:   |Sponsor:
-+-

Comment (by catalyst):

 Replying to [comment:3 nickm]:
 > I don't think there's such a concept in posix as flushing an fd.  You
 can flush a FILE*, but we aren't using those.  Perhaps we could mark some
 fds (stdout, stderr) as not to be closed by this function?
 I think there's `fsync()` but that's largely to provide robustness against
 kernel or hardware failures? I thought usually the semantic was that
 synchronous writes queued in-kernel complete at process termination,
 though I'm having trouble finding anything definitive in POSIX about that.
 (POSIX does say that some asynchronous I/O operations may be canceled at
 process termination.)

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #33087 [Core Tor/Tor]: closing stdio fds on exit can interfere with LeakSanitizer, etc

2020-01-29 Thread Tor Bug Tracker & Wiki
#33087: closing stdio fds on exit can interfere with LeakSanitizer, etc
-+-
 Reporter:  catalyst |  Owner:  (none)
 Type:  defect   | Status:  new
 Priority:  Medium   |  Milestone:  Tor:
 |  0.4.3.x-final
Component:  Core Tor/Tor |Version:
 Severity:  Normal   | Resolution:
 Keywords:  tor-log, 043-should, consider-   |  Actual Points:
  backport-after-0433, 041-backport, |
  042-backport   |
Parent ID:   | Points:
 Reviewer:   |Sponsor:
-+-

Comment (by nickm):

 I don't think there's such a concept in posix as flushing an fd.  You can
 flush a FILE*, but we aren't using those.  Perhaps we could mark some fds
 (stdout, stderr) as not to be closed by this function?

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #33087 [Core Tor/Tor]: closing stdio fds on exit can interfere with LeakSanitizer, etc

2020-01-29 Thread Tor Bug Tracker & Wiki
#33087: closing stdio fds on exit can interfere with LeakSanitizer, etc
-+-
 Reporter:  catalyst |  Owner:  (none)
 Type:  defect   | Status:  new
 Priority:  Medium   |  Milestone:  Tor:
 |  0.4.3.x-final
Component:  Core Tor/Tor |Version:
 Severity:  Normal   | Resolution:
 Keywords:  tor-log, 043-should, consider-   |  Actual Points:
  backport-after-0433, 041-backport, |
  042-backport   |
Parent ID:   | Points:
 Reviewer:   |Sponsor:
-+-
Changes (by teor):

 * keywords:  tor-log =>
 tor-log, 043-should, consider-backport-after-0433, 041-backport,
 042-backport
 * milestone:  Tor: unspecified => Tor: 0.4.3.x-final


Comment:

 I added `tor_log_close_sigsafe_err_fds()` in #31594, it was merged to
 0.4.2, and later backported to 0.4.1. I've closed #31594, so we don't
 backport it any further.

 My original motivation for the change was that some OSes seem to lose the
 last few lines of tor log output, when it crashes.

 So I suggest we change `tor_log_close_sigsafe_err_fds()` to flush those
 file descriptors, rather than closing them. (And change its name as well.)

 We'll need to backport those changes to 0.4.1 and later.

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #33087 [Core Tor/Tor]: closing stdio fds on exit can interfere with LeakSanitizer, etc

2020-01-28 Thread Tor Bug Tracker & Wiki
#33087: closing stdio fds on exit can interfere with LeakSanitizer, etc
--+--
 Reporter:  catalyst  |  Owner:  (none)
 Type:  defect| Status:  new
 Priority:  Medium|  Milestone:  Tor: unspecified
Component:  Core Tor/Tor  |Version:
 Severity:  Normal| Resolution:
 Keywords:  tor-log   |  Actual Points:
Parent ID:| Points:
 Reviewer:|Sponsor:
--+--
Changes (by nickm):

 * cc: teor (added)


Comment:

 Adding teor to cc since they wrote the `tor_log_close_sigsafe_err_fds()`
 code.

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

[tor-bugs] #33087 [Core Tor/Tor]: closing stdio fds on exit can interfere with LeakSanitizer, etc

2020-01-28 Thread Tor Bug Tracker & Wiki
#33087: closing stdio fds on exit can interfere with LeakSanitizer, etc
--+--
 Reporter:  catalyst  |  Owner:  (none)
 Type:  defect| Status:  new
 Priority:  Medium|  Milestone:  Tor: unspecified
Component:  Core Tor/Tor  |Version:
 Severity:  Normal|   Keywords:  tor-log
Actual Points:|  Parent ID:
   Points:|   Reviewer:
  Sponsor:|
--+--
 At tor exit time, `tor_log_close_sigsafe_err_fds()` winds up closing
 stderr or stdout if they're being log destinations.  This can close stderr
 before tools like LeakSanitizer can output useful information, e.g., if
 there's a config setting like `Log notice stderr`.  (valgrind doesn't seem
 to have this problem, maybe because it runs a separate process?)

 Is it correct for us to close a default fd like stderr or stdout if we're
 not running as a daemon?  Other tools that do runtime interception might
 also be affected.  If we think we have a good reason to explicitly close
 these fds, we probably should document how tor's closing of these fds can
 interfere with debugging tools.

 nickm thinks this behavior might be new in 0.4.2 with the signal safety
 work.  I haven't had time to investigate further.

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs