[Bug libstdc++/71945] Integer overflow in use counter of shared pointers

2025-09-12 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71945 Bug 71945 depends on bug 121148, which changed state. Bug 121148 Summary: Should use modular arithmetic for _Atomic_word https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121148 What|Removed |Added --

[Bug libstdc++/71945] Integer overflow in use counter of shared pointers

2025-09-12 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71945 Bug 71945 depends on bug 121148, which changed state. Bug 121148 Summary: Should use modular arithmetic for _Atomic_word https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121148 What|Removed |Added --

[Bug libstdc++/71945] Integer overflow in use counter of shared pointers

2025-09-11 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71945 Jonathan Wakely changed: What|Removed |Added Resolution|--- |FIXED Status|ASSIGNED

[Bug libstdc++/71945] Integer overflow in use counter of shared pointers

2025-09-11 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71945 --- Comment #9 from GCC Commits --- The master branch has been updated by Jonathan Wakely : https://gcc.gnu.org/g:9a2b1acda0cb2c32568b5ca82996eb0544a3a4ef commit r16-3812-g9a2b1acda0cb2c32568b5ca82996eb0544a3a4ef Author: Jonathan Wakely Date:

[Bug libstdc++/71945] Integer overflow in use counter of shared pointers

2025-09-11 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71945 Bug 71945 depends on bug 121148, which changed state. Bug 121148 Summary: Should use modular arithmetic for _Atomic_word https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121148 What|Removed |Added --

[Bug libstdc++/71945] Integer overflow in use counter of shared pointers

2025-09-11 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71945 --- Comment #8 from GCC Commits --- The master branch has been updated by Jonathan Wakely : https://gcc.gnu.org/g:faae3692f75003f5df226ed776d7386bf848dd00 commit r16-3811-gfaae3692f75003f5df226ed776d7386bf848dd00 Author: Jonathan Wakely Date:

[Bug libstdc++/71945] Integer overflow in use counter of shared pointers

2025-07-18 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71945 --- Comment #7 from Jonathan Wakely --- And the original code from comment 0 now does: $ ./a.out 1) Create an object and pass it over to a shared pointer... ptr.use_count() -> 1 2) Create an extra reference to that object... ptr.use_count(

[Bug libstdc++/71945] Integer overflow in use counter of shared pointers

2025-07-17 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71945 --- Comment #6 from Jonathan Wakely --- Simpler reproducer which fails the assertion with trunk when the ref count overflows to INT_MIN, but which passes with my local patches: #include #include #include int main() { std::shared_ptr p(new

[Bug libstdc++/71945] Integer overflow in use counter of shared pointers

2025-07-17 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71945 --- Comment #5 from Jonathan Wakely --- (In reply to Jonathan Wakely from comment #3) > The __atomic_fetch_add built-in on signed integers is required to wrap like > unsigned integers without UB, but we should check that all our > target-specific

[Bug libstdc++/71945] Integer overflow in use counter of shared pointers

2025-07-16 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71945 --- Comment #4 from Jonathan Wakely --- (In reply to Jonathan Wakely from comment #3) > The __atomic_fetch_add built-in on signed integers is required to wrap like > unsigned integers without UB, but we should check that all our > target-specific

[Bug libstdc++/71945] Integer overflow in use counter of shared pointers

2025-07-16 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71945 Jonathan Wakely changed: What|Removed |Added Target Milestone|--- |16.0 Assignee|unassigned at

[Bug libstdc++/71945] Integer overflow in use counter of shared pointers

2025-01-23 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71945 Jonathan Wakely changed: What|Removed |Added Last reconfirmed||2025-01-23 Status|UNCONFIR

[Bug libstdc++/71945] Integer overflow in use counter of shared pointers

2016-07-21 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71945 --- Comment #1 from Jonathan Wakely --- You also get undefined behaviour at 2bn objects when the signed _Atomic_word overflows, and the weak count can also be forced to overflow. Doing so requires allocating tens of GB of shared_ptr objects thoug