Skip to content
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

Crashes under Windows #582

Closed
6 tasks done
Demivan opened this issue Jan 19, 2022 · 27 comments · Fixed by #583 or #588
Closed
6 tasks done

Crashes under Windows #582

Demivan opened this issue Jan 19, 2022 · 27 comments · Fixed by #583 or #588

Comments

@Demivan
Copy link
Member

Demivan commented Jan 19, 2022

Describe the bug

Adding this here so we don't forget to fix it

Reproduction

https://github.com/vitest-dev/vitest/runs/4868391749?check_suite_focus=true

System Info

Windows

Used Package Manager

pnpm

Validations

@userquin
Copy link
Member

we don't forget it, just check the pull requests ;)

@sheremet-va
Copy link
Member

I have a theory: #583

@Demivan
Copy link
Member Author

Demivan commented Jan 19, 2022

@sheremet-va Cool, lets run github actions few times :)

@sheremet-va
Copy link
Member

All five attempts are passing https://github.com/vitest-dev/vitest/actions/runs/1718747096

@userquin
Copy link
Member

let me check on my windows machine

@userquin
Copy link
Member

userquin commented Jan 19, 2022

nopes, still failing:

examples/mocks test:  1: 00007FF60F6E013F v8::internal::CodeObjectRegistry::~CodeObjectRegistry+112495
examples/mocks test:  2: 00007FF60F66F396 DSA_meth_get_flags+65526
examples/mocks test:  3: 00007FF60F67024D node::OnFatalError+301
examples/mocks test:  4: 00007FF60FFAA455 v8::V8::ToLocalEmpty+53
examples/mocks test:  5: 00007FF60F667208 DSA_meth_get_flags+32360
examples/mocks test: 14: 00007FF60F72F36D uv_poll_stop+557
examples/mocks test: 15: 00007FF610540C60 v8::internal::compiler::RepresentationChanger::Uint32OverflowOperatorFor+146416
examples/mocks test: 16: 00007FFF01D37034 BaseThreadInitThunk+20
examples/mocks test: 17: 00007FFF02102651 RtlUserThreadStart+33
examples/mocks test: Failed
undefined
F:\work\projects\quini\GitHub\antfu\vitest-clean\examples\mocks:
 ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL  @vitest/test-lit@ test: `vitest`
Exit status 134
examples/react-mui test$ vitest

@sheremet-va
Copy link
Member

Too soon

@sheremet-va sheremet-va reopened this Jan 19, 2022
@sheremet-va
Copy link
Member

sheremet-va commented Jan 19, 2022

I was hoping these issues were related, but I guess we need a to dig deeper!

@userquin
Copy link
Member

I'll check something, there the local changes, I think I have include all changes on your PR:

imagen

@Demivan
Copy link
Member Author

Demivan commented Jan 19, 2022

I think we had two different crashes under Windows. I saw different node stack traces sometimes.

@userquin
Copy link
Member

@Demivan it is really strange, I have 2 or 3 distinct stack traces, from cmd.exe chash to v8 null pointer (next 3 errors from 3 consecutive pnpm run test:all once built):

null pointer
examples/mocks test: FATAL ERROR: v8::ToLocalChecked Empty MaybeLocal.
examples/mocks test:  1: 00007FF60F6E013F v8::internal::CodeObjectRegistry::~CodeObjectRegistry+112495
examples/mocks test:  2: 00007FF60F66F396 DSA_meth_get_flags+65526
examples/mocks test:  3: 00007FF60F67024D node::OnFatalError+301
examples/mocks test:  4: 00007FF60FFAA455 v8::V8::ToLocalEmpty+53
examples/mocks test:  5: 00007FF60F667208 DSA_meth_get_flags+32360
examples/mocks test:  6: 00007FF60F65984E v8::base::CPU::has_sse+36718
examples/mocks test:  7: 00007FF60F742C87 uv_timer_stop+1207
examples/mocks test:  8: 00007FF60F73F25B uv_async_send+331
examples/mocks test:  9: 00007FF60F73E9EC uv_loop_init+1292
examples/mocks test: 10: 00007FF60F73EB8A uv_run+202
examples/mocks test: 11: 00007FF60F70DC95 node::SpinEventLoop+309
examples/mocks test: 12: 00007FF60F5A8660 v8::internal::wasm::SignatureMap::Freeze+35776
examples/mocks test: 13: 00007FF60F5A3CB8 v8::internal::wasm::SignatureMap::Freeze+16920
examples/mocks test: 14: 00007FF60F72F36D uv_poll_stop+557
examples/mocks test: 15: 00007FF610540C60 v8::internal::compiler::RepresentationChanger::Uint32OverflowOperatorFor+146416
examples/mocks test: 16: 00007FFF01D37034 BaseThreadInitThunk+20
examples/mocks test: 17: 00007FFF02102651 RtlUserThreadStart+33
examples/mocks test: Failed
undefined
F:\work\projects\quini\GitHub\antfu\vitest-clean\examples\mocks:
 ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL  @vitest/test-lit@ test: `vitest`
Exit status 134
 ELIFECYCLE  Command failed with exit code 1.
serialization problem
examples/mocks test: FATAL ERROR: v8::FromJust Maybe value is Nothing.
examples/mocks test:  1: 00007FF60F6E013F v8::internal::CodeObjectRegistry::~CodeObjectRegistry+112495
examples/mocks test:  2: 00007FF60F66F396 DSA_meth_get_flags+65526
examples/mocks test:  3: 00007FF60F67024D node::OnFatalError+301
examples/mocks test:  4: 00007FF60FF8C2F5 v8::V8::FromJustIsNothing+53
examples/mocks test:  5: 00007FF60F6583E3 v8::base::CPU::has_sse+31491
examples/mocks test:  6: 00007FF60F742C87 uv_timer_stop+1207
examples/mocks test:  7: 00007FF60F73F25B uv_async_send+331
examples/mocks test:  8: 00007FF60F73E9EC uv_loop_init+1292
examples/mocks test:  9: 00007FF60F73EB8A uv_run+202
examples/mocks test: 10: 00007FF60F70DC95 node::SpinEventLoop+309
examples/mocks test: 11: 00007FF60F5A8660 v8::internal::wasm::SignatureMap::Freeze+35776
examples/mocks test: 12: 00007FF60F5A3CB8 v8::internal::wasm::SignatureMap::Freeze+16920
examples/mocks test: 13: 00007FF60F72F36D uv_poll_stop+557
examples/mocks test: 14: 00007FF610540C60 v8::internal::compiler::RepresentationChanger::Uint32OverflowOperatorFor+146416
examples/mocks test: 15: 00007FFF01D37034 BaseThreadInitThunk+20
examples/mocks test: 16: 00007FFF02102651 RtlUserThreadStart+33
examples/mocks test: Failed
undefined
F:\work\projects\quini\GitHub\antfu\vitest-clean\examples\mocks:
 ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL  @vitest/test-lit@ test: `vitest`
Exit status 134
examples/react-mui test$ vitest
 ELIFECYCLE  Command failed with exit code 1.
cmd.exe error
examples/mocks test: C:\WINDOWS\system32\cmd.exe  - pnpm  run test:all[2712]: c:\ws\src\node_file-inl.h:160: Assertion `finished_' failed.
examples/lit test: Done
examples/react-enzyme test$ vitest
examples/mocks test:  1: 00007FF60F6E013F v8::internal::CodeObjectRegistry::~CodeObjectRegistry+112495
examples/mocks test:  2: 00007FF60F66F396 DSA_meth_get_flags+65526
examples/mocks test:  3: 00007FF60F66F751 DSA_meth_get_flags+66481
examples/mocks test:  4: 00007FF60F658B9E v8::base::CPU::has_sse+33470
examples/mocks test:  5: 00007FF60F65A076 v8::base::CPU::has_sse+38806
examples/mocks test:  6: 00007FF60F742C87 uv_timer_stop+1207
examples/mocks test:  7: 00007FF60F73F25B uv_async_send+331
examples/mocks test:  8: 00007FF60F73E9EC uv_loop_init+1292
examples/mocks test:  9: 00007FF60F73EB8A uv_run+202
examples/mocks test: 10: 00007FF60F70DC95 node::SpinEventLoop+309
examples/mocks test: 11: 00007FF60F5A8660 v8::internal::wasm::SignatureMap::Freeze+35776
examples/mocks test: 12: 00007FF60F5A3CB8 v8::internal::wasm::SignatureMap::Freeze+16920
examples/mocks test: 13: 00007FF60F72F36D uv_poll_stop+557
examples/mocks test: 14: 00007FF610540C60 v8::internal::compiler::RepresentationChanger::Uint32OverflowOperatorFor+146416
examples/mocks test: 15: 00007FFF01D37034 BaseThreadInitThunk+20
examples/mocks test: 16: 00007FFF02102651 RtlUserThreadStart+33
examples/mocks test: Failed
undefined
F:\work\projects\quini\GitHub\antfu\vitest-clean\examples\mocks:
 ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL  @vitest/test-lit@ test: `vitest`
Exit status 134
examples/react-mui test$ vitest
 ELIFECYCLE  Command failed with exit code 1.

@sheremet-va
Copy link
Member

If you remove process.exit, it still crashes?

@sheremet-va
Copy link
Member

sheremet-va commented Jan 19, 2022

The last error is Assertion finished_' failed which should have been fixed it the pr 🤔

@sheremet-va
Copy link
Member

sheremet-va commented Jan 19, 2022

They all include CodeObjectRegistry+112495.

Maybe we don't event need to exit 🤔 Or we need to clean something else 🤔

@userquin
Copy link
Member

ok, testing it

@userquin
Copy link
Member

@sheremet-va it seems to be the process.exit, now the fails tests are running ok, before removing the exit line always failing, just doing a few runs more also with test:ci...

@Demivan
Copy link
Member Author

Demivan commented Jan 19, 2022

@sheremet-va, We should just make so that process.exit is only called on timeout

@userquin
Copy link
Member

nr ci + 6 consecutive test:all ok, testing now also test:ci.

I add an await to the Promise.race, this is the code that works, must I try removing the await add?:

imagen

@sheremet-va
Copy link
Member

sheremet-va commented Jan 19, 2022

@sheremet-va, We should just make so that process.exit is only called on timeout

Let's try that. PR is welcome! Tho I guess we have another promise that is not resolved?

@userquin
Copy link
Member

ok, another 5 consecutive runs with test:ci ok, running last test: nr ci && pnpm run test:all && pnpm run test:ci

@sheremet-va
Copy link
Member

nr ci + 6 consecutive test:all ok, testing now also test:ci.

I add an await to the Promise.race, this is the code that works, must I try removing the await add?:

Not sure if await does anything here to fix it tbh

@userquin
Copy link
Member

ok it seems without the process.exit works again

@Demivan
Copy link
Member Author

Demivan commented Jan 19, 2022

Problem right now is that this.close promise resolves, and that resolves Promise.race so we call process.exit() but not everything was cleaned up.

We should call process.exit() only if Vitest locked up somewhere and needs to be killed.

@Demivan
Copy link
Member Author

Demivan commented Jan 19, 2022

@userquin Can you test this? #588

@Demivan
Copy link
Member Author

Demivan commented Jan 19, 2022

@sheremet-va I'm not a collaborator, so don't have permissions to restart workflow. Can you rerun #588 few times?

@userquin
Copy link
Member

@Demivan @sheremet-va the changes on #588 works on my windows machine, no error reported

sheremet-va pushed a commit that referenced this issue Jan 19, 2022
* fix: fix node crash under Windows

* chore: use exit code 1 if cli did not exit in time

* Revert "chore: use exit code 1 if cli did not exit in time"

This reverts commit c063bac.
@Demivan
Copy link
Member Author

Demivan commented Jan 20, 2022

@github-actions github-actions bot locked and limited conversation to collaborators Jun 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants