Skip to content

RangeError: Array buffer allocation failed #50837

@skeletorgithub

Description

@skeletorgithub

Version

18.16.0

Platform

Oracle Solaris

Subsystem

No response

What steps will reproduce the bug?

  1. Use webpack framework
  2. Build project with enabled cache (inside webpack)
  3. Build project on Oracle Solaris

How often does it reproduce? Is there a required condition?

Randomly

What is the expected behavior? Why is that the expected behavior?

Successfully built

What do you see instead?

node:internal/buffer:961 super(bufferOrLength, byteOffset, length); ^ RangeError: Array buffer allocation failed at new ArrayBuffer (<anonymous>) at new Uint8Array (<anonymous>) at new FastBuffer (node:internal/buffer:961:5) at createUnsafeBuffer (node:internal/buffer:1064:12) at Function.allocUnsafeSlow (node:buffer:443:10) at read (/export/home/skeletor/web/webapp/node_modules/webpack/lib/serialization/FileMiddleware.js:597:32) at /export/home/skeletor/web/webapp/node_modules/webpack/lib/serialization/FileMiddleware.js:657:7 at /export/home/skeletor/web/webapp/node_modules/graceful-fs/graceful-fs.js:362:16 at FSReqCallback.oncomplete (node:fs:198:23)

Additional information

We have one project, which includes webpack framework. If we enable cache at webpack - project building randomly (can be 1 fail versus 10 success) fails on Solaris (it's almost x64 bit arch and we use only x64 ). If we disable cache - everything is fine, but building is too long, ~ 10-15 min, versus 1-2 min with enabled cache. We have tried change cache type (memory/filesystem), but when it set to memory, building is also too long.

We have tried to build with next options (also, we have tried to rebuild with dynamic/static ICU.):

CONFIGURE_OPTIONS = --prefix=/usr/node CONFIGURE_OPTIONS += --shared-zlib CONFIGURE_OPTIONS += --with-dtrace CONFIGURE_OPTIONS += --shared-nghttp2 CONFIGURE_OPTIONS += --shared-openssl #CONFIGURE_OPTIONS += --with-intl=system-icu CONFIGURE_OPTIONS += --with-intl=full-icu CONFIGURE_OPTIONS+= --openssl-is-fips CONFIGURE_OPTIONS+= --shared-cares

We have tried combine next options with different values:
--max-old-space-size=32768 --v8-os-page-size=4 --v8-os-page-size=2048 --expose-gc --experimental-vm-modules

Of course, server has enough memory/swap/rights. We have tried to run project from root (to exclude system restrictions for non root users). Also, we have tried Solaris-specific options, like change memory allocators, enable/disable ASLR,...

We have the same project with the same modules/versions which successfully build on Linux/MacOSX, but fail on Oracle Solaris. My question is: may be, you know compile options, which builds binaries under linux (for example, binaries from this URL https://nodejs.org/download/release/v18.16.0/ ) and we will try such options under Solaris? Or, you know OS-specific parts in source, which is Linux related? Or, you can tell us, what should we try?
We can't try the latest version, because our code isn't ready for it. If you know, that such behaviour has already fixed in newer version, we will try to update our source code to it.

Ultimately, such behaviour is randomly: can be 1 or 2 fails versus 10-15 success. Such behaviour has started from nodejs 12 version when we have started using webpack. You can say, that it's webpack relation, but webpack it's a js-code and hasn't any binaries. We can't understand how much should allocate memory and why it can't be allocated? We have made at a lot of C/Python tests with allocation big memory chunks, and everything is fine.

Thank you for any advices, because we haven't any further ideas.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions