Tcl Library Source Code

View Ticket
Login
Ticket UUID: 819e42b05c7c30ab6225249be3f96d814997c0ac
Title: md4 requires wrong package version
Type: Bug Version:
Submitter: bovine Created on: 2017-10-03 15:43:12
Subsystem: md4 Assigned To: aku
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2017-10-31 20:11:42
Resolution: Fixed Closed By: aku
    Closed on: 2017-10-31 20:11:42
Description:
In the file modules/md4/md4.tcl, version 1.0 is required:
https://core.tcl.tk/tcllib/artifact/a26bcde2a4fdea3b

    catch {package require md4c 1.0};       # tcllib critcl alternative


But in modules/md4/md4c.tcl, version 1.1.0 is provided:
https://core.tcl.tk/tcllib/artifact/f272eb0a02c81259

    package provide md4c 1.1.0

This causes a spurious error to occur, which can be noticed if you have a global error handler in your parent program.
User Comments: aku added on 2017-10-31 20:11:42:
Removing the ineffective `package require` command.
Review of the sources shows that md4 has a `LoadAccelerator` command which will be invoked at the end to conditionally look for boosting C code (`critcl`, `cryptkit`), and the `critcl` part looks for both `tcllibc` and `md4c` anyway.

Bumping to version 1.0.7.

Changed with commit [dba79cf013].

Thank you for the report. (And your patience).

bovine added on 2017-10-10 19:29:45:
That works.

$ tclsh
tclsh8.6 [/tmp] package require md4
1.0.6
tclsh8.6 [/tmp] ::md4::md4c hello
†d7ËzyKÎ+rzÌbî'

So either the pkgIndex.tcl is missing a line for md4c, or the ineffective "package require md4c" should be changed/removed from modules/md4/md4.tcl

aku added on 2017-10-10 19:18:45:
Reading

> $ tclsh
> tclsh8.6 [/tmp] package require md4c 1.0
> can't find package md4c 1.0
> while evaluating package require md4c 1.0

What happens if you as for `md4`, not `md4c` ?

I believe that it should find and load `md4`, and that should look for and load `tcllibc`, getting you the C implementation of md4.

> tclsh8.6 [/tmp] package require tcllibc
> 0.3.15
> tclsh8.6 [/tmp] ::md4::md4c hello

The `make critcl` target builds `tcllibc` which contains all the C parts of Tcllib.

I don't think that I have Makefile targets to build just the `md4c` part, etc.
Although that might be doable via `sak.tcl critcl md4c`.

Tclhttpd looks to be out of date in this regard, trying to get just `md4c`.

bovine added on 2017-10-04 22:23:51:
$ tclsh

tclsh8.6 [/tmp] package require md4c 1.0
can't find package md4c 1.0
while evaluating package require md4c 1.0
tclsh8.6 [/tmp] package require md4c
can't find package md4c
while evaluating package require md4c
tclsh8.6 [/tmp] package require tcllibc
0.3.15
tclsh8.6 [/tmp] ::md4::md4c hello
†d7ËzyKÎ+rzÌbî'

bovine added on 2017-10-04 22:20:17:
This is what we are seeing logged in our /var/log/httpd.log under Apache Rivet with a global error handler:

ERRINFO: can’t find package md4c 1.0 while executing “package require md4c 1.0”

aku added on 2017-10-04 21:34:24:
What does the error look like ?

A 'package require foo 1.0' should be ok to load an '1.1' implementation
(because -exact is not given later versions are acceptable).