Bug 1212249 - Konsole + Bash + curl 8 "hangs" misteriously
Summary: Konsole + Bash + curl 8 "hangs" misteriously
Status: NEW
Alias: None
Product: openSUSE Distribution
Classification: openSUSE
Component: KDE Applications (show other bugs)
Version: Leap 15.4
Hardware: Other openSUSE Leap 15.4
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: E-Mail List
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-06-12 15:11 UTC by José Gómez
Modified: 2023-06-13 13:39 UTC (History)
2 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---
fvogt: needinfo? (jose.gomez)


Attachments
xxd output of the script. (60.82 KB, text/plain)
2023-06-12 15:52 UTC, José Gómez
Details

Note You need to log in before you can comment on or make changes to this bug.
Description José Gómez 2023-06-12 15:11:43 UTC
When location headers are being printed by curlv8 (specifically curl 8.0.1 in my case).


My setup:
---
$ rpm -q konsole
konsole-21.12.3-bp154.1.34.x86_64
$ rpm -q curl
curl-8.0.1-150400.5.23.1.x86_64
$ rpm -q bash
bash-4.4-150400.25.22.x86_64
---


Then I run:
---
curl -sSIL -X GET "http://scc.suse.com/api/health/statusz/?daiosdhjoasidhaioshda" ## < here forcing a 404 that goes through redirections
HTTP/1.1 301 Moved Permanently
Server: awselb/2.0
Date: Mon, 12 Jun 2023 14:59:53 GMT
Content-Type: text/html
Content-Length: 134
Connection: keep-alive
Location: https://scc.suse.com:443/api/health/statusz/?daiosdhjoasidhaioshda

HTTP/2 302 
date: Mon, 12 Jun 2023 14:59:54 GMT
content-type: text/html; charset=utf-8
location: https://scc.suse.com/sessions/saml_start
server: nginx
x-frame-options: SAMEORIGIN
x-xss-protection: 1; mode=block
x-content-type-options: nosniff
x-download-options: noopen
x-permitted-cross-domain-policies: none
referrer-policy: strict-origin-when-cross-origin
cache-control: no-cache
set-cookie: XSRF-TOKEN=r67Ud6PXfxQQLuQACaLkZ3K4wmpxGiPmG1LfOTe-FJhNhfgjb2pINEdXTvQ20HeR_w5L0Lx1FRxai1Y82C_izQ; path=/; SameSite=Lax; Secure
set-cookie: _glue_session=opjzrESdffRgDXg%2FBCQp1rhblAbv8Jebb8IM2k6i8vWiXkuasDu2JQD8VkWvWPOqDnqYRPDKvQzZQHtdj3HfiUn5Rrr29p5Tu2BFfB83QQio0D2xWPUQpn1pY%2Btg8YLP20SUaxP%2FUixy%2FaTksk0%2Br2RMJDCwFwxQekbaCzvdNfUR%2FTNwcFDMrzFXp6RRDEKH7JBQEQDvoFGbP3RMommu2MUYLzCAOwYYe%2F6cJn2%2FL3mwORPTLHb1Sy5GdXW4hUdNGC3T6la17ZRMSRZ6C0VRwhiiinlOdjsPAufs9%2FLwvpLMWbXsyJqlXcKvFjHNJek7I83Au0eQWcD0B5cRAsY8xe07vxZunQFZabfVe6O1dwnQVpIpunkG%2BJ5%2BcdytSp0kW050N8vIvW8S49%2FqtpoyfLWD4fsPU1o%2BGK8UDsQtsey5wCkz7EzMv%2B%2BwjLMLTLeF%2BHq5yUj%2FHLaw2Yg%2BtSPezaRTkA%3D%3D--sLzfp%2F7%2FcQKuKyMk--%2FJLK7mryTEEsEczHnsgAOQ%3D%3D; path=/; expires=Mon, 12 Jun 2023 19:59:54 GMT; HttpOnly; SameSite=Lax; Secure
x-request-id: 4ceb4f11-4cfd-4240-b6f6-8d67fae3300d
x-runtime: 0.006365
front-end-https: on
strict-transport-security: max-age=31536000; includeSubDomains

HTTP/2 302 
date: Mon, 12 Jun 2023 14:59:54 GMT
content-type: text/html; charset=utf-8
location:
---


