# Pack\_list\_installed?

**URL:** <https://swi-prolog.discourse.group/t/pack-list-installed/8677>\
**Category:** Tools\
**Tags:** bug\
**Created:** [December 17, 2024, 6:32am UTC](https://swi-prolog.discourse.group/t/pack-list-installed/8677 "2024-12-17T06:32:51Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![CapelliC](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/capellic/32/17_2.png) [@CapelliC](https://swi-prolog.discourse.group/u/CapelliC)\
**Post date:** [December 17, 2024, 6:32am UTC](https://swi-prolog.discourse.group/t/pack-list-installed/8677/1 "2024-12-17T06:32:51Z")

</div>

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

```prolog
 ?- 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

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

```

**Edit**

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

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [December 17, 2024, 8:37am UTC](https://swi-prolog.discourse.group/t/pack-list-installed/8677/2 "2024-12-17T08:37:18Z")

</div>

Seems there is something wrong with your connection to [www.swi-prolog.org](http://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.

---

<div class="post-metadata">

**Author:** ![CapelliC](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/capellic/32/17_2.png) [@CapelliC](https://swi-prolog.discourse.group/u/CapelliC)\
**Post date:** [December 17, 2024, 9:16am UTC](https://swi-prolog.discourse.group/t/pack-list-installed/8677/3 "2024-12-17T09:16:21Z")

</div>

> [@jan](#):
>
> something wrong with your connection

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

```prolog
?- 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](https://github.com/ridgeworks/clpBNR.git), and will try to upgrade from there.

Thanks

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [December 17, 2024, 12:33pm UTC](https://swi-prolog.discourse.group/t/pack-list-installed/8677/4 "2024-12-17T12:33:51Z")

</div>

> [@CapelliC](#):
>
> hangs forever, as well… maybe a timeout(60) - just to say - in pack\_… functions accessing Internet could be more user friendly.

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](http://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.

---

<div class="post-metadata">

**Author:** ![CapelliC](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/capellic/32/17_2.png) [@CapelliC](https://swi-prolog.discourse.group/u/CapelliC)\
**Post date:** [December 17, 2024, 2:14pm UTC](https://swi-prolog.discourse.group/t/pack-list-installed/8677/5 "2024-12-17T14:14:53Z")

</div>

> [@jan](#):
>
> Can your browser connect to [www.swi-prolog.org](http://www.swi-prolog.org)?

yes, it can.

> [@jan](#):
>
> Could it be a firewall issue that blocks swipl.exe from accessing the network?

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.

> [@jan](#):
>
> Could there be a proxy that is not understood?

Maybe this, because

```prolog
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.

```prolog
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

```prolog
- 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? 

```

> [@jan](#):
>
> see what it is trying to do

Doesn’t seem very useful:

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

```

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [December 17, 2024, 2:38pm UTC](https://swi-prolog.discourse.group/t/pack-list-installed/8677/6 "2024-12-17T14:38:15Z")

</div>

> [@CapelliC](#):
>
> ```prolog
> ping https://www.swi-prolog.org/
> 
> ```

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

> [@CapelliC](#):
>
> `% Contacting server at https://www.swi-prolog.org/pack/query ... ok`

So, it seems your network is fine.

> [@CapelliC](#):
>
> `% ok <stream>(000002295502d1c0) ---> <stream>(000002295502dd70)`

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

```prolog
% 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?

---

<div class="post-metadata">

**Author:** ![CapelliC](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/capellic/32/17_2.png) [@CapelliC](https://swi-prolog.discourse.group/u/CapelliC)\
**Post date:** [December 17, 2024, 2:52pm UTC](https://swi-prolog.discourse.group/t/pack-list-installed/8677/7 "2024-12-17T14:52:19Z")

</div>

Prolog version: (yesterday or so daily build)

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

```

Seems **https** hurts…

```prolog
?- 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

```prolog
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

```

```prolog
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

````prolog
$ 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```

````

```prolog
$ 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

```

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [December 18, 2024, 5:10pm UTC](https://swi-prolog.discourse.group/t/pack-list-installed/8677/8 "2024-12-18T17:10:40Z")

</div>

It seems SSL\_CTX\_new(), creating a new SSL context simply hangs ☹ 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 ☹

---

<div class="post-metadata">

**Author:** ![CapelliC](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/capellic/32/17_2.png) [@CapelliC](https://swi-prolog.discourse.group/u/CapelliC)\
**Post date:** [December 18, 2024, 5:39pm UTC](https://swi-prolog.discourse.group/t/pack-list-installed/8677/9 "2024-12-18T17:39:34Z")

</div>

Could be the problem [reported here](https://answers.microsoft.com/en-us/windows/forum/all/openssl-stopped-working-after-october-2024-updates/0cafaf11-af23-4334-a109-5314f76ecb2c) ? 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()…

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [December 18, 2024, 7:41pm UTC](https://swi-prolog.discourse.group/t/pack-list-installed/8677/10 "2024-12-18T19:41:33Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [December 19, 2024, 12:03pm UTC](https://swi-prolog.discourse.group/t/pack-list-installed/8677/11 "2024-12-19T12:03:53Z")

</div>

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](https://slproweb.com/products/Win32OpenSSL.html). That fixes the problem. Reported the issue at [2333301 – SSL\_CTX\_new() hangs in CRYPTO\_THREAD\_read\_lock()](https://bugzilla.redhat.com/show_bug.cgi?id=2333301) Will make an announce
