breejs / bree

Bree is a Node.js and JavaScript job task scheduler with worker threads, cron, Date, and human syntax. Built for @ladjs, @forwardemail, @spamscanner, @cabinjs.
https://jobscheduler.net
MIT License
3.01k stars 78 forks source link

[discussion] Segmentation Fault Ubuntu X64 #157

Closed DaRabus closed 2 years ago

DaRabus commented 2 years ago

Hey Guys, I started to setup my Bee workers to make my tasks in a worker thread externally.

But as soon as my task wants to start a 2nd time it crashes with following issue:

Do I have to close the Threads in another way, or do they get generated wrong? Got the same issue now on my Windows Testing environment, just here it just fails without throwing me an error.

I am using an express server as a base of instance, could this be root of the issue?

` image

image

shadowgate15 commented 2 years ago

It looks like one job is ending in the same tick as the next one starts. You might try making sure there is at least a space of one tick between ending and starting the next job.

DaRabus commented 2 years ago

It looks like one job is ending in the same tick as the next one starts. You might try making sure there is at least a space of one tick between ending and starting the next job.

Thanks, so i will give him more time to reallocate the memory, there is no command to set the memory free or so?

shadowgate15 commented 2 years ago

actually could you run this with NODE_DEBUG= or NODE_DEBUG=bree and post the log output. If my previous statement were true, I'm pretty sure you would have seen a log output saying the worker was already running.

DaRabus commented 2 years ago

https://pastebin.com/8G3Szf4W

Doesnt really provide me much informations tbh.

On Windows it just crashes without a proper error

shadowgate15 commented 2 years ago

I would look into lines 334 & 336. I don't think this is being cause by bree. Bree looks to be running correctly. Typically Segmentation faults are caused by attempting to access restricted or illegal parts of memory.