GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — modules: adding load linked modules feature by thlorenz · Pull Request #8 · nodejs/node

Conversation

@thlorenz

@thlorenz thlorenz commented Nov 28, 2014

Copy link
Copy Markdown
Contributor

refiling PR from node-fwd

  • introduced NM_F_LINKED flag to identify linked modules
  • setting node_is_initialized after calling V8::Initialize in order to
    make the right decision during initial module registration
  • introduced modlist_linked in order to track modules that were
    pre-registered in order to complete it once node is initialized
  • completing registration of linked module similarly to the way it's
    done inside DLOpen

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@thlorenz
modules: adding load linked modules feature
4ca42ac
- introduced NM_F_LINKED flag to identify linked modules
- setting node_is_initialized after calling V8::Initialize in order to
  make the right decision during initial module registration
- introduced modlist_linked in order to track modules that were
  pre-registered in order to complete it once node is initialized
- completing registration of linked module similarly to the way it's
  done inside DLOpen
@bnoordhuis

bnoordhuis commented Nov 28, 2014

Copy link
Copy Markdown
Member

For the record, I already LGTM'd this but I'd like @trevnorris to sign off on it.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@trevnorris

trevnorris commented Dec 1, 2014

Copy link
Copy Markdown
Contributor

LGTM

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rvagg

rvagg commented Dec 1, 2014

Copy link
Copy Markdown
Member

running full CI on this https://jenkins-node-forward.nodesource.com/job/iojs+any-pr+multi/3/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rvagg

rvagg commented Dec 1, 2014

Copy link
Copy Markdown
Member

@thlorenz would it be difficult to add a simple test for this in test/addons/ and perhaps a super-simple sanity check in test/simple/? seems like something that's ripe for regressions.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@thlorenz

thlorenz commented Dec 1, 2014

Copy link
Copy Markdown
Contributor Author

Ideally yes, but that would require adding something to node.gyp the way nad does.
That would also mean we'd have to recompile to run it.

So I think it'd have to be some integration test, possibly even executed manually, not sure.

Not sure when I can get to it. Could we merge this anyhow and I'll think about how to best do this and supply tests in another PR?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@trevnorris

trevnorris commented Dec 3, 2014

Copy link
Copy Markdown
Contributor

I'd normally require a test, but since the API is technically "private" (done, IMO, so the API can be hashed out as it's used if necessary) there's no need for a test at the moment.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@thlorenz

thlorenz commented Dec 3, 2014

Copy link
Copy Markdown
Contributor Author

Thanks @trevnorris and as I said it won't be a simple test.
Will hash out with @rvagg how to best include and run these integrationy tests in general and add one for this at that point.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rvagg

rvagg commented Dec 3, 2014

Copy link
Copy Markdown
Member

@thlorenz I assumed that the test/addons/ directory would be the place for this--they are a separate test run and are all compiled and loaded to test, perhaps we could do something similar to make this testable?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@thlorenz

thlorenz commented Dec 3, 2014

Copy link
Copy Markdown
Contributor Author

No this doesn't work exactly like an addon. It's a linked module, i.e. it has to be made part of the code base by modifying the node.gyp file (what nad does).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rvagg

rvagg commented Dec 4, 2014

Copy link
Copy Markdown
Member

this got landed in joyent/node didn't it? should we land it here or close and wait for the next pull from joyent/node?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@thlorenz

thlorenz commented Dec 4, 2014

Copy link
Copy Markdown
Contributor Author

It did land in joyent/node as well but in different shape since things were adapted to older API, i.e. env->SET_MODULE was not available there.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

rvagg pushed a commit that referenced this pull request Dec 4, 2014
@thlorenz @rvagg
modules: adding load linked modules feature
f4e058d
- introduced NM_F_LINKED flag to identify linked modules
- setting node_is_initialized after calling V8::Initialize in order to
  make the right decision during initial module registration
- introduced modlist_linked in order to track modules that were
  pre-registered in order to complete it once node is initialized
- completing registration of linked module similarly to the way it's
  done inside DLOpen

PR-URL: #8
Reviewed-by: Trevor Norris <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
@rvagg

rvagg commented Dec 4, 2014

Copy link
Copy Markdown
Member

landed via f4e058d

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rvagg rvagg closed this Dec 4, 2014
rvagg pushed a commit that referenced this pull request Dec 4, 2014
@thlorenz @rvagg
modules: adding load linked modules feature
f7f454a
- introduced NM_F_LINKED flag to identify linked modules
- setting node_is_initialized after calling V8::Initialize in order to
  make the right decision during initial module registration
- introduced modlist_linked in order to track modules that were
  pre-registered in order to complete it once node is initialized
- completing registration of linked module similarly to the way it's
  done inside DLOpen

PR-URL: #8
Reviewed-by: Trevor Norris <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
rvagg pushed a commit that referenced this pull request Dec 4, 2014
@thlorenz @rvagg
modules: adding load linked modules feature
12392a2
- introduced NM_F_LINKED flag to identify linked modules
- setting node_is_initialized after calling V8::Initialize in order to
  make the right decision during initial module registration
- introduced modlist_linked in order to track modules that were
  pre-registered in order to complete it once node is initialized
- completing registration of linked module similarly to the way it's
  done inside DLOpen

PR-URL: #8
Reviewed-by: Trevor Norris <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
rvagg pushed a commit that referenced this pull request Dec 4, 2014
@thlorenz @rvagg
modules: adding load linked modules feature
0fe7a0d
- introduced NM_F_LINKED flag to identify linked modules
- setting node_is_initialized after calling V8::Initialize in order to
  make the right decision during initial module registration
- introduced modlist_linked in order to track modules that were
  pre-registered in order to complete it once node is initialized
- completing registration of linked module similarly to the way it's
  done inside DLOpen

PR-URL: #8
Reviewed-by: Trevor Norris <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
@rvagg rvagg mentioned this pull request Jan 3, 2015
governance: Add new Collaborators #234
Closed
@kvic-z kvic-z mentioned this pull request Oct 27, 2015
compile error ,target=arm7 #3224
Closed
@jianpingw jianpingw mentioned this pull request Dec 13, 2015
node js 5.2.0 segmentation fault after console.log #4261
Closed
@dmitryame dmitryame mentioned this pull request Mar 10, 2016
Abort trap: 6 #5646
Closed
@rupamkhaitan rupamkhaitan mentioned this pull request Jun 27, 2016
trap invalid opcode ip:fea6f9 #3898
Closed
@mhhf mhhf mentioned this pull request Aug 24, 2016
Assertion failed ../deps/uv/src/unix/stream.c, line 1563 #8258
Closed
@rdkgit rdkgit mentioned this pull request Nov 11, 2016
SSL core dump in v6.9.1 #9551
Closed
@shyhpei shyhpei mentioned this pull request Feb 3, 2017
segmentation fault at v8::internal::StoreBuffer::EnsureSpace () #11156
Closed
@sxa sxa mentioned this pull request Mar 16, 2017
npm --version segfaults on v7.7.3 linux ppc64 (BE) only ON RHEL 7 #11882
Closed
@myitcv myitcv mentioned this pull request Aug 1, 2017
Segfault in v8.2.1 #14567
Closed
@lolobug lolobug mentioned this pull request Oct 31, 2018
fatal v8 error:Entering the V8 API without proper locking in place #23997
Closed
This was referenced Jun 28, 2020
There appears to be a bug with the http2 header decoding #28632
Closed
const dummy = new ArrayBuffer(); RangeError at v8.js #31370
Closed
@KungFuJesus KungFuJesus mentioned this pull request Jul 10, 2020
build 12.13.0 on mips64el segfault around mksnapshot #30304
Closed
@gengjiawen gengjiawen mentioned this pull request Aug 12, 2020
N-API reference management leaks memory #34731
Closed
@Flarna Flarna mentioned this pull request Aug 14, 2020
[v12.x backport] deps: V8: cherry-pick eec10a2fd8fa and #34008 #34776
Closed
@FlorSanders FlorSanders mentioned this pull request Aug 19, 2020
Raspberry Pi OS, malloc() when running script #34828
Closed
@silverwind silverwind mentioned this pull request Aug 20, 2020
https/http2: random crashes on macOS with simple server #34854
Closed
@dislon dislon mentioned this pull request Sep 4, 2020
Debugger crashes with assertion failure while using Chrome DevTools and remote debug #17259
Open
@tnodejs tnodejs mentioned this pull request Mar 25, 2021
use node 12.9.0 cause carsh problem #37902
Closed
targos referenced this pull request in targos/node Apr 27, 2021
@targos
deps: V8: cherry-pick a59e3ac1d7fa
8e9415c
Original commit message:

    Merged: [compiler] Fix bug in SimplifiedLowering's overflow computation

    Revision: e371325bcb03f20a362ebfa48225159702c6fde7

    BUG=chromium:1126249
    NOTRY=true
    NOPRESUBMIT=true
    NOTREECHECKS=true
    [email protected]

    Change-Id: I411d9233f77992e73da12784cef59c885999b556
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2415988
    Reviewed-by: Tobias Tebbi <[email protected]>
    Commit-Queue: Georg Neis <[email protected]>
    Cr-Commit-Position: refs/branch-heads/8.6@{#8}
    Cr-Branched-From: a64aed2333abf49e494d2a5ce24bbd14fff19f60-refs/heads/8.6.395@{#1}
    Cr-Branched-From: a626bc036236c9bf92ac7b87dc40c9e538b087e3-refs/heads/master@{#69472}

Refs: v8/v8@a59e3ac
targos added a commit that referenced this pull request Apr 30, 2021
@targos
deps: V8: cherry-pick a59e3ac1d7fa
5372f1f
Original commit message:

    Merged: [compiler] Fix bug in SimplifiedLowering's overflow computation

    Revision: e371325bcb03f20a362ebfa48225159702c6fde7

    BUG=chromium:1126249
    NOTRY=true
    NOPRESUBMIT=true
    NOTREECHECKS=true
    [email protected]

    Change-Id: I411d9233f77992e73da12784cef59c885999b556
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2415988
    Reviewed-by: Tobias Tebbi <[email protected]>
    Commit-Queue: Georg Neis <[email protected]>
    Cr-Commit-Position: refs/branch-heads/8.6@{#8}
    Cr-Branched-From: a64aed2333abf49e494d2a5ce24bbd14fff19f60-refs/heads/8.6.395@{#1}
    Cr-Branched-From: a626bc036236c9bf92ac7b87dc40c9e538b087e3-refs/heads/master@{#69472}

Refs: v8/v8@a59e3ac

PR-URL: #38275
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Jiawen Geng <[email protected]>
Reviewed-By: Shelley Vohr <[email protected]>
@alvin-7 alvin-7 mentioned this pull request Dec 15, 2021
create coredump with running in inspect #41178
Closed
@mhdawson mhdawson mentioned this pull request Sep 26, 2022
node-api: generalize finalizer second pass callback #44141
Closed
@theanarkh theanarkh mentioned this pull request Oct 18, 2022
crash when trace ic stats #45052
Closed
@khagankhan khagankhan mentioned this pull request Oct 13, 2023
Use of Uninitialized Memory Detected in bytecode_builtins_list_generator by MemorySanitizer #50171
Closed
dumganhar pushed a commit to dumganhar/node that referenced this pull request Dec 17, 2024
@a7ul
Merge pull request nodejs#8 from nodegui/update_readme
90f6577
Update README for v18.12.1
@nodejs-github-bot

This comment was marked as off-topic.

Sign in to view
@nodejs-github-bot

This comment was marked as off-topic.

Sign in to view
@ronking-zhu ronking-zhu mentioned this pull request Oct 13, 2025
Nodejs official released build has conflict with msodbcsql driver due to incompatible openssl version #60240
Closed
@sadan4 sadan4 mentioned this pull request Nov 5, 2025
NodeJS segfaults when trying to debug this code #60580
Closed
@jackzhp jackzhp mentioned this pull request Nov 5, 2025
Large file download (above 50MB, without "range processing") results in HTTP2_PROTOCOL_ERROR in Chrome #59465
Closed
@guybedford guybedford mentioned this pull request Apr 17, 2026
[v22.x] deps: V8: backport Wasm exception handling correctness fixes #62783
Closed
ndossche added a commit to ndossche/node that referenced this pull request May 21, 2026
@ndossche
src: fix edge case when deflateInit2() fails with Z_VERSION_ERROR
c6ea900
This function call can fail with `Z_VERSION_ERROR` if the compiled
library vs loaded library mismatched in version number or in
stream structure size.
In those cases, zlib doesn't initialize the `strm_.msg` field to
null. Therefore, when a `CompressionError` object is created via
`ErrorForMessage()`, it can read a stale or uninitialized `strm_.msg`
pointer that will cause a crash.

Example ASAN report:
```
AddressSanitizer: SEGV on unknown address
    #0 __strlen_avx2
        string/../sysdeps/x86_64/multiarch/strlen-avx2.S:76
    nodejs#1 strlen (/work/node/out/Debug/node+0x1a42ab7)
    nodejs#2 v8::(anonymous namespace)::StringLength(char const*)
        /work/node/out/../deps/v8/src/api/api.cc:7581:16
    nodejs#3 v8::(anonymous namespace)::StringLength(unsigned char const*)
        /work/node/out/../deps/v8/src/api/api.cc:7587:10
    nodejs#4 v8::String::NewFromOneByte(v8::Isolate*,
        unsigned char const*, v8::NewStringType, int)
        /work/node/out/../deps/v8/src/api/api.cc:7677:3
    nodejs#5 node::OneByteString(v8::Isolate*,
        char const*, int, v8::NewStringType)
        /work/node/out/../src/util-inl.h:166:10
    nodejs#6 node::(anonymous namespace)::CompressionStream<
        node::(anonymous namespace)::ZlibContext>
        ::EmitError(node::(anonymous namespace)
        ::CompressionError const&)
        /work/node/out/../src/node_zlib.cc:565:7
    nodejs#7 node::(anonymous namespace)::CompressionStream<
        node::(anonymous namespace)::ZlibContext>
        ::CheckError()
        /work/node/out/../src/node_zlib.cc:519:5
    nodejs#8 node::(anonymous namespace)::CompressionStream<
        node::(anonymous namespace)::ZlibContext>
        ::AfterThreadPoolWork(int)
        /work/node/out/../src/node_zlib.cc:543:10
    nodejs#9 node::ThreadPoolWork::ScheduleWork()
        ::'lambda'(uv_work_s*, int)
        ::operator()(uv_work_s*, int) const
        /work/node/out/../src/threadpoolwork-inl.h:57:15
    nodejs#10 node::ThreadPoolWork::ScheduleWork()
        ::'lambda'(uv_work_s*, int)
        ::__invoke(uv_work_s*, int)
        /work/node/out/../src/threadpoolwork-inl.h:48:7
    nodejs#11 uv__work_done /work/libuv-1.51.0/src/threadpool.c:330:5
    nodejs#12 uv__async_io.part.0
        /work/libuv-1.51.0/src/unix/async.c:208:5
```

Signed-off-by: ndossche <[email protected]>
nodejs-github-bot pushed a commit that referenced this pull request Jun 2, 2026
@ndossche
src: fix edge case when deflateInit2() fails with Z_VERSION_ERROR
458c37b
This function call can fail with `Z_VERSION_ERROR` if the compiled
library vs loaded library mismatched in version number or in
stream structure size.
In those cases, zlib doesn't initialize the `strm_.msg` field to
null. Therefore, when a `CompressionError` object is created via
`ErrorForMessage()`, it can read a stale or uninitialized `strm_.msg`
pointer that will cause a crash.

Example ASAN report:
```
AddressSanitizer: SEGV on unknown address
    #0 __strlen_avx2
        string/../sysdeps/x86_64/multiarch/strlen-avx2.S:76
    #1 strlen (/work/node/out/Debug/node+0x1a42ab7)
    #2 v8::(anonymous namespace)::StringLength(char const*)
        /work/node/out/../deps/v8/src/api/api.cc:7581:16
    #3 v8::(anonymous namespace)::StringLength(unsigned char const*)
        /work/node/out/../deps/v8/src/api/api.cc:7587:10
    #4 v8::String::NewFromOneByte(v8::Isolate*,
        unsigned char const*, v8::NewStringType, int)
        /work/node/out/../deps/v8/src/api/api.cc:7677:3
    #5 node::OneByteString(v8::Isolate*,
        char const*, int, v8::NewStringType)
        /work/node/out/../src/util-inl.h:166:10
    #6 node::(anonymous namespace)::CompressionStream<
        node::(anonymous namespace)::ZlibContext>
        ::EmitError(node::(anonymous namespace)
        ::CompressionError const&)
        /work/node/out/../src/node_zlib.cc:565:7
    #7 node::(anonymous namespace)::CompressionStream<
        node::(anonymous namespace)::ZlibContext>
        ::CheckError()
        /work/node/out/../src/node_zlib.cc:519:5
    #8 node::(anonymous namespace)::CompressionStream<
        node::(anonymous namespace)::ZlibContext>
        ::AfterThreadPoolWork(int)
        /work/node/out/../src/node_zlib.cc:543:10
    #9 node::ThreadPoolWork::ScheduleWork()
        ::'lambda'(uv_work_s*, int)
        ::operator()(uv_work_s*, int) const
        /work/node/out/../src/threadpoolwork-inl.h:57:15
    #10 node::ThreadPoolWork::ScheduleWork()
        ::'lambda'(uv_work_s*, int)
        ::__invoke(uv_work_s*, int)
        /work/node/out/../src/threadpoolwork-inl.h:48:7
    #11 uv__work_done /work/libuv-1.51.0/src/threadpool.c:330:5
    #12 uv__async_io.part.0
        /work/libuv-1.51.0/src/unix/async.c:208:5
```

Signed-off-by: ndossche <[email protected]>
PR-URL: #63476
Reviewed-By: Anna Henningsen <[email protected]>
aduh95 pushed a commit that referenced this pull request Jun 18, 2026
@ndossche @aduh95
src: fix edge case when deflateInit2() fails with Z_VERSION_ERROR
d82d369
This function call can fail with `Z_VERSION_ERROR` if the compiled
library vs loaded library mismatched in version number or in
stream structure size.
In those cases, zlib doesn't initialize the `strm_.msg` field to
null. Therefore, when a `CompressionError` object is created via
`ErrorForMessage()`, it can read a stale or uninitialized `strm_.msg`
pointer that will cause a crash.

Example ASAN report:
```
AddressSanitizer: SEGV on unknown address
    #0 __strlen_avx2
        string/../sysdeps/x86_64/multiarch/strlen-avx2.S:76
    #1 strlen (/work/node/out/Debug/node+0x1a42ab7)
    #2 v8::(anonymous namespace)::StringLength(char const*)
        /work/node/out/../deps/v8/src/api/api.cc:7581:16
    #3 v8::(anonymous namespace)::StringLength(unsigned char const*)
        /work/node/out/../deps/v8/src/api/api.cc:7587:10
    #4 v8::String::NewFromOneByte(v8::Isolate*,
        unsigned char const*, v8::NewStringType, int)
        /work/node/out/../deps/v8/src/api/api.cc:7677:3
    #5 node::OneByteString(v8::Isolate*,
        char const*, int, v8::NewStringType)
        /work/node/out/../src/util-inl.h:166:10
    #6 node::(anonymous namespace)::CompressionStream<
        node::(anonymous namespace)::ZlibContext>
        ::EmitError(node::(anonymous namespace)
        ::CompressionError const&)
        /work/node/out/../src/node_zlib.cc:565:7
    #7 node::(anonymous namespace)::CompressionStream<
        node::(anonymous namespace)::ZlibContext>
        ::CheckError()
        /work/node/out/../src/node_zlib.cc:519:5
    #8 node::(anonymous namespace)::CompressionStream<
        node::(anonymous namespace)::ZlibContext>
        ::AfterThreadPoolWork(int)
        /work/node/out/../src/node_zlib.cc:543:10
    #9 node::ThreadPoolWork::ScheduleWork()
        ::'lambda'(uv_work_s*, int)
        ::operator()(uv_work_s*, int) const
        /work/node/out/../src/threadpoolwork-inl.h:57:15
    #10 node::ThreadPoolWork::ScheduleWork()
        ::'lambda'(uv_work_s*, int)
        ::__invoke(uv_work_s*, int)
        /work/node/out/../src/threadpoolwork-inl.h:48:7
    #11 uv__work_done /work/libuv-1.51.0/src/threadpool.c:330:5
    #12 uv__async_io.part.0
        /work/libuv-1.51.0/src/unix/async.c:208:5
```

Signed-off-by: ndossche <[email protected]>
PR-URL: #63476
Reviewed-By: Anna Henningsen <[email protected]>
aduh95 pushed a commit that referenced this pull request Jun 25, 2026
@ndossche @aduh95
src: fix edge case when deflateInit2() fails with Z_VERSION_ERROR
2f4e596
This function call can fail with `Z_VERSION_ERROR` if the compiled
library vs loaded library mismatched in version number or in
stream structure size.
In those cases, zlib doesn't initialize the `strm_.msg` field to
null. Therefore, when a `CompressionError` object is created via
`ErrorForMessage()`, it can read a stale or uninitialized `strm_.msg`
pointer that will cause a crash.

Example ASAN report:
```
AddressSanitizer: SEGV on unknown address
    #0 __strlen_avx2
        string/../sysdeps/x86_64/multiarch/strlen-avx2.S:76
    #1 strlen (/work/node/out/Debug/node+0x1a42ab7)
    #2 v8::(anonymous namespace)::StringLength(char const*)
        /work/node/out/../deps/v8/src/api/api.cc:7581:16
    #3 v8::(anonymous namespace)::StringLength(unsigned char const*)
        /work/node/out/../deps/v8/src/api/api.cc:7587:10
    #4 v8::String::NewFromOneByte(v8::Isolate*,
        unsigned char const*, v8::NewStringType, int)
        /work/node/out/../deps/v8/src/api/api.cc:7677:3
    #5 node::OneByteString(v8::Isolate*,
        char const*, int, v8::NewStringType)
        /work/node/out/../src/util-inl.h:166:10
    #6 node::(anonymous namespace)::CompressionStream<
        node::(anonymous namespace)::ZlibContext>
        ::EmitError(node::(anonymous namespace)
        ::CompressionError const&)
        /work/node/out/../src/node_zlib.cc:565:7
    #7 node::(anonymous namespace)::CompressionStream<
        node::(anonymous namespace)::ZlibContext>
        ::CheckError()
        /work/node/out/../src/node_zlib.cc:519:5
    #8 node::(anonymous namespace)::CompressionStream<
        node::(anonymous namespace)::ZlibContext>
        ::AfterThreadPoolWork(int)
        /work/node/out/../src/node_zlib.cc:543:10
    #9 node::ThreadPoolWork::ScheduleWork()
        ::'lambda'(uv_work_s*, int)
        ::operator()(uv_work_s*, int) const
        /work/node/out/../src/threadpoolwork-inl.h:57:15
    #10 node::ThreadPoolWork::ScheduleWork()
        ::'lambda'(uv_work_s*, int)
        ::__invoke(uv_work_s*, int)
        /work/node/out/../src/threadpoolwork-inl.h:48:7
    #11 uv__work_done /work/libuv-1.51.0/src/threadpool.c:330:5
    #12 uv__async_io.part.0
        /work/libuv-1.51.0/src/unix/async.c:208:5
```

Signed-off-by: ndossche <[email protected]>
PR-URL: #63476
Reviewed-By: Anna Henningsen <[email protected]>
cs01 added a commit to cs01/node that referenced this pull request Jul 16, 2026
@cs01
painpoints: add nodejs#8 — extern struct layout is an unverified clai…
95b579b
…m, wrong offsets fail silently. affects every milo user of the feature, not just this port: compiler takes the layout on faith, a wrong field reads a neighbouring one and returns plausible garbage w/ no error. workaround (c _Static_assert) needs a c file most pure-milo users don't have. ranked fixes: docs -> #[c_layout] compiler-emitted guards (~1-2d, 90% of safety) -> @cImport (weeks). also note the same faith applies to 341 hand-written extern fn decls, and that unsafe deliberately doesn't cover either (tracks provenance, not layout/effects). mark nodejs#3 unsafe-lint resolved+shipped
aduh95 pushed a commit that referenced this pull request Jul 30, 2026
@ndossche @aduh95
src: fix edge case when deflateInit2() fails with Z_VERSION_ERROR
44976c6
This function call can fail with `Z_VERSION_ERROR` if the compiled
library vs loaded library mismatched in version number or in
stream structure size.
In those cases, zlib doesn't initialize the `strm_.msg` field to
null. Therefore, when a `CompressionError` object is created via
`ErrorForMessage()`, it can read a stale or uninitialized `strm_.msg`
pointer that will cause a crash.

Example ASAN report:
```
AddressSanitizer: SEGV on unknown address
    #0 __strlen_avx2
        string/../sysdeps/x86_64/multiarch/strlen-avx2.S:76
    #1 strlen (/work/node/out/Debug/node+0x1a42ab7)
    #2 v8::(anonymous namespace)::StringLength(char const*)
        /work/node/out/../deps/v8/src/api/api.cc:7581:16
    #3 v8::(anonymous namespace)::StringLength(unsigned char const*)
        /work/node/out/../deps/v8/src/api/api.cc:7587:10
    #4 v8::String::NewFromOneByte(v8::Isolate*,
        unsigned char const*, v8::NewStringType, int)
        /work/node/out/../deps/v8/src/api/api.cc:7677:3
    #5 node::OneByteString(v8::Isolate*,
        char const*, int, v8::NewStringType)
        /work/node/out/../src/util-inl.h:166:10
    #6 node::(anonymous namespace)::CompressionStream<
        node::(anonymous namespace)::ZlibContext>
        ::EmitError(node::(anonymous namespace)
        ::CompressionError const&)
        /work/node/out/../src/node_zlib.cc:565:7
    #7 node::(anonymous namespace)::CompressionStream<
        node::(anonymous namespace)::ZlibContext>
        ::CheckError()
        /work/node/out/../src/node_zlib.cc:519:5
    #8 node::(anonymous namespace)::CompressionStream<
        node::(anonymous namespace)::ZlibContext>
        ::AfterThreadPoolWork(int)
        /work/node/out/../src/node_zlib.cc:543:10
    #9 node::ThreadPoolWork::ScheduleWork()
        ::'lambda'(uv_work_s*, int)
        ::operator()(uv_work_s*, int) const
        /work/node/out/../src/threadpoolwork-inl.h:57:15
    #10 node::ThreadPoolWork::ScheduleWork()
        ::'lambda'(uv_work_s*, int)
        ::__invoke(uv_work_s*, int)
        /work/node/out/../src/threadpoolwork-inl.h:48:7
    #11 uv__work_done /work/libuv-1.51.0/src/threadpool.c:330:5
    #12 uv__async_io.part.0
        /work/libuv-1.51.0/src/unix/async.c:208:5
```

Signed-off-by: ndossche <[email protected]>
PR-URL: #63476
Reviewed-By: Anna Henningsen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@thlorenz @bnoordhuis @trevnorris @rvagg @nodejs-github-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.