RESOLVED FIXED 143625
[Content Extensions] Don't unmap shared memory
https://bugs.webkit.org/show_bug.cgi?id=143625
Summary [Content Extensions] Don't unmap shared memory
Alex Christensen
Reported 2015-04-10 18:34:58 PDT
Right now, when the Data object is destroyed, the mmap'd memory is munmap'd. The memory that is then shared is unmapped underneath us! This is a partial fix. We should also make sure that the memory is not munmap'd until there are no more shared memory handles pointing to it, but this makes it useable.
Attachments
Patch (4.10 KB, patch)
2015-04-10 18:42 PDT, Alex Christensen
darin: review+
Alex Christensen
Comment 1 2015-04-10 18:42:01 PDT
Alex Christensen
Comment 2 2015-04-10 18:42:45 PDT
Anders, could you mention this bug in the radar when reviewing?
Darin Adler
Comment 3 2015-04-10 19:48:18 PDT
Comment on attachment 250551 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=250551&action=review > Source/WebKit2/Shared/WebCompiledContentExtensionData.h:48 > + WebCompiledContentExtensionData(PassRefPtr<SharedMemory> data, NetworkCache::Data fileData, unsigned actionsOffset, unsigned actionsSize, unsigned bytecodeOffset, unsigned bytecodeSize) New code should not use PassRefPtr. This should be RefPtr<SharedMemory>&& if you want to move it in. Then use WTF::move below.
Alex Christensen
Comment 4 2015-04-11 14:03:34 PDT
(In reply to comment #3) > New code should not use PassRefPtr. This should be RefPtr<SharedMemory>&& if > you want to move it in. Then use WTF::move below. I only made that change because stylebot got mad at me for leaving it as RefPtr. If this is true (which it probably is) then stylebot should be changed.
Brady Eidson
Comment 5 2015-04-12 16:25:45 PDT
(In reply to comment #4) > (In reply to comment #3) > > New code should not use PassRefPtr. This should be RefPtr<SharedMemory>&& if > > you want to move it in. Then use WTF::move below. > I only made that change because stylebot got mad at me for leaving it as > RefPtr. If this is true (which it probably is) then stylebot should be > changed. Stylebot normally says things like "If even of these errors are wrong please file a bug on check-webkit-style", so you should probably file a bug on check-webkit-style :)
Alex Christensen
Comment 6 2015-04-13 10:56:21 PDT
Note You need to log in before you can comment on or make changes to this bug.