Pack_list_installed?

This morning I was after updating clpBNR to the last release, and started by

 ?- pack_list_installed.
% Contacting server at https://www.swi-prolog.org/pack/query ...

Waiting for Prolog. Close again to force termination ..

The predicate stopped, hitting Ctrl-C didn’t produced any effect.
The message ‘Waiting…’ showed after when I tried to close the console (swipl-win.exe) using the upper right X button.
It’s still there, I must use Windows Task Manager to kill the process…

Edit

The same problem occurs with

?- pack_upgrade(clpBNR).
% Contacting server at https://www.swi-prolog.org/pack/query ..

Edit

Could the cause be that https://ridgeworks.github.io/clpBNR/ causes a 404 on github ? I pinged that url looking for the latest deployment…

Seems there is something wrong with your connection to www.swi-prolog.org. As that is on a CDN, the most likely seems some network issue on your site.

If I recall correctly, the contact is written as

setup_call_cleanup(
    http_open(....),
    ...

That is still somewhat problematic as the setup part of setup_call_cleanup/3 is executed using sig_atomic/1 to avoid interrupts leading to a partial initialization and resource leaks.

It used to work, and my job is (mainly) on Internet, obviously working… but you’re right that

?- http_open('https://www.swi-prolog.org/',S,[]),stream_info(S),close(S).
Correct to: "http_open:http_open('https://www.swi-prolog.org/',S,[])"? yes

hangs forever, as well… maybe a timeout(60) - just to say - in pack_… functions accessing Internet could be more user friendly.

Well, since I don’t know what I could try to overcome the connection problem, I’ve cloned locally GitHub - ridgeworks/clpBNR: CLP(BNR) module for SWI-Prolog, and will try to upgrade from there.

Thanks

Eventually, the low level network stuff should time out. What is more interesting is why this happens? Can your browser connect to www.swi-prolog.org? Could it be a firewall issue that blocks swipl.exe from accessing the network? Could there be a proxy that is not understood? You can try

?- debug(http(_)).
?- http_open('https://www.swi-prolog.org/',S,[]).

and see what it is trying to do.

yes, it can.

Don’t know… from long time I switched to my phone hotspot instead of a wired connection, so I’m pretty sure pack_install etc were working some time ago.

Maybe this, because

PS C:\Users\cccar> ping https://www.swi-prolog.org/
Impossibile trovare l'host https://www.swi-prolog.org/. Verificare che il nome sia corretto e riprovare.

Esecuzione di Ping www.google.com [216.58.204.228] con 32 byte di dati:
Risposta da 216.58.204.228: byte=32 durata=61ms TTL=113
Risposta da 216.58.204.228: byte=32 durata=46ms TTL=113
Risposta da 216.58.204.228: byte=32 durata=54ms TTL=113
Risposta da 216.58.204.228: byte=32 durata=62ms TTL=113

Statistiche Ping per 216.58.204.228:
    Pacchetti: Trasmessi = 4, Ricevuti = 4,
    Persi = 0 (0% persi),
Tempo approssimativo percorsi andata/ritorno in millisecondi:
    Minimo = 46ms, Massimo =  62ms, Medio =  55ms

Seems a Windows problem with the DNS … If I run from WSL (Ubuntu) I got the same error.

carlo@acer17:~$ ping https://www.swi-prolog.org
ping: https://www.swi-prolog.org: Name or service not known

but is really strange is that if - in WSL - I launch swipl-win - built from source some time ago - i got

- pack_install(clpBNR).
% Contacting server at https://www.swi-prolog.org/pack/query ... ok
Install clpBNR@0.11.10 from GIT at https://github.com/ridgeworks/clpBNR.git Y/n? 

Doesn’t seem very useful:

?- http_open('https://www.swi-prolog.org/',S,[]).
% http_open: Connecting to 'www.swi-prolog.org':443 ...
%       ok <stream>(000002295502d1c0) ---> <stream>(000002295502dd70)

ping takes a host, i.e., without https://

So, it seems your network is fine.

And that is where it ends? That is rather weird. It should continue with the handshake, e.g.

% http_open: Connecting to 'www.swi-prolog.org':443 ...
% 	ok <stream>(0x3513a900) ---> <stream>(0x3513aa00)
% > GET / HTTP/1.1
% > Host: www.swi-prolog.org
% > User-Agent: SWI-Prolog
% > Connection: close
% HTTP/1.1 200 OK
% Connection: close
% Content-Length: 3733
% Server: nginx/1.18.0 (Ubuntu)
...
S = <stream>(0x34f6e000).

Anyone else with similar problems (probably on Windows)? Which Prolog version?

Prolog version: (yesterday or so daily build)

Welcome to SWI-Prolog (threaded, 64 bits, version 9.3.16-12-g3c7f96a77)

Seems https hurts…

?- http_open('http://www.swi-prolog.org',S,[]).
% http_open: Connecting to 'www.swi-prolog.org':80 ...
%       ok <stream>(000002d13adb0910) ---> <stream>(000002d13adafe70)
% > GET / HTTP/1.1
% > Host: www.swi-prolog.org
% > User-Agent: SWI-Prolog
% > Connection: close
% HTTP/1.1 301 Moved Permanently

But I did a bit of a mess with ping, using different hosts. Now

In Windows

ping www.swi-prolog.org

Esecuzione di Ping dualstack.osff2.map.fastly.net [146.75.54.217] con 32 byte di dati:
Risposta da 146.75.54.217: byte=32 durata=40ms TTL=55
Risposta da 146.75.54.217: byte=32 durata=41ms TTL=55
ping swi-prolog.org

Esecuzione di Ping swi-prolog.org [194.164.198.54] con 32 byte di dati:
Risposta da 194.164.198.54: byte=32 durata=82ms TTL=48
Risposta da 194.164.198.54: byte=32 durata=93ms TTL=48

In WSL/Ubuntu

$ ping www.swi-prolog.org
PING dualstack.osff2.map.fastly.net (146.75.54.217) 56(84) bytes of data.
64 bytes from 146.75.54.217 (146.75.54.217): icmp_seq=1 ttl=54 time=66.7 ms
64 bytes from 146.75.54.217 (146.75.54.217): icmp_seq=2 ttl=54 time=73.2 ms```
$ ping swi-prolog.org
PING swi-prolog.org (194.164.198.54) 56(84) bytes of data.
64 bytes from ip194-164-198-54.pbiaas.com (194.164.198.54): icmp_seq=1 ttl=47 time=65.8 ms
64 bytes from ip194-164-198-54.pbiaas.com (194.164.198.54): icmp_seq=2 ttl=47 time=89.0 ms

It seems SSL_CTX_new(), creating a new SSL context simply hangs :frowning: Now the big question is why? Well, probably after updating OpenSSL … Normally, this would be spotted, but unfortunately the ssl test suite is disabled as it does not work in the docker build environment :frowning:

Could be the problem reported here ? I apply routinely every security upgrade M$ proposes, and most probably I haven’t accessed the packs repository from this early summer.
I don’t understand the answer, probably will be necessary to replace SSL_CTX_new() with SSL_CTX_new_ex()…

Thanks. I doubt this is the problem though as it hangs rather than retuning an error and the problem also happens when running swipl.exe on Linux under Wine.

Ok. I changed the build docker, replacing the OpenSSL dlls from Fedora 41 mingw-openssl with those from Win32/Win64 OpenSSL Installer for Windows - Shining Light Productions. That fixes the problem. Reported the issue at 2333301 – SSL_CTX_new() hangs in CRYPTO_THREAD_read_lock() Will make an announce

1 Like