-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
Undefined Behavior sanitizer: downcast is undefined behavior #26131
Comments
Note that what ubsan detects may not be an actual immediate problem. Rather it points to constructs that are undefined behavior in the C/C++ spec and may change in the future, e.g. when compilers change these behavior to enable better optimizations. |
I couldn’t get this to work locally (without using GN, admittedly), so there might be other issues with UBSAN, but #26139 should address this particular issue. |
Instructions for the GN build: mkdir node-ci
cd node-ci
fetch node-ci
cd node-ci
gclient sync
tools/gn-gen --ubsan-vptr out/Release
ninja -C out/Release node |
Okay – It does fix that issues, yes. :) There’s one other type of issue that pops up repeatedly when running the tests – luckily, there is a 4 year old Lines 20 to 22 in 611043c
Should be easy enough to address too, though. Edit: #26148 |
Introduce a second base class for `ReqWrap` that does not depend on a template parameter and move the `req_wrap_queue_` field to it. This addresses undefined behaviour that occurs when casting to `ReqWrap<uv_req_t>` in the `ReqWrap` constructor. Refs: nodejs#26131
Fixes: #26131 PR-URL: #26139 Reviewed-By: Yang Guo <[email protected]> Reviewed-By: Minwoo Jung <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
Introduce a second base class for `ReqWrap` that does not depend on a template parameter and move the `req_wrap_queue_` field to it. This addresses undefined behaviour that occurs when casting to `ReqWrap<uv_req_t>` in the `ReqWrap` constructor. Refs: #26131 PR-URL: #26148 Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: James M Snell <[email protected]>
Introduce a second base class for `ReqWrap` that does not depend on a template parameter and move the `req_wrap_queue_` field to it. This addresses undefined behaviour that occurs when casting to `ReqWrap<uv_req_t>` in the `ReqWrap` constructor. Refs: #26131 PR-URL: #26148 Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: James M Snell <[email protected]>
Fixes: #26131 PR-URL: #26139 Reviewed-By: Yang Guo <[email protected]> Reviewed-By: Minwoo Jung <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
Introduce a second base class for `ReqWrap` that does not depend on a template parameter and move the `req_wrap_queue_` field to it. This addresses undefined behaviour that occurs when casting to `ReqWrap<uv_req_t>` in the `ReqWrap` constructor. Refs: #26131 PR-URL: #26148 Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: James M Snell <[email protected]>
This is showing up when compiling with UBSan-Vptr:
The text was updated successfully, but these errors were encountered: