Skip to content

Conversation

@sam-github
Copy link
Contributor

@sam-github sam-github commented Apr 17, 2017

Calling TearDown() without Setup() first is not allowed, but
this should fix a coverity warning:

*** CID 166971:  Uninitialized members  (UNINIT_CTOR)
/test/cctest/node_test_fixture.h: 97 in NodeTestFixture::NodeTestFixture()()
91         v8::V8::ShutdownPlatform();
92         delete platform_;
93         platform_ = nullptr;
94       }
95
96      private:
>>>     CID 166971:  Uninitialized members  (UNINIT_CTOR)
>>>     The compiler-generated constructor for this class does not initialize "platform_".
97       v8::Platform* platform_;
98     };
Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

test

@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Apr 17, 2017
Calling TearDown() without Setup() first is not allowed, but
this should fix a coverity warning:

	*** CID 166971:  Uninitialized members  (UNINIT_CTOR)
	/test/cctest/node_test_fixture.h: 97 in NodeTestFixture::NodeTestFixture()()
	91         v8::V8::ShutdownPlatform();
	92         delete platform_;
	93         platform_ = nullptr;
	94       }
	95
	96      private:
	>>>     CID 166971:  Uninitialized members  (UNINIT_CTOR)
	>>>     The compiler-generated constructor for this class does not initialize "platform_".
	97       v8::Platform* platform_;
	98     };
@sam-github sam-github force-pushed the initialize-platform-in-cctest branch from 65e7bd5 to 398cf3a Compare April 17, 2017 16:25
Copy link
Member

@addaleax addaleax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM if CI is green

}

virtual void TearDown() {
isolate_->Dispose();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@danbev Was the isolate being leaked? Is the dispose needed?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it looks like it is currently being leaked. I think dispose is needed or at least I don't think it hurts to have it.

I'm not familiar with Coverity. Is there a way to get this at this information so I can try to clean up any future mess I create? I've looked at https://scan.coverity.com/projects/node-js, but can't really get to much information, I've requested to be added to the project so perhaps once that is approved I might be able to see some more details.

Sorry about this and thanks for fixing it.

@sam-github sam-github requested a review from danbev April 17, 2017 16:27
@sam-github
Copy link
Contributor Author

/to @danbev

@sam-github
Copy link
Contributor Author

@sam-github
Copy link
Contributor Author

github might be slow to update, or maybe there is a bug in status publish: https://ci.nodejs.org/job/node-test-commit/9164/ all platforms passed

@mscdex mscdex added the c++ Issues and PRs that require attention from people who are familiar with C++. label Apr 17, 2017
}

virtual void TearDown() {
isolate_->Dispose();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it looks like it is currently being leaked. I think dispose is needed or at least I don't think it hurts to have it.

I'm not familiar with Coverity. Is there a way to get this at this information so I can try to clean up any future mess I create? I've looked at https://scan.coverity.com/projects/node-js, but can't really get to much information, I've requested to be added to the project so perhaps once that is approved I might be able to see some more details.

Sorry about this and thanks for fixing it.

@sam-github
Copy link
Contributor Author

Is there a way to get this at this information so I can try to clean up any future mess I create?

It may be that scan access is limited to people with visibility into security reports, I'm not sure.

Unfortunately, the scans only come after PRs merge, but we don't get that many reports, and its easy to just add them to PR conversations when they do occur.

@sam-github
Copy link
Contributor Author

Already done in #12387

@sam-github sam-github closed this Apr 21, 2017
@sam-github sam-github deleted the initialize-platform-in-cctest branch April 21, 2017 19:27
@sam-github sam-github restored the initialize-platform-in-cctest branch April 21, 2017 19:27
@sam-github sam-github deleted the initialize-platform-in-cctest branch April 21, 2017 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. test Issues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants