Bug 237132 - devel/tcl-trf: crc-zlib broken
Summary: devel/tcl-trf: crc-zlib broken
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Mikhail Teterin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-04-09 05:58 UTC by regulaar
Modified: 2019-04-11 04:39 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (freebsd-2024)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description regulaar 2019-04-09 05:58:42 UTC
crc-zlib is broken in devel/tcl-trf after port rev. 482639.

Proof:

% package require Trf
2.1.4
% set chk [crc-zlib {Hello, World!}]

% binary scan $chk i chksum
1
% format 0x%x $chksum
0x0

But we should get something different: https://wiki.tcl-lang.org/page/Trf

Apparently this is introduced in the following lines in patch-zlib:
190 	-  CRC = zf.zcrc32 (CRC, buffer, bufLen);
191 	+  CRC = crc32(0L, Z_NULL, 0);

No data are ever CRC'd here.

For Adler checksum things are better:
48 	-  ADLER = zf.zadler32 (ADLER, buffer, bufLen);
49 	+  ADLER = adler32 (ADLER, buffer, bufLen);

I hope no other filters are affected.
Comment 1 commit-hook freebsd_committer freebsd_triage 2019-04-11 04:37:59 UTC
A commit references this bug:

Author: mi
Date: Thu Apr 11 04:37:43 UTC 2019
New revision: 498636
URL: https://svnweb.freebsd.org/changeset/ports/498636

Log:
  The below-mentioned PR identified a problem, which should've been
  caught by the test-harness -- but was not, because the harness was
  not used correctly (for 10 years).

  Provide a new harness and fix the reported problem as well as another
  one -- with MD2 digests -- identified by the now-functioning
  test-suit.

  Bump PORTREVISION...

  PR:		237132
  Reported by:	Vadim Zborovsky

Changes:
  head/devel/tcl-trf/Makefile
  head/devel/tcl-trf/files/alltests.tcl
  head/devel/tcl-trf/files/patch-md2
  head/devel/tcl-trf/files/patch-zlib
Comment 2 Mikhail Teterin freebsd_committer freebsd_triage 2019-04-11 04:39:38 UTC
All should be fixed now. Many thanks for raising awareness!