mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 18:02:05 -05:00
Kernel: Remove flawed SharedInodeVMObject assertion
This assertion cannot be safely/reliably made in the ~SharedInodeVMObject destructor. The problem is that Inode::is_shared_vmobject holds a weak reference to the instance that is being destroyed (ref count 0). Checking the pointer using WeakPtr::unsafe_ptr will produce nullptr depending on timing in this case, and WeakPtr::safe_ref will reliably produce a nullptr as soon as the reference count drops to 0. The only case where this assertion could succeed is when WeakPtr::unsafe_ptr returned the pointer because it won the race against revoking it. And because WeakPtr::safe_ref will always return a nullptr, we cannot reliably assert this from the ~SharedInodeVMObject destructor. Fixes #4621
This commit is contained in:
parent
1fdd39ff14
commit
82c4812730
2 changed files with 0 additions and 7 deletions
|
@ -56,9 +56,4 @@ SharedInodeVMObject::SharedInodeVMObject(const SharedInodeVMObject& other)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
SharedInodeVMObject::~SharedInodeVMObject()
|
|
||||||
{
|
|
||||||
ASSERT(inode().is_shared_vmobject(*this));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,8 +36,6 @@ class SharedInodeVMObject final : public InodeVMObject {
|
||||||
AK_MAKE_NONMOVABLE(SharedInodeVMObject);
|
AK_MAKE_NONMOVABLE(SharedInodeVMObject);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual ~SharedInodeVMObject() override;
|
|
||||||
|
|
||||||
static NonnullRefPtr<SharedInodeVMObject> create_with_inode(Inode&);
|
static NonnullRefPtr<SharedInodeVMObject> create_with_inode(Inode&);
|
||||||
virtual NonnullRefPtr<VMObject> clone() override;
|
virtual NonnullRefPtr<VMObject> clone() override;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue