develooper Front page | perl.perl5.changes | Postings from September 2021

[Perl/perl5] 7b6e25: The different xs_handshake() failures needdistinc...

Nicholas Clark via perl5-changes
September 9, 2021 11:56
[Perl/perl5] 7b6e25: The different xs_handshake() failures needdistinc...
Message ID:
  Branch: refs/heads/blead
  Commit: 7b6e25e427217d8a3b03cf4c6718be36a0fc221d
  Author: Nicholas Clark <>
  Date:   2021-09-09 (Thu, 09 Sep 2021)

  Changed paths:
    M pod/perldiag.pod
    M util.c

  Log Message:
  The different xs_handshake() failures need distinct messages

xs_handshake() makes two different comparisons that on failure are reported
as "got handshake key %p, needed %p", with opaque hexadecimal values.

The first is the "actual" key as generated by the HS_KEY() macro, which
encodes various values such as sizeof(PerlInterpreter) and the API version.
The second is the address of the current thread's PerlInterpreter struct.

Either can fail, and before this commit they would fail with identical text.
Hence it wasn't obvious what the problem was, causing "confusion and delay"
if one tried to decode the hexadecimal output as the wrong thing. (For
example when it's actually pointers mismatching, but one tries to decode the
values into API version and structure size, assuming that the values were
the packed output from HS_KEY().) Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About