Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some Helgrind thread errors with enable-tls, and enable-curl. #396

Merged
merged 1 commit into from
Feb 28, 2024

Conversation

philljj
Copy link
Contributor

@philljj philljj commented Feb 18, 2024

Fixes a subset of thread errors from PR #395.

Fix some Helgrind thread errors around simultaneous reads and writes from different threads:

  • Simultaneous read and write with CURL handle.
  • Separate tls.timeout_ms member into separate tls.timeout_ms_read and tls.timeout_ms_write members to prevent simultaneous assignment or overwriting.
  • Separate mqttcurl_test_nonblock() into separate read and write functions to fix simultaneous updates from different read/write threads.

This passes whereas PR #395 fails. Apparently the extra locking around SSL struct makes the multithreading CI tests unstable, though it fixes threading errors.

Note: ultimately tested with helgrind and drd:

  • valgrind --tool=helgrind --track-lockorders=yes --free-is-write=yes --fair-sched=yes -s
  • valgrind --tool=drd --trace-mutex=yes --fair-sched=yes -s

@philljj philljj self-assigned this Feb 18, 2024
@philljj philljj requested a review from dgarske February 18, 2024 05:18
@dgarske dgarske self-assigned this Feb 19, 2024
@dgarske dgarske assigned embhorn and unassigned dgarske Feb 28, 2024
@dgarske dgarske requested review from embhorn and removed request for dgarske February 28, 2024 18:52
@dgarske
Copy link
Contributor

dgarske commented Feb 28, 2024

Jordan, I am assigning this over to @embhorn to review.

Copy link
Member

@embhorn embhorn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested successfully with ./configure --enable-curl --enable-stress --enable-debug=verbose

@embhorn embhorn merged commit 2c62db3 into wolfSSL:master Feb 28, 2024
11 checks passed
@philljj philljj deleted the fix_some_threading_issues branch March 1, 2024 04:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants