Closed Bug 414704 Opened 17 years ago Closed 16 years ago

leak-gauge should log node info managers

Categories

(Testing :: General, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: dbaron, Assigned: dbaron)

Details

Attachments

(1 file)

Sicking pointed out that if we had environment variables for logging, leak-gauge could report on leaks of node info managers and thus report on whether any content nodes in a document were leaked.

Patch coming (once I finish patching he perl and html versions of leak-gauge).
Attached patch patchSplinter Review
Attachment #300315 - Flags: superreview?(jonas)
Attachment #300315 - Flags: review?(jonas)
Would it make sense to instead of adding the uris to both the documents and the nims and keeping that in sync, instead make the nim hold a reference to the doc_info?
That would also remove the need to keep a reference from the document to the nim.
Comment on attachment 300315 [details] [diff] [review]
patch

>+        "NODEINFOMANAGER": {
...
>+                    } else if (verb == "Init") {
>+                        var m = rest.match(/^ document=(.*)$/);
>+                        if (!m)
>+                            throw "document pointer expected";
>+                        var nim_info = this.nims[addr];
>+                        var doc = m[1];
>+                        if (doc != "0") {
>+                            var doc_info = handlers["DOCUMENT"].docs[m[1]];

Make that .docs[doc]; at the end.


>+    "NODEINFOMANAGER" => {
>+        count => 0,
>+        nims => {},
>+        handle_line => sub($$) {
>+            my ($self, $line) = @_;
>+            my $nims = ${$self}{nims};
>+            if ($line =~ /^([0-9a-f]*) (\S*)/) {
>+                my ($addr, $verb, $rest) = ($1, $2, $');
>+                if ($verb eq "created") {
>+                    ${$nims}{$addr} = {};
>+                    ++${$self}{count};
>+                } elsif ($verb eq "destroyed") {
>+                    delete ${$nims}{$addr};
>+                } elsif ($verb eq "Init") {
>+                    $rest =~ /^ document=(.*)$/ ||
>+                        die "document pointer expected";
>+                    my $doc = $1;
>+                    if ($doc ne "0") {
>+                        my $nim_info = ${$nims}{$addr};
>+                        my $doc_info = ${$handlers}{"DOCUMENT"}{docs}{$doc};

You're a little inconsistent here, with quotes around DOCUMENT but not docs. But looks like you're using that pattern elsewhere.

r/sr=me with the doc_info thing change for both the perl and javascript version.
Attachment #300315 - Flags: superreview?(jonas)
Attachment #300315 - Flags: superreview+
Attachment #300315 - Flags: review?(jonas)
Attachment #300315 - Flags: review+
(In reply to comment #4)
> You're a little inconsistent here, with quotes around DOCUMENT but not docs.
> But looks like you're using that pattern elsewhere.

They're different.  (At least I think they are.)

(In reply to comment #2)
> Would it make sense to instead of adding the uris to both the documents and the
> nims and keeping that in sync, instead make the nim hold a reference to the
> doc_info?

I think I did have a reason, although I'm not sure anymore whether it made any sense.  At this point I'd just rather not waste another half an hour tweaking it and testing it.
Attachment #300315 - Flags: approval1.9? → approval1.9+
Checked in to trunk, 2008-02-08 11:55 -0800.
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Flags: in-testsuite-
Everything left in Core:Testing is going to Testing:General. Filter on CleanOutCoreTesting to ignore.
Component: Testing → General
Product: Core → Testing
QA Contact: testing → general
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: