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

Segmentation fault on Angular8 test on Node 13.2 #9244

Closed
lesiak opened this issue Nov 29, 2019 · 5 comments
Closed

Segmentation fault on Angular8 test on Node 13.2 #9244

lesiak opened this issue Nov 29, 2019 · 5 comments

Comments

@lesiak
Copy link

lesiak commented Nov 29, 2019

🐛 Bug Report

https://stackoverflow.com/questions/59090476/jest-with-angular8-and-node-13-segmentation-fault
Basic angular test fails on node 13.2 with Segmentation fault, but passes on node 13.1 and node 12

The test:

import {TestBed} from '@angular/core/testing';
import {HttpService} from './http.service';

describe('HttpService', () => {
  let service: HttpService;

  beforeEach(() => {
    TestBed.configureTestingModule({
      imports: [
      ],
      providers: [
      ]
    });

    service = TestBed.get(HttpService);
  });

  it('should be created1', () => {
    expect(service).toBeTruthy();
  });

  it('should be created2', () => {
    expect(service).toBeTruthy();
  });

  it('should be created3', () => {
    expect(service).toBeTruthy();
  });

  it('should be created4', () => {
    expect(service).toBeTruthy();
  });

  it('should be created5', () => {
    expect(service).toBeTruthy();
  });

  it('should be created6', () => {
    expect(service).toBeTruthy();
  });

  it('should be created7', () => {
    expect(service).toBeTruthy();
  });
});

Class under tests:

import {Injectable} from '@angular/core';

@Injectable({
  providedIn: 'root'
})
export class HttpService {
}

I also noticed that the test passes if there are 5 or less test cases, and always fails on the 6th test.

To Reproduce

I've been following Angular CLI: “ng test” with Jest in 3 minutes (v2) tutorial to set up jest tests with Angular 8.
Added test as stated above.
ng test fails with segmentation fault

Expected behavior

tests pass

Link to repl or repo (highly encouraged)

Github repo:
https://github.com/lesiak/node13-angular-jest
Github Workflow test matrix:
https://github.com/lesiak/node13-angular-jest/commit/beec00272208404ce9c490d6d4dab40fbb9e6125/checks?check_suite_id=334253246

envinfo

System:
    OS: macOS Mojave 10.14.6
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
  Binaries:
    Node: 13.2.0 - /usr/local/bin/node
    npm: 6.13.1 - /usr/local/bin/npm
@rajivshah3
Copy link

rajivshah3 commented Nov 29, 2019

I was able to reproduce this in a Docker container (node:13-stretch). This was the resulting core dump:

#0  0x00000009de554576 in ?? ()
#1  0x0000000000d8d1ef in v8::internal::Runtime_StorePropertyWithInterceptor(int, unsigned long*, v8::internal::Isolate*) ()
#2  0x00000000013a1179 in Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit () at ../../deps/v8/../../deps/v8/src/builtins/base.tq:3629
#3  0x000000000140447e in Builtins_StaNamedPropertyHandler ()
    at ../../deps/v8/../../deps/v8/src/builtins/base.tq:385
#4  0x000000000132d25b in Builtins_InterpreterEntryTrampoline ()
    at ../../deps/v8/../../deps/v8/src/builtins/base.tq:412
#5  0x0000229de19a7c09 in ?? ()
#6  0x00003a0ffe380261 in ?? ()
#7  0x000018f520c804b9 in ?? ()
#8  0x0000005f00000000 in ?? ()
#9  0x000009becc927279 in ?? ()
#10 0x0000153c47c05159 in ?? ()
#11 0x00000f668e9a3b99 in ?? ()
#12 0x00007ffe29a9a3c0 in ?? ()
#13 0x000000000132d25b in Builtins_InterpreterEntryTrampoline ()
    at ../../deps/v8/../../deps/v8/src/builtins/base.tq:412
#14 0x0000153c47c051c1 in ?? ()
#15 0x0000084448b6be69 in ?? ()
#16 0x000018f520c804b9 in ?? ()
#17 0x000018f520c804b9 in ?? ()
#18 0x000018f520c804b9 in ?? ()
#19 0x000018f520c804b9 in ?? ()
#20 0x000018f520c804b9 in ?? ()
#21 0x0000153c47c051c1 in ?? ()
#22 0x0000084448b6be69 in ?? ()
#23 0x0000153c47c05159 in ?? ()
#24 0x0000004200000000 in ?? ()
#25 0x000009becc9270f1 in ?? ()
#26 0x000013c07c755ad9 in ?? ()
#27 0x00000f668e9a3b99 in ?? ()
#28 0x00007ffe29a9a418 in ?? ()
#29 0x000000000132d25b in Builtins_InterpreterEntryTrampoline ()
    at ../../deps/v8/../../deps/v8/src/builtins/base.tq:412
#30 0x000018f520c801c1 in ?? ()
#31 0x000018f520c804b9 in ?? ()
#32 0x000013c07c755ad9 in ?? ()
#33 0x00002b8a8c008ed9 in ?? ()
#34 0x0000000100000000 in ?? ()
#35 0x0000005300000000 in ?? ()
#36 0x00000d9b86d98781 in ?? ()
#37 0x00002b8a8c003e79 in ?? ()
#38 0x00002c494aabfb91 in ?? ()
#39 0x00007ffe29a9a4b0 in ?? ()
#40 0x000000000132d25b in Builtins_InterpreterEntryTrampoline ()
    at ../../deps/v8/../../deps/v8/src/builtins/base.tq:412
#41 0x000018f520c801c1 in ?? ()
#42 0x000018f520c801c1 in ?? ()
#43 0x000018f520c804b9 in ?? ()
#44 0x000018f520c804b9 in ?? ()
#45 0x00002b8a8c0043d9 in ?? ()
#46 0x00002b8a8c004219 in ?? ()
#47 0x000018f520c801c1 in ?? ()
#48 0x000018f520c801c1 in ?? ()
#49 0x000018f520c804b9 in ?? ()
#50 0x0000000200000000 in ?? ()
#51 0x000018f520c804b9 in ?? ()
#52 0x000018f520c804b9 in ?? ()
#53 0x0000000200000000 in ?? ()
#54 0x0000009f00000000 in ?? ()
#55 0x000009becc926801 in ?? ()
#56 0x0000229de19b97a9 in ?? ()
#57 0x00000f668e99cb01 in ?? ()
#58 0x00007ffe29a9a530 in ?? ()
#59 0x000000000132d25b in Builtins_InterpreterEntryTrampoline ()
    at ../../deps/v8/../../deps/v8/src/builtins/base.tq:412
#60 0x00002b8a8c004419 in ?? ()
#61 0x00002b8a8c003e79 in ?? ()
#62 0x00002b8a8c008499 in ?? ()
#63 0x000018f520c804b9 in ?? ()
#64 0x00002b8a8c004419 in ?? ()
#65 0x00002b8a8c003e79 in ?? ()
#66 0x00002b8a8c008499 in ?? ()
#67 0x0000229de19b97a9 in ?? ()
#68 0x0000040000000000 in ?? ()
#69 0x000018f520c804b9 in ?? ()
#70 0x0000009f00000000 in ?? ()
#71 0x000009becc9257b1 in ?? ()
#72 0x0000229de19b9669 in ?? ()
#73 0x00000f668e99cb01 in ?? ()
#74 0x00007ffe29a9a5b0 in ?? ()
#75 0x000000000132d25b in Builtins_InterpreterEntryTrampoline ()
    at ../../deps/v8/../../deps/v8/src/builtins/base.tq:412
#76 0x00002b8a8c004439 in ?? ()
#77 0x00002b8a8c008499 in ?? ()
#78 0x000018f520c804b9 in ?? ()
#79 0x0000229de19b9669 in ?? ()
#80 0x00002b8a8c007511 in ?? ()
#81 0x00002b8a8c007511 in ?? ()
#82 0x00002b8a8c004439 in ?? ()
#83 0x0000001700000000 in ?? ()
#84 0x00002b8a8c008549 in ?? ()
#85 0x00002b8a8c008329 in ?? ()
#86 0x0000009600000000 in ?? ()
#87 0x000009becc9255d1 in ?? ()
#88 0x0000153c47c180e9 in ?? ()
#89 0x00000f668e99cb01 in ?? ()
#90 0x00007ffe29a9a5f8 in ?? ()
#91 0x000000000132d25b in Builtins_InterpreterEntryTrampoline ()
    at ../../deps/v8/../../deps/v8/src/builtins/base.tq:412
#92 0x00002b8a8c008499 in ?? ()
#93 0x000018f520c804b9 in ?? ()
#94 0x0000153c47c180e9 in ?? ()
#95 0x0000006500000000 in ?? ()
#96 0x000009becc9253f9 in ?? ()
#97 0x000013c07c7522b1 in ?? ()
#98 0x00000f668e99cb01 in ?? ()
#99 0x00007ffe29a9a660 in ?? ()
#100 0x00000000013292a7 in Builtins_JSConstructStubGeneric ()
    at ../../deps/v8/../../deps/v8/src/builtins/base.tq:412

@SimenB
Copy link
Member

SimenB commented Nov 30, 2019

Thanks for the report! I've reported this upstream: nodejs/node#30730

@targos
Copy link

targos commented Nov 30, 2019

It was a bug in V8, fixed by nodejs/node#30681. A new Node.js 13 release should happen next week.

@SimenB
Copy link
Member

SimenB commented Nov 30, 2019

Perfect, thanks @targos!

@SimenB SimenB closed this as completed Nov 30, 2019
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants