-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
TestSecurePairingSession fails on linux_x64_gcc_mbedtls, but only on some machines #3348
Comments
Issue-Label Bot is automatically applying the label Links: app homepage, dashboard and code for this bot. |
@mspang does it consistently fail on some machines? Do we have docker container where I can repro and test the fix? |
It fails 100% of the time on one of my local linux machines, and 0% on another linux machine and my macbook. Doesn't seem to fail on GitHub actions either. |
I'll assign it to myself. I'll dig a bit more later today and tomorrow. |
This needs a re-think; there are several problems currently: - refcounting of objects with static storage duration - refcounting of objects with automatic storage duration (stack objects) - refcounting of subobjects - including multiple base class subobjects (diamond inheritance) The majority of current uses are in contexts where lifetime could not be extended by reference counting and in general, the initial reference is not dropped. The remaining case looks like a case of unique ownership. If delegate interfaces really need to be refcounted, we'll need to ban multiple inheritance of them (without resorting to virtual inheritance). fixes project-chip#3348
TestSecurePairingDelegate must live as long as its SecurePairingSession, since the latter holds a pointer to the former. Move SecurePairingSession onto the heap and move TestSecurePairingDelegate to the main test function so its lifetime can be ended after deleting SecurePairingSession. fixes project-chip#3348
It's a use-after-free - the statically allocated SecurePairingSession tries to release a reference to a TestSecurePairingDelegate which was already de-allocated (it's on the stack, and we've already returned from main). Accessing the refcount through the dangling pointer happens to read zero on the system that triggers the abort. Fixed by #3357 (#3356 also makes the symptom go away, although we still have a dangling ptr - we just don't access it). |
TestSecurePairingDelegate must live as long as its SecurePairingSession, since the latter holds a pointer to the former. Move SecurePairingSession onto the heap and move TestSecurePairingDelegate to the main test function so its lifetime can be ended after deleting SecurePairingSession. fixes project-chip#3348
TestSecurePairingDelegate must live as long as its SecurePairingSession, since the latter holds a pointer to the former. Move SecurePairingSession onto the heap and move TestSecurePairingDelegate to the main test function so its lifetime can be ended after deleting SecurePairingSession. fixes #3348
This needs a re-think; there are several problems currently: - refcounting of objects with static storage duration - refcounting of objects with automatic storage duration (stack objects) - refcounting of subobjects - including multiple base class subobjects (diamond inheritance) The majority of current uses are in contexts where lifetime could not be extended by reference counting and in general, the initial reference is not dropped. The remaining case looks like a case of unique ownership. If delegate interfaces really need to be refcounted, we'll need to ban multiple inheritance of them (without resorting to virtual inheritance). fixes #3348
This needs a re-think; there are several problems currently: - refcounting of objects with static storage duration - refcounting of objects with automatic storage duration (stack objects) - refcounting of subobjects - including multiple base class subobjects (diamond inheritance) The majority of current uses are in contexts where lifetime could not be extended by reference counting and in general, the initial reference is not dropped. The remaining case looks like a case of unique ownership. If delegate interfaces really need to be refcounted, we'll need to ban multiple inheritance of them (without resorting to virtual inheritance). Reland with some #include needed after project-chip#3397. fixes project-chip#3348
TestSecurePairingDelegate must live as long as its SecurePairingSession, since the latter holds a pointer to the former. Move SecurePairingSession onto the heap and move TestSecurePairingDelegate to the main test function so its lifetime can be ended after deleting SecurePairingSession. fixes project-chip#3348
* Remove refcounting (reland of #3356) This needs a re-think; there are several problems currently: - refcounting of objects with static storage duration - refcounting of objects with automatic storage duration (stack objects) - refcounting of subobjects - including multiple base class subobjects (diamond inheritance) The majority of current uses are in contexts where lifetime could not be extended by reference counting and in general, the initial reference is not dropped. The remaining case looks like a case of unique ownership. If delegate interfaces really need to be refcounted, we'll need to ban multiple inheritance of them (without resorting to virtual inheritance). Reland with some #include needed after #3397. fixes #3348 * Add missing #include <CHIPMem.h> * Add more missing includes
Looks like it fails post main in static dtor:
@pan-apple
The text was updated successfully, but these errors were encountered: