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

[smart_holder] git merge master #5436

Merged
merged 5 commits into from
Nov 7, 2024
Merged

Conversation

rwgk
Copy link
Collaborator

@rwgk rwgk commented Nov 7, 2024

Description

Helper/scratch PR for testing.

Suggested changelog entry:

pre-commit-ci bot and others added 5 commits November 6, 2024 11:19
* chore(deps): update pre-commit hooks

updates:
- [github.com/pre-commit/mirrors-clang-format: v18.1.8 → v19.1.3](pre-commit/mirrors-clang-format@v18.1.8...v19.1.3)
- [github.com/astral-sh/ruff-pre-commit: v0.6.3 → v0.7.2](astral-sh/ruff-pre-commit@v0.6.3...v0.7.2)
- [github.com/pre-commit/mirrors-mypy: v1.11.2 → v1.13.0](pre-commit/mirrors-mypy@v1.11.2...v1.13.0)
- [github.com/pre-commit/pre-commit-hooks: v4.6.0 → v5.0.0](pre-commit/pre-commit-hooks@v4.6.0...v5.0.0)
- [github.com/adamchainz/blacken-docs: 1.18.0 → 1.19.1](adamchainz/blacken-docs@1.18.0...1.19.1)
- [github.com/mgedmin/check-manifest: 0.49 → 0.50](mgedmin/check-manifest@0.49...0.50)
- [github.com/PyCQA/pylint: v3.2.7 → v3.3.1](pylint-dev/pylint@v3.2.7...v3.3.1)
- [github.com/python-jsonschema/check-jsonschema: 0.29.2 → 0.29.4](python-jsonschema/check-jsonschema@0.29.2...0.29.4)

* style: pre-commit fixes

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Looks like some markdown spilled into our restructured text
* Fix data race all_type_info_populate in free-threading mode
Description:
- fixed data race all_type_info_populate in free-threading mode
- added test

For example, we have 2 threads entering `all_type_info`.
Both enter `all_type_info_get_cache`` function and
there is a first one which inserts a tuple (type, empty_vector) to the map
and second is waiting. Inserting thread gets the (iter_to_key, True) and non-inserting thread
after waiting gets (iter_to_key, False).
Inserting thread than will add a weakref and will then call into `all_type_info_populate`.
However, non-inserting thread is not entering `if (ins.second) {` clause and
returns `ins.first->second;`` which is just empty_vector.
Finally, non-inserting thread is failing the check in `allocate_layout`:
```c++
if (n_types == 0) {
    pybind11_fail(
        "instance allocation failed: new instance has no pybind11-registered base types");
}
```

* style: pre-commit fixes

* Addressed PR comments

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
@rwgk rwgk merged commit 85209ea into pybind:smart_holder Nov 7, 2024
82 checks passed
@rwgk rwgk deleted the sh_merge_master branch November 7, 2024 18:42
@github-actions github-actions bot added the needs changelog Possibly needs a changelog entry label Nov 7, 2024
@rwgk rwgk removed the needs changelog Possibly needs a changelog entry label Nov 7, 2024
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.

3 participants