goblint / goblint/analyzer

Proper support for mutex type `PTHREAD_MUTEX_ERRORCHECK` checking return types

Open
#658 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature precision unsound
Dominant language
OCaml
Stars
252
Forks
90
Avg merge
4d 1m
Merged PRs (30d)
19

Description

With the revival of deadlock analysis (#655), it becomes more and more important that we handle behavior specific to mutex types.

Via pthread_mutexattr_settype there are the following possibilities:

  • PTHREAD_MUTEX_DEFAULT – misuse is undefined behavior
  • PTHREAD_MUTEX_NORMAL – relocking deadlocks, other misuse is undefined behavior
  • PTHREAD_MUTEX_ERRORCHECK – misuse returns errors
  • PTHREAD_MUTEX_RECURSIVE – relocking allowed, other misuse returns errors

Additionally:

  • We don't do anything smart with read-write locks (pthread_rwlock_rdlock, pthread_rwlock_wrlock). (#661)
  • Since some of the types are about differences in return values, we should also consider those, instead of completely ignoring them.

The different mutex types affect multiple features:

  • Race detection
  • Deadlock detection
  • Base and Apron privatization

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with pthread_mutexattr_settype and the deadlock-analysis work referenced in #655; map how PTHREAD_MUTEX_ERRORCHECK affects race detection, deadlock detection, and Base and Apron privatization. Done means error-return behavior is handled for this mutex type across those listed features.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, ocaml
Domain
devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.