Skip to content

segfault in nodejs process when relaunching chromium #2872

Closed

Description

@3p3r

Steps to reproduce

Tell us about your environment:

  • Puppeteer version: 1.5.0
  • Platform / OS version: Ubuntu 18 x64
  • URLs (if applicable):
  • Node.js version: 10.6.0

What steps will reproduce the problem?

for(;;) {
  const browser = await puppeteer.launch();
  await browser.close();
}

What is the expected result?

Should be able to successfully shutdown and relaunch in the same nodejs process again and again.

What happens instead?

I am experiencing this segfault inside nodejs process only some times. This repros both inside docker and on my system outside of docker (same OS / arch / node). Here is the partial stacktrace:

SegvAnalysis:
 Segfault happened at: 0xe50db3 <_ZN2v88internal17ConcurrentMarking3RunEiPNS1_9TaskStateE+579>:	movzbl 0xa(%r10),%eax
 PC (0x00e50db3) ok
 source "0xa(%r10)" (0x3f67c380a) not located in a known VMA region (needed readable region)!
 destination "%eax" ok
 Stack memory exhausted (SP below stack segment)
SegvReason: reading unknown VMA
Stacktrace:
 #0  0x0000000000e50db3 in v8::internal::ConcurrentMarking::Run(int, v8::internal::ConcurrentMarking::TaskState*) ()
 #1  0x0000000000b7eac6 in v8::internal::CancelableTask::Run() ()
 #2  0x0000000000904d11 in node::BackgroundRunner(void*) ()
 #3  0x00007fe931aed6db in start_thread (arg=0x7fe9306f2700) at pthread_create.c:463
         pd = 0x7fe9306f2700
         now = <optimized out>
         unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140639516698368, -8583754684441953919, 140639516696512, 0, 61660120, 140722291265856, 8588927756719225217, 8588931607480105345}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
         not_first_call = <optimized out>
 #4  0x00007fe93181688f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
StacktraceAddressSignature: /home/sepehr/.nvm/versions/node/v10.6.0/bin/node:11:/home/sepehr/.nvm/versions/node/v10.6.0/bin/node+a50db3:/home/sepehr/.nvm/versions/node/v10.6.0/bin/node+77eac6:/home/sepehr/.nvm/versions/node/v10.6.0/bin/node+504d11:/lib/x86_64-linux-gnu/libpthread-2.27.so+76db:/lib/x86_64-linux-gnu/libc-2.27.so+12188f
StacktraceTop:
 v8::internal::ConcurrentMarking::Run(int, v8::internal::ConcurrentMarking::TaskState*) ()
 v8::internal::CancelableTask::Run() ()
 node::BackgroundRunner(void*) ()
 start_thread (arg=0x7fe9306f2700) at pthread_create.c:463
 clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
Tags:  bionic

I did not post this to Chromium as the stacktrace indicates this is a crash in the nodejs process.

Activity

  1. aslushnikov commented on Jul 12, 2018

    @aslushnikov
    Contributor

    @sepehr-laal Interesting. The following script work fine for me on puppeteer@next, Linux and node 10.6.0:

    const puppeteer = require('puppeteer');
    
    (async() => {
      let i = 0;
      for(;;) {
        ++i;
        console.log('Launching ' + i);
        const browser = await puppeteer.launch();
        await browser.close();
      }
    })();

    It easily gets to 350 for me. Can you please check if puppeteer's tip-of-tree make things any better?

  2. 3p3r commented on Jul 12, 2018

    @3p3r
    Author

    I will give @next a shot, will report back. note that this happens sporadically. It seems related to GC and having something to do with async-hooks (found this info while surfing web for similar stacktraces).

  3. 3p3r commented on Jul 12, 2018

    @3p3r
    Author

    Update: it's hard to tell if it helped or not since it happens sporadically. I was able to reproduce it only once using the @next branch. @aslushnikov

  4. aslushnikov commented on Jul 12, 2018

    @aslushnikov
    Contributor

    Thanks @sepehr-laal,

    This looks like a V8/nodejs bug. Would you mind reporting it over to node.js?

  5. 3p3r commented on Jul 13, 2018

    @3p3r
    Author

    yeah that seems reasonable. will report over.

  6. aslushnikov commented on Jul 13, 2018

    @aslushnikov
    Contributor

    Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions