Bug 234361 - devel/tcltls 1.7.14 is broken upon execution.
Summary: devel/tcltls 1.7.14 is broken upon execution.
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Mikhail Teterin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-12-24 14:59 UTC by Gerald Gutierrez
Modified: 2019-01-07 04:28 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gerald Gutierrez 2018-12-24 14:59:21 UTC
On a newly installed FreeBSD 12 system, do the following:

`pkg install expect tcllib tcltls`

In a file `test.tcl`, copy the example code from https://www.tcl.tk/man/tcl8.6/TclCmd/http.htm#M49, which shows how to use https:

```
$ cat > test.tcl
package require http
package require tls
::http::register https 443 ::tls::socket
set token [::http::geturl https://my.secure.site/]
```

Run the program:

```
$ expect test.tcl
couldn't load file "/usr/local/lib/tls1.7.14/tcltls.so": /usr/local/lib/tls1.7.14/tcltls.so: Undefined symbol "get_dhParams"
    while executing
"load [file join $dir tcltls.so] Tls"
    (lambda term "{dir} {
		if {{shared} eq "static"} {
			load {} Tls
		} els..." line 5)
    invoked from within
"apply {{dir} {
		if {{shared} eq "static"} {
			load {} Tls
		} else {
			load [file join $dir tcltls.so] Tls
		}

		set tlsTclInitScript [file join $..."
    ("package ifneeded tls 1.7.14" script)
    invoked from within
"package require tls"
    (file "test.tcl" line 2)
$
```

The expected behaviour is that this example program should not fail with this error. It should try to load the specified URL using HTTPS.
Comment 1 Gerald Gutierrez 2018-12-24 15:08:32 UTC
I have also tried installing /usr/ports/devel/tcltls. I get the same problem.
Comment 2 Gerald Gutierrez 2018-12-24 15:12:51 UTC
Possibly related: https://core.tcl.tk/tcltls/tktview?name=34cfe47490
Comment 3 commit-hook freebsd_committer 2018-12-24 16:08:52 UTC
A commit references this bug:

Author: mi
Date: Mon Dec 24 16:08:13 UTC 2018
New revision: 488274
URL: https://svnweb.freebsd.org/changeset/ports/488274

Log:
  Upgrade from 1.7.14 to 1.7.16.

  Might fix the
  PR:	234361

Changes:
  head/devel/tcltls/Makefile
  head/devel/tcltls/distinfo
Comment 4 Gerald Gutierrez 2018-12-25 01:04:59 UTC
I still seem to get the same error with the update:

$ tclsh8.6
% package require tls
couldn't load file "/usr/local/lib/tls1.7.16/tcltls.so": /usr/local/lib/tls1.7.16/tcltls.so: Undefined symbol "get_dhParams"

% $ expect
expect1.1> package require tls
couldn't load file "/usr/local/lib/tls1.7.16/tcltls.so": /usr/local/lib/tls1.7.16/tcltls.so: Undefined symbol "get_dhParams"
    while executing
"load [file join $dir tcltls.so] Tls"
    (lambda term "{dir} {
		if {{shared} eq "static"} {
			load {} Tls
		} els..." line 5)
    invoked from within
"apply {{dir} {
		if {{shared} eq "static"} {
			load {} Tls
		} else {
			load [file join $dir tcltls.so] Tls
		}

		set tlsTclInitScript [file join $..."
    ("package ifneeded tls 1.7.16" script)
    invoked from within
"package require tls"
expect1.2>
Comment 5 Gerald Gutierrez 2018-12-30 01:10:30 UTC
FYI output of `make test` on the port:

root@fb12:~ # cd /usr/ports/devel/tcltls/
root@fb12:/usr/ports/devel/tcltls # ls
Makefile	distinfo	files		pkg-descr	work
root@fb12:/usr/ports/devel/tcltls # make test
===>  Testing for tcltls-1.7.16
/usr/local/bin/tclsh8.6 ./tests/all.tcl  -load "lappend auto_path "
Tests running in interp:  /usr/local/bin/tclsh8.6
Tests running in working dir:  /usr/ports/devel/tcltls/work/tcltls-1.7.16/tests
Only running tests that match:  *
Skipping test files that match:  l.*.test
Only sourcing test files that match:  *.test
Tests began at Sun Dec 23 18:04:28 PST 2018
tlsIO.test
couldn't load file "/usr/ports/devel/tcltls/work/tcltls-1.7.16/tcltls.so": /usr/ports/devel/tcltls/work/tcltls-1.7.16/tcltls.so: Undefined symbol "get_dhParams"

Tests ended at Sun Dec 23 18:04:28 PST 2018
all.tcl:	Total	0	Passed	0	Skipped	0	Failed	0
Sourced 0 Test Files.
Comment 6 Mikhail Teterin freebsd_committer 2018-12-31 00:39:51 UTC
I thought, I'd be able to reproduce this on FreeBSD-11 by installing security/openssl-devel . But that didn't work -- the port still compiled and tested nicely...

If you can not research it yourself, it would have to wait for me to get a 12.0 system...
Comment 7 commit-hook freebsd_committer 2018-12-31 01:14:09 UTC
A commit references this bug:

Author: mi
Date: Mon Dec 31 01:13:49 UTC 2018
New revision: 488753
URL: https://svnweb.freebsd.org/changeset/ports/488753

Log:
  Newer OpenSSL versions have a slightly different function-signature
  coming out of "openssl dhparam -C". Be prepared for that -- while
  retaining compatibility with the older versions.

  PR:		234361
  Reported by:	Gerald Gutierrez

Changes:
  head/devel/tcltls/files/patch-gen_dh_params
Comment 8 Mikhail Teterin freebsd_committer 2018-12-31 01:31:25 UTC
Ok, using security/openssl111 I was finally able to reproduce - and fix the problem on my 11.2 system.

The port now builds and is usable, although one of the self-tests fails, when OpenSSL-1.1.1 is used. I submitted an upstream ticket about the self-test failure:

https://core.tcl.tk/tcltls/tktview/3160b84294c87d84dc96daba09a736a88fd33c4c

Please, let me know, whether "make tests" works for any differently for you.

Thank you for your patience.
Comment 9 Gerald Gutierrez 2019-01-07 04:28:24 UTC
All good now!