I could raise it as well with:

---
curl -vsSIL -X GET "http://updates.suse.com/SUSE/Products/SLE-Module-Basesystem/15-SP4/x86_64/product/repodata/repomd.xml?%very-long-token%"
*   Trying 152.199.22.115:80...
* Connected to updates.suse.com (152.199.22.115) port 80 (#0)
> GET /SUSE/Products/SLE-Module-Basesystem/15-SP4/x86_64/product/repodata/repomd.xml?%very-long-token% HTTP/1.1
> Host: updates.suse.com
> User-Agent: curl/8.0.1
> Accept: */*
> 
< HTTP/1.1 301 Moved Permanently
HTTP/1.1 301 Moved Permanently
< Cache-Control: max-age=0
Cache-Control: max-age=0
< Date: Mon, 12 Jun 2023 15:00:45 GMT
Date: Mon, 12 Jun 2023 15:00:45 GMT
< Expires: Mon, 12 Jun 2023 15:00:45 GMT
Expires: Mon, 12 Jun 2023 15:00:45 GMT
< Location: https://updates.suse.com/SUSE/Products/SLE-Module-Basesystem/15-SP4/x86_64/product/repodata/repomd.xml?%very-long-token%
Location:
---

Funnily enough, after it's "hung" there, I press Shift + Tab and then ENTER and I get the prompt back.

it doesn't happen if the shell is fish, and also doesn't happen with curl 7.xx

it also doesn't when I run curl with -v (but not -I or -i).

I ran the curl commands above in a script session and noticed that the output varies between curl 7 & 8

in libcurl 7 the output with -I is:

---
xxd typescript | grep -C 3 cation.
000004d0: 7870 6972 6573 1b5b 306d 3a20 4d6f 6e2c  xpires.[0m: Mon,
000004e0: 2031 3220 4a75 6e20 3230 3233 2031 353a   12 Jun 2023 15:
000004f0: 3036 3a30 3320 474d 540d 0d0a 1b5b 316d  06:03 GMT....[1m
00000500: 4c6f 6361 7469 6f6e 1b5b 306d 3a20 6874  Location.[0m: ht
00000510: 7470 733a 2f2f 7570 6461 7465 732e 7375  tps://updates.su
00000520: 7365 2e63 6f6d 2f53 5553 452f 5072 6f64  se.com/SUSE/Prod
00000530: 7563 7473 2f53 4c45 2d4d 6f64 756c 652d  ucts/SLE-Module-
---

and in libcurl 8 is:

---
xxd typescript | grep -C 3 cation.
000003e0: 6972 6573 1b5b 306d 3a20 4d6f 6e2c 2031  ires.[0m: Mon, 1
000003f0: 3220 4a75 6e20 3230 3233 2031 353a 3036  2 Jun 2023 15:06
00000400: 3a32 3020 474d 540d 0d0a 1b5b 316d 4c6f  :20 GMT....[1mLo
00000410: 6361 7469 6f6e 1b5b 306d 3a1b 5d38 3b3b  cation.[0m:.]8;;
00000420: 6874 7470 733a 2f2f 7570 6461 7465 732e  https://updates.
00000430: 7375 7365 2e63 6f6d 2f53 5553 452f 5072  suse.com/SUSE/Pr
00000440: 6f64 7563 7473 2f53 4c45 2d4d 6f64 756c  oducts/SLE-Modul
---

that sequence "]8;;" seems to be the culprit.
Comment 1 José Gómez 2023-06-12 15:52:40 UTC
Created attachment 867520 [details]
xxd output of the script.

Ran 

---
script

curl -sSIL -X GET "http://scc.suse.com/api/health/statusz/?daiosdhjoasidhaioshda"

# [control + D]

xxd typescript
---
Comment 2 Fabian Vogt 2023-06-13 13:39:56 UTC
I can't reproduce this here on TW or 15.4 with or without enabled OSC 8 links (which is what that ESC ] 8 ;; ... is).

Can you try on TW? The escape sequence parser basically got rewritten in between, maybe that makes a difference. If it still fails, the config might be useful.

I wonder whether it's some kind of issue with buffering, maybe it fails if the sequence is split across multiple read calls or something. That could also explain why there's a difference between bash and fish.