-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Memory bug and crash when running in Jest tests #1369
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
Comments
To test the async coordination issue I've added a 1 second await timeout between between each setup and tear down. After running the test suite 3 time (over 100 suites run total) I've had no memory issues. This suggests that it is indeed an asynchronous piece of code that's not properly awaited during shutdown. |
I'm not familiar with Jest's process/thread behavior. It would be interesting to know if the current 5.2.0-dev (compile from GitHub) differs because:
|
Huzzah @cjbj! Running with 5.2.0-dev ( |
@code-ape no problems. Let us know of any issues (or improvements!) you find with 5.2.0-dev |
@code-ape what was the result of your testing? |
@code-ape That's great. We've frozen 5.2 and plan to complete release testing this week. I'll close this now. |
Crash. It's caused by a memory bug and is random but occurs with high frequency.
When running a Jest test scenario (details below) it will generally occur between the 2nd and 5th test suite that's run.
There is a full setup / teardown between each test suite, including for the db driver. This means each test suite the driver is getting shut own and stood back up. So my guess is that there's a missing coordination piece that is occasionally causing out of order memory actions.
Either a segmentation fault (
segfault
), a null pointer exception, or sometimesmunmap_chunk(): invalid pointer
. These have been caught via various tools I've tried with it. It tends to occur on the "startup" of a new test suite. Perhaps there's an async teardown process for the library that's overlapping somehow with the rebuild?Surprisingly,
llnode
wasn't able to backtrace any Javascript, which I assume means that the oracledb compiled code is directly registering some async process that's causing this.SIGSEGV example 1
SIGSEGV example 2
I can attempt to cobble one of these up if needed, but this is a quite large project and the issue seems to be with the life cycling of the oracle library between test suite runs in Jest.
I'm forgoing this to start with as it would take a number of hours to do.
I'm relatively familiar with debugging compiled code. So happy to help if I can with that! I'm relatively new to Oracledb though, so apologies in advance if I'm there are things I'm not 100% familiar with it.
We are using Knex.js as a driver on top of
oracledb
for Node. But based on the evidence, it appears this is not a Knex issue (it's not in any stack trace or error).The text was updated successfully, but these errors were encountered: