Registering a DOMSubtreeModified on a node, creating a range selecting its text node, then triggering the event and detaching the Range into it will produce a NULL dereference. (test case attached) Exception (Safari 6.0.2 on OS X 10.8.2) : WebKit nightly is also affected.
Created attachment 196256 [details] test case
Created attachment 196257 [details] OSX Crash Report
Exception (Safari 6.0.2 on OS X 10.8.2) : Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000 ... Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 com.apple.WebCore 0x000000010e45cb51 WebCore::checkAcceptChild(WebCore::Node*, WebCore::Node*, int&) + 33 1 com.apple.WebCore 0x000000010e45cb01 WebCore::Node::checkAddChild(WebCore::Node*, int&) + 33 2 com.apple.WebCore 0x000000010e518f23 WebCore::ContainerNode::insertBefore(WTF::PassRefPtr<WebCore::Node>, WebCore::Node*, int&, bool) + 163 3 com.apple.WebCore 0x000000010e697a35 WebCore::Range::insertNode(WTF::PassRefPtr<WebCore::Node>, int&) + 757 4 com.apple.WebCore 0x000000010e6976f2 WebCore::jsRangePrototypeFunctionInsertNode(JSC::ExecState*) + 162 5 ??? 0x000034147c401265 0 + 57262588564069 ...
Created attachment 196259 [details] test case 2
Created attachment 196260 [details] OSX Crash Report 2
Test case 2 will produce another kind of null deref : Exception (Safari 6.0.2 on OS X 10.8.2) : Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000025 ... Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 com.apple.WebCore 0x000000010ecd1a0a WebCore::Range::insertNode(WTF::PassRefPtr<WebCore::Node>, int&) + 714 1 com.apple.WebCore 0x000000010ecd16f2 WebCore::jsRangePrototypeFunctionInsertNode(JSC::ExecState*) + 162 2 ??? 0x000022d2c7201265 0 + 38288679244389 ...
> Test case 2 will produce another kind of null deref : Ideally, different issues should be tracked in separate bugs. Keeping them together adds a lot of confusion (such as confusion when discussing issues, or closing a bug when only one of the issues was fixed).
Both tests appear to work fine today.