summaryrefslogtreecommitdiff
path: root/Kernel/VM/SharedInodeVMObject.h
diff options
context:
space:
mode:
authorTom <tomut@yahoo.com>2020-12-30 19:58:46 -0700
committerAndreas Kling <kling@serenityos.org>2020-12-31 10:52:45 +0100
commit82c4812730a6952424364ca8affbe70c83263dfe (patch)
tree9c20f4384ee2cc23e070d24a424cd80bbb029250 /Kernel/VM/SharedInodeVMObject.h
parent1fdd39ff14435570081b3681d486fcd52920fa5c (diff)
downloadserenity-82c4812730a6952424364ca8affbe70c83263dfe.zip
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
Diffstat (limited to 'Kernel/VM/SharedInodeVMObject.h')
-rw-r--r--Kernel/VM/SharedInodeVMObject.h2
1 files changed, 0 insertions, 2 deletions
diff --git a/Kernel/VM/SharedInodeVMObject.h b/Kernel/VM/SharedInodeVMObject.h
index 6f01c26fa8..6875f692ff 100644
--- a/Kernel/VM/SharedInodeVMObject.h
+++ b/Kernel/VM/SharedInodeVMObject.h
@@ -36,8 +36,6 @@ class SharedInodeVMObject final : public InodeVMObject {
AK_MAKE_NONMOVABLE(SharedInodeVMObject);
public:
- virtual ~SharedInodeVMObject() override;
-
static NonnullRefPtr<SharedInodeVMObject> create_with_inode(Inode&);
virtual NonnullRefPtr<VMObject> clone() override;