Closed Bug 793602 Opened 12 years ago Closed 12 years ago

Valgrind on tbpl detects leak at malloc (104 bytes in 1 blocks are definitely lost) with nsGlobalWindow::GetComputedStyle on the stack

Categories

(Core :: DOM: CSS Object Model, defect)

x86_64
Linux
defect
Not set
major

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: gkw, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: memory-leak, valgrind)

Attachments

(1 file)

Attached file Valgrind stack
Valgrind detects a leak of 104 bytes at malloc with nsGlobalWindow::GetComputedStyle on the stack, see attached snippet which comes from:

https://tbpl.mozilla.org/php/getParsedLog.php?id=15471615&tree=Firefox

Guessing Core: DOM, please change component if necessary.
This is quite odd.  How does the leak-detection get done here?  Any idea which test is triggering it?

We do have a static one-object cache for this stuff, but we delete it at shutdown...  We do cast it around a bit in the process; is this confusing valgrind?
Component: DOM → DOM: CSS Object Model
(In reply to Boris Zbarsky (:bz) from comment #1)
> We do have a static one-object cache for this stuff, but we delete it at
> shutdown...  We do cast it around a bit in the process; is this confusing

I doubt it, since V simply analyses machine code, and doesn't look at source.

Is it possible that Fx is doing fork() and the child is exiting quickly?
That can give strange leak check results.
I don't know.

But my real question is whether the machine code produced from this:

  delete reinterpret_cast<char*>(sCachedComputedDOMStyle);

where we have:

  static nsComputedDOMStyle *sCachedComputedDOMStyle;

and earlier on we did:

  sCachedComputedDOMStyle = aComputedStyle;
  sCachedComputedDOMStyle->~nsComputedDOMStyle();

will generate machine code that actually calls "free" on the same pointer as just "delete aComputedStyle" would.
The suppression for this was commented out a few days ago to try and get stacks with line numbers, but it did not show up again.

Resolving WFM, removing suppression, and will file a new bug with stacks that have line numbers if it shows up again.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: