Re: [tor-bugs] #29528 [Core Tor/Tor]: UndefinedBehaviorSanitizer errors should fail the unit tests

2020-05-21 Thread Tor Bug Tracker & Wiki
#29528: UndefinedBehaviorSanitizer errors should fail the unit tests
-+-
 Reporter:  teor |  Owner:  (none)
 Type:  defect   | Status:
 |  needs_revision
 Priority:  Medium   |  Milestone:  Tor:
 |  0.4.4.x-final
Component:  Core Tor/Tor |Version:
 Severity:  Normal   | Resolution:
 Keywords:  tor-ci, tor-test, 041-proposed,  |  Actual Points:  0.2
  035-backport, 040-backport, 041-should |
Parent ID:   | Points:  2
 Reviewer:  nickm|Sponsor:
-+-
Changes (by nickm):

 * milestone:  Tor: 0.4.1.x-final => Tor: 0.4.4.x-final


Comment:

 We should figure out what to do with this if at all possible.

--
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] #29528 [Core Tor/Tor]: UndefinedBehaviorSanitizer errors should fail the unit tests

2019-05-21 Thread Tor Bug Tracker & Wiki
#29528: UndefinedBehaviorSanitizer errors should fail the unit tests
-+-
 Reporter:  teor |  Owner:  (none)
 Type:  defect   | Status:
 |  needs_revision
 Priority:  Medium   |  Milestone:  Tor:
 |  0.4.1.x-final
Component:  Core Tor/Tor |Version:
 Severity:  Normal   | Resolution:
 Keywords:  tor-ci, tor-test, 041-proposed,  |  Actual Points:  0.2
  029-backport, 034-backport, 035-backport,  |
  040-backport, 041-should   |
Parent ID:   | Points:  2
 Reviewer:  nickm|Sponsor:
-+-

Comment (by cypherpunks):

 > So the UBSan runtime reports divisions by zero, but the UBSan trap does
 not? That's also really weird.
 Clang has very poor documentation, but a lot of features come from GCC,
 and Clang's devs recommend to use GCC docs :( plus "read the source" :(
 So, here's where it comes from (GCC):
 "Unlike other similar options, -fsanitize=float-divide-by-zero is not
 enabled by -fsanitize=undefined, since floating-point division by zero can
 be a legitimate way of obtaining infinities and NaNs."
 And `trap` one has the same default behavior:
 "The -fsanitize-undefined-trap-on-error option instructs the compiler to
 report undefined behavior using `__builtin_trap` rather than a libubsan
 library routine. The advantage of this is that the libubsan library is not
 needed and is not linked in, so this is usable even in freestanding
 environments."
 > And makes it hard to work out which one we should use.
 Should? You should try to ship Tor with production-grade version of UBSan:
 https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html#minimal-
 runtime

--
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] #29528 [Core Tor/Tor]: UndefinedBehaviorSanitizer errors should fail the unit tests

2019-05-20 Thread Tor Bug Tracker & Wiki
#29528: UndefinedBehaviorSanitizer errors should fail the unit tests
-+-
 Reporter:  teor |  Owner:  (none)
 Type:  defect   | Status:
 |  needs_revision
 Priority:  Medium   |  Milestone:  Tor:
 |  0.4.1.x-final
Component:  Core Tor/Tor |Version:
 Severity:  Normal   | Resolution:
 Keywords:  tor-ci, tor-test, 041-proposed,  |  Actual Points:  0.2
  029-backport, 034-backport, 035-backport,  |
  040-backport, 041-should   |
Parent ID:   | Points:  2
 Reviewer:  nickm|Sponsor:
-+-

Comment (by teor):

 Replying to [comment:21 cypherpunks]:
 > Replying to [comment:19 teor]:
 > > When we pass -fsanitize=undefined -fno-sanitize-recover=undefined
 -fsanitize-trap=undefined  -fsanitize-undefined-trap-on-error:
 > `trap` ones override non-trap ones and don’t use buggy UBSan run-time
 support.

 So the UBSan runtime reports divisions by zero, but the UBSan trap does
 not?
 That's also really weird. And makes it hard to work out which one we
 should use.

--
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] #29528 [Core Tor/Tor]: UndefinedBehaviorSanitizer errors should fail the unit tests

2019-05-16 Thread Tor Bug Tracker & Wiki
#29528: UndefinedBehaviorSanitizer errors should fail the unit tests
-+-
 Reporter:  teor |  Owner:  (none)
 Type:  defect   | Status:
 |  needs_revision
 Priority:  Medium   |  Milestone:  Tor:
 |  0.4.1.x-final
Component:  Core Tor/Tor |Version:
 Severity:  Normal   | Resolution:
 Keywords:  tor-ci, tor-test, 041-proposed,  |  Actual Points:  0.2
  029-backport, 034-backport, 035-backport,  |
  040-backport, 041-should   |
Parent ID:   | Points:  2
 Reviewer:  nickm|Sponsor:
-+-

Comment (by cypherpunks):

 Replying to [comment:19 teor]:
 > When we pass -fsanitize=undefined -fno-sanitize-recover=undefined
 -fsanitize-trap=undefined  -fsanitize-undefined-trap-on-error:
 `trap` ones override non-trap ones and don’t use buggy UBSan run-time
 support.

--
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] #29528 [Core Tor/Tor]: UndefinedBehaviorSanitizer errors should fail the unit tests

2019-03-26 Thread Tor Bug Tracker & Wiki
#29528: UndefinedBehaviorSanitizer errors should fail the unit tests
-+-
 Reporter:  teor |  Owner:  (none)
 Type:  defect   | Status:
 |  needs_revision
 Priority:  Medium   |  Milestone:  Tor:
 |  0.4.1.x-final
Component:  Core Tor/Tor |Version:
 Severity:  Normal   | Resolution:
 Keywords:  tor-ci, tor-test, 041-proposed,  |  Actual Points:  0.2
  029-backport, 034-backport, 035-backport,  |
  040-backport   |
Parent ID:   | Points:  2
 Reviewer:  nickm|Sponsor:
-+-
Changes (by teor):

 * status:  needs_information => needs_revision


Comment:

 Well, this is truly weird.

 When we pass -fsanitize=undefined:
 https://travis-ci.org/teor2345/tor/jobs/511294592#L2002
 We get:
 {{{
 circuitpadding/circuitpadding_sample_distribution: [forking]
 src/lib/math/prob_distr.c:1311:17: runtime error: division by zero
 SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior
 src/lib/math/prob_distr.c:1311:17 in
 ...
 }}}
 https://travis-ci.org/teor2345/tor/jobs/511294592#L4644

 When we pass -fsanitize=undefined -fno-sanitize-recover=undefined
 -fsanitize-trap=undefined  -fsanitize-undefined-trap-on-error:
 https://travis-ci.org/teor2345/tor/jobs/511273849#L2002
 We get no warnings or errors:
 {{{
 circuitpadding/circuitpadding_sample_distribution: [forking] OK
 }}}
 https://travis-ci.org/teor2345/tor/jobs/511273849#L4648

 That's truly weird. I'm going to have to test the new options one by one,
 to see which one has this unexpected behaviour.

--
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] #29528 [Core Tor/Tor]: UndefinedBehaviorSanitizer errors should fail the unit tests

2019-03-25 Thread Tor Bug Tracker & Wiki
#29528: UndefinedBehaviorSanitizer errors should fail the unit tests
-+-
 Reporter:  teor |  Owner:  (none)
 Type:  defect   | Status:
 |  needs_information
 Priority:  Medium   |  Milestone:  Tor:
 |  0.4.1.x-final
Component:  Core Tor/Tor |Version:
 Severity:  Normal   | Resolution:
 Keywords:  tor-ci, tor-test, 041-proposed,  |  Actual Points:  0.2
  029-backport, 034-backport, 035-backport,  |
  040-backport   |
Parent ID:   | Points:  2
 Reviewer:  nickm|Sponsor:
-+-
Changes (by teor):

 * reviewer:   => nickm


--
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] #29528 [Core Tor/Tor]: UndefinedBehaviorSanitizer errors should fail the unit tests

2019-03-25 Thread Tor Bug Tracker & Wiki
#29528: UndefinedBehaviorSanitizer errors should fail the unit tests
-+-
 Reporter:  teor |  Owner:  (none)
 Type:  defect   | Status:
 |  needs_information
 Priority:  Medium   |  Milestone:  Tor:
 |  0.4.1.x-final
Component:  Core Tor/Tor |Version:
 Severity:  Normal   | Resolution:
 Keywords:  tor-ci, tor-test, 041-proposed,  |  Actual Points:  0.2
  029-backport, 034-backport, 035-backport,  |
  040-backport   |
Parent ID:   | Points:  2
 Reviewer:   |Sponsor:
-+-
Changes (by teor):

 * reviewer:  nickm =>


Comment:

 Oops, that didn't work, we only get the test log from make check if a test
 fails.

 Let's try just doing a make test:
 https://github.com/torproject/tor/pull/846

 It's based on 0.4.0, so it should not have -fno-sanitize-float-divide-by-
 zero.

--
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] #29528 [Core Tor/Tor]: UndefinedBehaviorSanitizer errors should fail the unit tests

2019-03-25 Thread Tor Bug Tracker & Wiki
#29528: UndefinedBehaviorSanitizer errors should fail the unit tests
-+-
 Reporter:  teor |  Owner:  (none)
 Type:  defect   | Status:
 |  needs_information
 Priority:  Medium   |  Milestone:  Tor:
 |  0.4.1.x-final
Component:  Core Tor/Tor |Version:
 Severity:  Normal   | Resolution:
 Keywords:  tor-ci, tor-test, 041-proposed,  |  Actual Points:  0.2
  029-backport, 034-backport, 035-backport,  |
  040-backport   |
Parent ID:   | Points:  2
 Reviewer:  nickm|Sponsor:
-+-
Changes (by teor):

 * status:  merge_ready => needs_information


Comment:

 This ticket is not merge_ready, because we expect 0.4.0 to fail on float
 divide by zero, and it does not:

 Replying to [comment:13 teor]:
 > I made a pull request that always shows the test log:
 > https://github.com/torproject/tor/pull/838
 >
 > Hopefully that will help us work out what is going on.

--
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] #29528 [Core Tor/Tor]: UndefinedBehaviorSanitizer errors should fail the unit tests

2019-03-25 Thread Tor Bug Tracker & Wiki
#29528: UndefinedBehaviorSanitizer errors should fail the unit tests
-+-
 Reporter:  teor |  Owner:  (none)
 Type:  defect   | Status:
 |  merge_ready
 Priority:  Medium   |  Milestone:  Tor:
 |  0.4.1.x-final
Component:  Core Tor/Tor |Version:
 Severity:  Normal   | Resolution:
 Keywords:  tor-ci, tor-test, 041-proposed,  |  Actual Points:  0.2
  029-backport, 034-backport, 035-backport,  |
  040-backport   |
Parent ID:   | Points:  2
 Reviewer:  nickm|Sponsor:
-+-
Changes (by nickm):

 * status:  needs_review => merge_ready


Comment:

 This looks okay to me, though I am very leery of merging into 0.2.9 or
 earlier without a lot of testing in 0.4.1.

--
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] #29528 [Core Tor/Tor]: UndefinedBehaviorSanitizer errors should fail the unit tests

2019-03-25 Thread Tor Bug Tracker & Wiki
#29528: UndefinedBehaviorSanitizer errors should fail the unit tests
-+-
 Reporter:  teor |  Owner:  (none)
 Type:  defect   | Status:
 |  needs_review
 Priority:  Medium   |  Milestone:  Tor:
 |  0.4.1.x-final
Component:  Core Tor/Tor |Version:
 Severity:  Normal   | Resolution:
 Keywords:  tor-ci, tor-test, 041-proposed,  |  Actual Points:  0.2
  029-backport, 034-backport, 035-backport,  |
  040-backport   |
