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

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

From:
Nicholas Clark via perl5-changes
Date:
September 9, 2021 11:56
Subject:
[Perl/perl5] 7b6e25: The different xs_handshake() failures needdistinc...
Message ID:
Perl/perl5/push/refs/heads/blead/d40d6e-7b6e25@github.com
  Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: 7b6e25e427217d8a3b03cf4c6718be36a0fc221d
      https://github.com/Perl/perl5/commit/7b6e25e427217d8a3b03cf4c6718be36a0fc221d
  Author: Nicholas Clark <nick@ccl4.org>
  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().)





nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About