Skip to content

mbedtls, add more tracing to connection setup - #15215

Closed
icing wants to merge 1 commit into
curl:masterfrom
icing:mbedtls-timeout-tracing
Closed

icing wants to merge 1 commit into
curl:masterfrom
icing:mbedtls-timeout-tracing

Conversation

@icing

@icing icing commented Oct 9, 2024 •

Copy link
Copy Markdown
Contributor

mbedtls with valgrind CI spends 5 seconds initializing, it seems. Add tracing to find out where the time is spent.

As otherwhere, test 303 is the first failing and the trace says:

 14:33:07.750132 [0-0] == Info: [SSL] mbed_connect_step1(), default x509 init done
 14:33:14.640473 [0-0] == Info: [SSL] mbed_connect_step1(), ssl_capath done

which shows that parsing CAPATH takes more than 7 seconds, ruining the overall test timeout.

@vszakats @bagder since we do not mention any capath in the test, this is curl's bundle that is read?

mbedtls with valgrind CI spends 5 seconds initializing, it seems.
Add tracing to find out where the time is spent.
@github-actions github-actions Bot added the TLS label Oct 9, 2024
@dfandrich

Copy link
Copy Markdown
Contributor

Analysis of PR #15215 at f50439f3:

Test 303 failed, which has NOT been flaky recently, so there could be a real issue in the PR.

Test 1631 failed, which has NOT been flaky recently, so there could be a real issue in the PR.

Test 1632 failed, which has NOT been flaky recently, so there could be a real issue in the PR.

Generated by Testclutch

@vszakats

vszakats commented Oct 9, 2024

Copy link
Copy Markdown
Member

That's what's used:

  /* Location of default ca bundle */
  #define CURL_CA_BUNDLE "/etc/ssl/certs/ca-certificates.crt"
  
  /* define "1" to use built-in CA store of SSL library */
  /* #undef CURL_CA_FALLBACK */
  
  /* Location of default ca path */
  #define CURL_CA_PATH "/etc/ssl/certs"

https://github.com/curl/curl/actions/runs/11259375692/job/31308213099#step:40:28

It's odd, because this issue appeared consistently after rebuilding mbedTLS with CMake (first I thought it's because bumping to 3.6.1, but no, 3.6.0 fails the same). After much testing one possible clue is that CMake built mbedTLS in debug mode by default. I haven't double-checked yet, but a -DCMAKE_BUILD_TYPE=Release build now passed on the first try.

vszakats added a commit to vszakats/curl that referenced this pull request Oct 10, 2024
CMake builds mbedTLS in Debug mode by default, which was the reason
for these consistent test failures:
```
FAIL 1631: 'FTP through HTTPS-proxy' FTP, HTTPS-proxy
FAIL 1632: 'FTP through HTTPS-proxy, with connection reuse' FTP, HTTPS-proxy
```
Sometimes also:
```
FAIL 303: 'HTTPS with 8 secs timeout' HTTPS, HTTP GET, timeout, FAILURE
```
https://github.com/curl/curl/actions/runs/11260616621/job/31313234198

Ref: curl#15215
Follow-up to e377c91 curl#15208
vszakats added a commit that referenced this pull request Oct 10, 2024
CMake builds mbedTLS in Debug mode by default, which was the reason
for these consistent test failures:
```
FAIL 1631: 'FTP through HTTPS-proxy' FTP, HTTPS-proxy
FAIL 1632: 'FTP through HTTPS-proxy, with connection reuse' FTP, HTTPS-proxy
```
Sometimes also:
```
FAIL 303: 'HTTPS with 8 secs timeout' HTTPS, HTTP GET, timeout, FAILURE
```
https://github.com/curl/curl/actions/runs/11260616621/job/31313234198

Fix it by building in `RelWithDebInfo` mode, matching the bare
`Makefile` builds used earlier. (`Release` mode also works.)

Cache sizes:
- Makefile: 10MB
- CMake Release: 1MB
- CMake RelWithDebInfo: 2.5MB

Ref: #15215
Follow-up to e377c91 #15208

Closes #15238
@icing

icing commented Oct 10, 2024

Copy link
Copy Markdown
Contributor Author

Closing, seems resolved with new non-test mbedtls build in CI.

@icing icing closed this Oct 10, 2024
pps83 pushed a commit to pps83/curl that referenced this pull request Apr 26, 2025
CMake builds mbedTLS in Debug mode by default, which was the reason
for these consistent test failures:
```
FAIL 1631: 'FTP through HTTPS-proxy' FTP, HTTPS-proxy
FAIL 1632: 'FTP through HTTPS-proxy, with connection reuse' FTP, HTTPS-proxy
```
Sometimes also:
```
FAIL 303: 'HTTPS with 8 secs timeout' HTTPS, HTTP GET, timeout, FAILURE
```
https://github.com/curl/curl/actions/runs/11260616621/job/31313234198

Fix it by building in `RelWithDebInfo` mode, matching the bare
`Makefile` builds used earlier. (`Release` mode also works.)

Cache sizes:
- Makefile: 10MB
- CMake Release: 1MB
- CMake RelWithDebInfo: 2.5MB

Ref: curl#15215
Follow-up to e377c91 curl#15208

Closes curl#15238
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

3 participants