question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Segmentation fault in child thread with levelDB

See original GitHub issue

Version node: v10.8.0 Ubuntu 16

I see this error when i try connection to LevelDB in child thread from module ‘worker_threads’

Ошибка сегментирования (сделан дамп памяти)
// Segmentation fault

This is the code that executes in eval field of thread:

const level = require('level')
const db = level('./data', {
  valueEncoding: 'json'
}, 
(error) => {
  if (error) { 
    console.log('LevelDB storage does not open with',error) }
  else { console.log('LevelDB storage has opened') }
})

Before this error with levelDB this threads performed any code even with Redis(almost the same levelDB), but with this case i getting the message that describes above.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
peakjicommented, Aug 21, 2018

@genisgetman The new experimental worker threads module does not support native addons.

Native addons are not supported yet.

Q: Do native addons work? Cluster? child_processes? A: not yet, but it is planned for the future. Launching child processes and clusters from workers is possible.

0reactions
peakjicommented, Aug 21, 2018

@genisgetman Btw, I don’t recommend using level in a Worker thread (except pure javascript stores like memdown) because leveldown handles async I/O it self.

In addition, the current “thread” implementation in node 10.x is not like threads in C++, the overhead of structured clone or ArrayBuffer serialization is innegligible.

Workers are useful for performing CPU-intensive JavaScript operations; do not use them for I/O, since Node.js’s built-in mechanisms for performing operations asynchronously already treat it more efficiently than Worker threads can.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Segmentation fault occurring with child pthreads
My job is to register five child threads and schedule each one based on the order of their IDs stored in an array....
Read more >
Bug #47643: mds: Segmentation fault in thread 7fcff3078700 ...
I'm not sure this double-deref is indicating anything. Are you sure that's a pointer? Would you not want: Right, apologies for the noise....
Read more >
[Bug 1002455] New: Segfault during ceph-osd --flush-journal ...
I have ceph-10.2.2+git.1472064878.6bc382e-1.6.x86_64 installed, from Leap 42.2. If I run ceph-osd --flush-journal on an OSD with an external journal ...
Read more >
[Solved]-Implementation of AES in assembly-C - appsloveworld
Segmentation fault in my Assembly implementation · Implementation inline assembly of compare and swap function for Sparc V8 · How to combine assembly...
Read more >
Untitled
Resolves: Bug 1465383 - Segmentation fault in ... Bump version to 1.3.7.5.17 - Resolves: Bug 1539082 - Child entry cenotaphs should not prevent...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found