Parent ID:   | Points:  2
 Reviewer:  nickm|Sponsor:
-+-
Changes (by asn):

 * reviewer:   => nickm


--
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] #29528 [Core Tor/Tor]: UndefinedBehaviorSanitizer errors should fail the unit tests

2019-03-24 Thread Tor Bug Tracker & Wiki
#29528: UndefinedBehaviorSanitizer errors should fail the unit tests
-+-
 Reporter:  teor |  Owner:  (none)
 Type:  defect   | Status:
 |  needs_review
 Priority:  Medium   |  Milestone:  Tor:
 |  0.4.1.x-final
Component:  Core Tor/Tor |Version:
 Severity:  Normal   | Resolution:
 Keywords:  tor-ci, tor-test, 041-proposed,  |  Actual Points:  0.2
  029-backport, 034-backport, 035-backport,  |
  040-backport   |
Parent ID:   | Points:  2
 Reviewer:   |Sponsor:
-+-

Comment (by teor):

 I made a pull request that always shows the test log:
 https://github.com/torproject/tor/pull/838

 Hopefully that will help us work out what is going on.

--
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] #29528 [Core Tor/Tor]: UndefinedBehaviorSanitizer errors should fail the unit tests

2019-03-21 Thread Tor Bug Tracker & Wiki
#29528: UndefinedBehaviorSanitizer errors should fail the unit tests
-+-
 Reporter:  teor |  Owner:  (none)
 Type:  defect   | Status:
 |  needs_review
 Priority:  Medium   |  Milestone:  Tor:
 |  0.4.1.x-final
Component:  Core Tor/Tor |Version:
 Severity:  Normal   | Resolution:
 Keywords:  tor-ci, tor-test, 041-proposed,  |  Actual Points:  0.2
  029-backport, 034-backport, 035-backport,  |
  040-backport   |
Parent ID:   | Points:  2
 Reviewer:   |Sponsor:
-+-

Comment (by teor):

 Replying to [comment:9 teor]:
 > I expect 0.4.0 to fail until #29527 is merged. If it isn't failing, then
 maybe I made a mistake in this patch?

 I'd like the reviewer to help me work out what's going on here.

--
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] #29528 [Core Tor/Tor]: UndefinedBehaviorSanitizer errors should fail the unit tests

2019-03-20 Thread Tor Bug Tracker & Wiki
#29528: UndefinedBehaviorSanitizer errors should fail the unit tests
-+-
 Reporter:  teor |  Owner:  (none)
 Type:  defect   | Status:
 |  needs_review
 Priority:  Medium   |  Milestone:  Tor:
 |  0.4.1.x-final
Component:  Core Tor/Tor |Version:
 Severity:  Normal   | Resolution:
 Keywords:  tor-ci, tor-test, 041-proposed,  |  Actual Points:  0.2
  029-backport, 034-backport, 035-backport,  |
  040-backport   |
Parent ID:   | Points:  2
 Reviewer:   |Sponsor:
-+-

Comment (by teor):

 Link for #29693 failure:
 https://travis-ci.org/torproject/tor/jobs/508841104

 master failed on appveyor due to #29645:
 
https://ci.appveyor.com/project/torproject/tor/builds/23216905/job/1q8wji257qffgfs4

--
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] #29528 [Core Tor/Tor]: UndefinedBehaviorSanitizer errors should fail the unit tests

2019-03-20 Thread Tor Bug Tracker & Wiki
#29528: UndefinedBehaviorSanitizer errors should fail the unit tests
-+-
 Reporter:  teor |  Owner:  (none)
 Type:  defect   | Status:
 |  needs_review
 Priority:  Medium   |  Milestone:  Tor:
 |  0.4.1.x-final
Component:  Core Tor/Tor |Version:
 Severity:  Normal   | Resolution:
 Keywords:  tor-ci, tor-test, 041-proposed,  |  Actual Points:  0.2
  029-backport, 034-backport, 035-backport,  |
  040-backport   |
Parent ID:   | Points:  2
 Reviewer:   |Sponsor:
-+-

Comment (by teor):

 master failed due to #29693.

--
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] #29528 [Core Tor/Tor]: UndefinedBehaviorSanitizer errors should fail the unit tests

2019-03-20 Thread Tor Bug Tracker & Wiki
#29528: UndefinedBehaviorSanitizer errors should fail the unit tests
-+-
 Reporter:  teor |  Owner:  (none)
 Type:  defect   | Status:
 |  needs_review
 Priority:  Medium   |  Milestone:  Tor:
 |  0.4.1.x-final
Component:  Core Tor/Tor |Version:
 Severity:  Normal   | Resolution:
 Keywords:  tor-ci, tor-test, 041-proposed,  |  Actual Points:  0.2
  029-backport, 034-backport, 035-backport,  |
  040-backport   |
Parent ID:   | Points:  2
 Reviewer:   |Sponsor:
-+-

Comment (by teor):

 I expect 0.4.0 to fail until #29527 is merged. If it isn't failing, then
 maybe I made a mistake in this patch?

--
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] #29528 [Core Tor/Tor]: UndefinedBehaviorSanitizer errors should fail the unit tests

2019-03-20 Thread Tor Bug Tracker & Wiki
#29528: UndefinedBehaviorSanitizer errors should fail the unit tests
-+-
 Reporter:  teor |  Owner:  (none)
 Type:  defect   | Status:
 |  needs_review
 Priority:  Medium   |  Milestone:  Tor:
 |  0.4.1.x-final
Component:  Core Tor/Tor |Version:
 Severity:  Normal   | Resolution:
 Keywords:  tor-ci, tor-test, 041-proposed,  |  Actual Points:  0.2
  029-backport, 034-backport, 035-backport,  |
  040-backport   |
Parent ID:   | Points:  2
 Reviewer:   |Sponsor:
-+-
Changes (by teor):

 * status:  new => needs_review
 * keywords:  tor-ci, tor-test, 041-proposed =>
 tor-ci, tor-test, 041-proposed, 029-backport, 034-backport,
 035-backport, 040-backport
 * actualpoints:   => 0.2
 * milestone:  Tor: unspecified => Tor: 0.4.1.x-final


Comment:

 This ticket implements this fix, and all the child tickets.
 They can close when this ticket closes.

 Please review my branches for merging:
 * 0.2.9: https://github.com/torproject/tor/pull/812
 * 0.3.4: https://github.com/torproject/tor/pull/813

 And extra branches for testing that this fix doesn't fail CI:
 * 0.3.5: https://github.com/torproject/tor/pull/815
 * 0.4.0: https://github.com/torproject/tor/pull/816
 * master: https://github.com/torproject/tor/pull/817

 I tried to use all the current and legacy command-line arguments. I expect
 that the compilers will do something sensible if multiple arguments work:
 all we really need is the failure.

 The command-line arguments are listed here:
 https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html#usage
 https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html

 The library names are listed here:
 https://stackoverflow.com/questions/29392702/missing-libclang-rt-
 san-x86-64-a-file-for-llvm-compiler-rt
 https://bugzilla.redhat.com/show_bug.cgi?id=1303766

--
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] #29528 [Core Tor/Tor]: UndefinedBehaviorSanitizer errors should fail the unit tests

2019-02-25 Thread Tor Bug Tracker & Wiki
#29528: UndefinedBehaviorSanitizer errors should fail the unit tests
+--
 Reporter:  teor|  Owner:  (none)
 Type:  defect  | Status:  new
 Priority:  Medium  |  Milestone:  Tor:
|  unspecified
Component:  Core Tor/Tor|Version:
 Severity:  Normal  | Resolution:
 Keywords:  tor-ci, tor-test, 041-proposed  |  Actual Points:
Parent ID:  | Points:  2
 Reviewer:  |Sponsor:
+--

Comment (by riastradh):

 Replying to [comment:4 nickm]:
 > Seems plausible, but could I ask your opinion on the rest of that
 thread, where people are arguing about what's undefined and what isn't?

 There are four main points here:

 1. C99 technically does say of the `/` operator that 'if the value of the
 second operand is zero, the behavior is undefined'.  (C99, Sec. 6.5.5
 Multiplicative operators, clause 5, p. 82)

 2. Annex F specifies that all the arithmetic operations on floating-point
 types have IEEE 754 semantics: 'The `+`, `-`, `*`, and `/` operators
 provide the IEC 60559 [another name for IEEE 754, along with ISO/IEC 559]
 add, subtract, multiply, and divide operations.'  (C99, Annex F, F.3
 Operators and functions, p. 445)

 3. Strictly speaking, Annex F is optional.  Strictly speaking, there may
 be bugs in the IEEE 754 conformance of clang or gcc.  Strictly speaking,
 not everything is up to the compiler, so if you used clang or gcc but
 linked against a broken libm that didn't provide IEEE 754 semantics, it
 might be technically wrong for clang or gcc to advertise IEEE 754
 semantics (a.k.a. Annex F support, indicated by the definition of the
 `__STDC_IEC_559__` macro).

 4. Nobody except a disingenuous language lawyer trolling for a point would
 seriously choose to make clang or gcc deviate in any substantial way from
 IEEE 754 semantics.
  Essentially the entire body of numerical software on the planet of the
 past quarter century, outside now-obscure platforms like legacy IBM
 mainframes or VAXes, has been designed under the premise of IEEE 754
 semantics.  Even clang UB optimization attorneys, who might delete null
 pointer checks if they can be proven to follow undefined behaviour in the
 absence of `-fno-delete-null-pointer-checks`, don't seem to be inclined to
 take advantage of the potential room for disagreement between C99 6.5.5
 and Annex F.

 For an illustrative example of the value of IEEE 754 semantics, see the
 dozens of cases in #29527 that could have gone wrong if we didn't have
 IEEE 754 divide-by-zero semantics, but that do exactly the right thing
 even though I wasn't thinking about those cases when I wrote the code
 (until I wrote the test cases, and again later when I reviewed all the
 false positives).  Failure to support IEEE 754 semantics, particularly
 extremely basic parts like consistently giving infinities for division by
 zero, would likely be blamed for [[http://www-
 users.math.umn.edu/~arnold/disasters/ariane5rep.html|billion-dollar
 mistakes]].

--
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] #29528 [Core Tor/Tor]: UndefinedBehaviorSanitizer errors should fail the unit tests

2019-02-25 Thread Tor Bug Tracker & Wiki
#29528: UndefinedBehaviorSanitizer errors should fail the unit tests
+--
 Reporter:  teor|  Owner:  (none)
 Type:  defect  | Status:  new
 Priority:  Medium  |  Milestone:  Tor:
|  unspecified
Component:  Core Tor/Tor|Version:
 Severity:  Normal  | Resolution:
 Keywords:  tor-ci, tor-test, 041-proposed  |  Actual Points:
Parent ID:  | Points:  2
 Reviewer:  |Sponsor:
+--

Comment (by asn):

 Replying to [comment:3 riastradh]:
 > There is an open Clang bug for this:
 https://bugs.llvm.org/show_bug.cgi?id=19535
 >
 > Possible workaround: use `-fno-sanitize=float-divide-by-zero` in
 addition to `-fsanitize=undefined`.

 Provided a patch for this particular case in #29527.

--
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] #29528 [Core Tor/Tor]: UndefinedBehaviorSanitizer errors should fail the unit tests

2019-02-24 Thread Tor Bug Tracker & Wiki
#29528: UndefinedBehaviorSanitizer errors should fail the unit tests
+--
 Reporter:  teor|  Owner:  (none)
 Type:  defect  | Status:  new
 Priority:  Medium  |  Milestone:  Tor:
|  unspecified
Component:  Core Tor/Tor|Version:
 Severity:  Normal  | Resolution:
 Keywords:  tor-ci, tor-test, 041-proposed  |  Actual Points:
Parent ID:  | Points:  2
 Reviewer:  |Sponsor:
+--

