Skip to content

Consider option that malloc(0) may return NULL#1777

Merged
michael-schwarz merged 10 commits intomasterfrom
issue_1418
Jul 9, 2025
Merged

Consider option that malloc(0) may return NULL#1777
michael-schwarz merged 10 commits intomasterfrom
issue_1418

Conversation

@michael-schwarz
Copy link
Member

@michael-schwarz michael-schwarz commented Jul 3, 2025

  • Adds an option to configure behavior when allocating 0 bytes in line with C99 draft, 7.20.3 (1)
  • Replace bool to indicate whether allocation is on heap or stack with variant type
  • Introduce more sharing in base analysis between allocating functions in special.

Closes #1418

@michael-schwarz michael-schwarz added this to the v2.6.0 milestone Jul 3, 2025
@sim642 sim642 mentioned this pull request Jul 7, 2025
1 task
@michael-schwarz michael-schwarz requested a review from sim642 July 8, 2025 10:58
@michael-schwarz michael-schwarz merged commit f2c4520 into master Jul 9, 2025
19 checks passed
@michael-schwarz michael-schwarz deleted the issue_1418 branch July 9, 2025 07:17
sim642 added a commit to sim642/opam-repository that referenced this pull request Sep 5, 2025
CHANGES:

* Add division by zero analysis (goblint/analyzer#1764).
* Add bitfield domain (goblint/analyzer#1623).
* Add weakly-relational C-2PO pointer analysis (goblint/analyzer#1485).
* Add widening delay (goblint/analyzer#1358, goblint/analyzer#1442, goblint/analyzer#1483).
* Add narrowing of globals to top-down solver (goblint/analyzer#1636).
* Add weak dependencies to top-down solver (goblint/analyzer#1746, goblint/analyzer#1747).
* Add YAML ghost witness generation (goblint/analyzer#1394).
* Remove GraphML witness generation (goblint/analyzer#1732, goblint/analyzer#1733, goblint/analyzer#1738).
* Use C standard option for preprocessing (goblint/analyzer#1807).
* Add bash completion for array options (goblint/analyzer#1670, goblint/analyzer#1705, goblint/analyzer#1750).
* Make `malloc(0)` semantics configurable (goblint/analyzer#1418, goblint/analyzer#1777).
* Update path-sensitive analyses (goblint/analyzer#1785, goblint/analyzer#1791, goblint/analyzer#1792).
* Fix evaluation of library function arguments (goblint/analyzer#1758, goblint/analyzer#1761).
* Optimize affine equalities analysis using sparse matrices (goblint/analyzer#1459, goblint/analyzer#1625).
* Prepare for parallelism (goblint/analyzer#1708, goblint/analyzer#1744, goblint/analyzer#1748, goblint/analyzer#1781, goblint/analyzer#1790).
sim642 added a commit that referenced this pull request Nov 28, 2025
This is likely to change in the future, so it's better for the old reference confs to be explicit about it.
More importantly, PR #1777 changed the default behavior of malloc(0) which accidentally affected svcomp26.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cleanup Refactoring, clean-up feature unsound

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unsoundness for malloc(0)

2 participants