Comment 0 for bug 783997

Revision history for this message
Chris Coulson (chrisccoulson) wrote :

There's lots of crash reports like this:

https://crash-stats.mozilla.com/report/list?product=Firefox&platform=linux&query_search=signature&query_type=contains&query=uGlobalMenu&reason_type=contains&date=05%2F17%2F2011%2003%3A58%3A09&range_value=4&range_unit=weeks&hang_type=any&process_type=any&do_query=1&signature=uGlobalMenuBar%3A%3AShouldParentStayVisible

This is crashing where we iterate over the menubar's parent nodes to figure out which node we should hide. The issue here is that we hold a ref on the menubar, but each node doesn't hold a ref to its parent (else there would be reference cycles). The code sort-of makes an assumption that the pointer returned from GetParent() isn't dangling, but it looks like it's hitting a case where it is.

I'm not sure what condition would cause this yet. One possibility is that the window is being closed (and the document being destroyed) in between calling RegisterWindow and getting a response back from the panel service (which is when this code path gets triggered). In this condition though, it would be unsafe to access any uGlobalMenuBar functions for the particular menubar, as the menuservice would have already destroyed it