Comment (by teor):

 Replying to [comment:3 riastradh]:
 > There is an open Clang bug for this:
 https://bugs.llvm.org/show_bug.cgi?id=19535
 >
 > Possible workaround: use `-fno-sanitize=float-divide-by-zero` in
 addition to `-fsanitize=undefined`.

 Ok, that's a workaround for the specific cases in #29527 which are not
 bugs.
 Let's implement it as part of that ticket?

 We should still fail tests when they encounter genuinely undefined
 behaviour.

--
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] #29528 [Core Tor/Tor]: UndefinedBehaviorSanitizer errors should fail the unit tests

2019-02-24 Thread Tor Bug Tracker & Wiki
#29528: UndefinedBehaviorSanitizer errors should fail the unit tests
+--
 Reporter:  teor|  Owner:  (none)
 Type:  defect  | Status:  new
 Priority:  Medium  |  Milestone:  Tor:
|  unspecified
Component:  Core Tor/Tor|Version:
 Severity:  Normal  | Resolution:
 Keywords:  tor-ci, tor-test, 041-proposed  |  Actual Points:
Parent ID:  | Points:  2
 Reviewer:  |Sponsor:
+--

Comment (by nickm):

 Seems plausible, but could I ask your opinion on the rest of that thread,
 where people are arguing about what's undefined and what isn't?

--
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] #29528 [Core Tor/Tor]: UndefinedBehaviorSanitizer errors should fail the unit tests

2019-02-22 Thread Tor Bug Tracker & Wiki
#29528: UndefinedBehaviorSanitizer errors should fail the unit tests
+--
 Reporter:  teor|  Owner:  (none)
 Type:  defect  | Status:  new
 Priority:  Medium  |  Milestone:  Tor:
|  unspecified
Component:  Core Tor/Tor|Version:
 Severity:  Normal  | Resolution:
 Keywords:  tor-ci, tor-test, 041-proposed  |  Actual Points:
Parent ID:  | Points:  2
 Reviewer:  |Sponsor:
+--

Comment (by riastradh):

 There is an open Clang bug for this:
 https://bugs.llvm.org/show_bug.cgi?id=19535

 Possible workaround: use `-fno-sanitize=float-divide-by-zero` in addition
 to `-fsanitize=undefined`.

--
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] #29528 [Core Tor/Tor]: UndefinedBehaviorSanitizer errors should fail the unit tests

2019-02-22 Thread Tor Bug Tracker & Wiki
#29528: UndefinedBehaviorSanitizer errors should fail the unit tests
+--
 Reporter:  teor|  Owner:  (none)
 Type:  defect  | Status:  new
 Priority:  Medium  |  Milestone:  Tor:
|  unspecified
Component:  Core Tor/Tor|Version:
 Severity:  Normal  | Resolution:
 Keywords:  tor-ci, tor-test, 041-proposed  |  Actual Points:
Parent ID:  | Points:  2
 Reviewer:  |Sponsor:
+--

Comment (by riastradh):

 FYI, exactly zero of the cases this sanitizer flagged as undefined
 behaviour in #29527 are actually undefined behaviour.  Of the ~50 reports,
 only two of them are ''potentially'' evidence of problems, but since the
 tests pass with no floating-point invalid-operation exceptions I suspect
 they might not be problems either.

--
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] #29528 [Core Tor/Tor]: UndefinedBehaviorSanitizer errors should fail the unit tests

2019-02-19 Thread Tor Bug Tracker & Wiki
#29528: UndefinedBehaviorSanitizer errors should fail the unit tests
+--
 Reporter:  teor|  Owner:  (none)
 Type:  defect  | Status:  new
 Priority:  Medium  |  Milestone:  Tor:
|  unspecified
Component:  Core Tor/Tor|Version:
 Severity:  Normal  | Resolution:
 Keywords:  tor-ci, tor-test, 041-proposed  |  Actual Points:
Parent ID:  | Points:  2
 Reviewer:  |Sponsor:
+--
Changes (by nickm):

 * keywords:  tor-ci, tor-test => tor-ci, tor-test, 041-proposed


--
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