[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [tor-bugs] #22870 [Core Tor/Tor]: consdiff test fails on OS X
#22870: consdiff test fails on OS X
--------------------------+------------------------------------
Reporter: pastly | Owner:
Type: defect | Status: merge_ready
Priority: Low | Milestone: Tor: 0.3.1.x-final
Component: Core Tor/Tor | Version:
Severity: Normal | Resolution:
Keywords: | Actual Points:
Parent ID: | Points:
Reviewer: | Sponsor:
--------------------------+------------------------------------
Comment (by pastly):
Replying to [comment:3 teor]:
>
> What versions of macOS does this fail on?
> (We should test on it more often.)
>
10.11.6 (I'm calling it OS X on purpose :p)
> On macOS 10.12.5, Xcode 8.3.3, clang 3.9.1 I see:
> {{{
> consdiff/base64cmp: OK
> }}}
>
> But I also see in the macOS memcmp man page:
>
> The memcmp() function returns zero if the two strings are
identical, oth-
> erwise returns the difference between the first two differing bytes
> (treated as unsigned char values, so that `\200' is greater than
`\0',
> for example). Zero-length strings are always identical. This
behavior
> is not required by C and portable code should only depend on the
sign of
> the returned value.
>
> Whereas strcmp is ambiguous:
>
> The strcmp() and strncmp() functions return an integer greater
than,
> equal to, or less than 0, according as the string s1 is greater
than,
> equal to, or less than the string s2. The comparison is done using
> unsigned characters, so that `\200' is greater than `\0'.
The behavior I saw was definitely more in line with what you've quoted for
memcmp.
I'm very weak on OS X/macOS development. I don't seem to have Xcode
installed. `clang --version` says
{{{
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
}}}
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/22870#comment:4>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs