-
Notifications
You must be signed in to change notification settings - Fork 30.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
missing block coverage for functions #27566
Comments
With the current inspector protocol implementation in Node.js everything is synchronous, so there is not much room for race conditions that I can think of.. |
Is there solution |
Replied on the V8 tracking issue. |
@nodejs/build @nodejs/testing, had a conversation with @schuay this morning, this issue is very odd; He is able to reproduce the issue on his Linux desktop with the distributed Node.js versions, he is unable to reproduce the issue if he builds Node.js from source. So far, we have not seen the issue crop up on OSX. |
There's going to be a big difference between the compiler, libc and libstdc++ that we use to build binaries for Linux and what's available on Fedora 28 for native compile. BUILDING.md now has details for Node 12 compiler config we use. |
All testing I did was with copied of node.js installed by nvm (https://nodejs.org/download/release/v12.1.0/node-v12.1.0-linux-x64.tar.xz for example). Sorry if that wasn't clear. |
@coreyfarrell was clear on that fact 👍 @schuay was testing with both the shipped version (which is what you get from |
If you are having trouble coming up with an environment to replicate the compiler setup we use and that's an important issue here I can probably put together a simple Dockerfile for you to use to get that. Let me know if that's key here and I'll see what I can come up with when I have time. |
To clarify, my locally-built version was not identical to the official release, so there's plenty of opportunities for behavioral differences to come in without starting to look at compilers and libc (e.g.: different Node commit, build-system changes since I built with GN). I'm a bit swamped currently but will try to set aside some time to investigate further. Edit: Perhaps someone can check if this still reproduces on ToT Node, and bisect if not. |
@joyeecheung @nodejs/v8, @schuay has landed a couple patches that should address the underlying cause of this bug (we isolated the bug to generator functions, which had some known issues in the block coverage implementation). Here are the patches in question: Unfortunately, between the version of V8 pulled into Node 12.x.x and @schuay's patch, some fairly major changes have landed related to private class functions, and the patches above do not land cleanly (they create significantly more conflicts than I've seen backporting other PRs). Any thoughts? are your planning to cherry-pick your work around private class functions @joyeecheung, landing this would hopefully help @schuay's patches apply more cleanly. |
We are working on the update to V8 7.5 and hope to be able to backport it to v12.x. Would it help to wait for it? |
@targos would |
@bcoe From a glance at the listed patches I don't seem to be able to find lines that I have touched before? Though if there are a lot of conflicts I think the better solution is usually to just wait for a complete update if it's to urgent to have the fix. |
@joyeecheung @schuay @rvagg, I just tested with the nightly build:
And the issue of dropped functions from coverage continues to persist. I believe that the version of Node.js referenced above pulls in the work that Jakob did to attempt to address this issue. I'm a bit perplexed:
I think this is a fairly serious issue because it results in folks thinking that they've written tests for functions that might be completely unexercised. |
That's unfortunate :[ If I recall correctly, I wasn't able to reproduce this at all back then. A reliable d8 (or debug node build) repro would be very helpful. |
@schuay I have created a demonstration of the bug here: https://github.com/bcoe/node-27566-bug As far as I can tell the root cause is the number of functions in a class, if a class has 14 or more functions on my machine, we drop all coverage information for the functions in that class, the class has under 14 functions we collect block coverage information for it. |
looks like we have a reproduction 🎉 and @schuay just landed a patch that he thinks should address this issue: https://bugs.chromium.org/p/v8/issues/detail?id=9212 I'll make an effort to back port a V8 patch (it's been a while since I've done this, so might end up needing to ask for some help). |
I verified https://crbug.com/v8/9212#c22 fixes the issue when applied to current Node master. Thanks for the repro, wouldn't have found this without it. |
I have confirmed this fix with the nightly. |
v12.1.0
Fedora 28 (Twenty Eight)
test
This took me a while to figure out, and is potentially in the V8 engine.
In Node 12, block coverage seems to be dropped for some functions, on some platforms.
Here's an example:
The main difference between the two test runs is that coverage for
generateChangelogEntry
is missing in the output from Fedora (this is a serious issue, because from a test reporter point of view,generateChangelogEntry
will appear as covered).Additional Information
this problem seemed to also occur on; @coreyfarrell was unable to reproduce on11.14.0
on Fedora on @coreyfarrell's computer, but not11.15.0
>11.10.0
with further testing.CC: @joyeecheung @hashseed @schuay, was wondering if you might have any thoughts on this one ... I could imagine it possibly being an issue in V8, or potentially a race condition during the bootstrapping of coverage in Node.js.
The text was updated successfully, but these errors were encountered: