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 — src: fix integer overflow in GetNow by apapirovski · Pull Request #22214 · nodejs/node

Conversation

@apapirovski

@apapirovski apapirovski commented Aug 9, 2018 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

Well, that was stupid... This check used to be for 0xfffffff which was wrong (one f too few) so that got fixed, but that change was made based on it being cast to a uint32_t (2**32-1) rather than the correct int32_t. Of course, Integer::New just happily accepted it despite not actually being able to handle it. Fun stuff...

Fixes #22149

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • documentation is changed or added
  • commit message follows commit guidelines

Sorry, something went wrong.

Uh oh!

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

bricss, ChALkeR, benjamingr, antsmartian, MatthewHerbst, stefan2904, lxe, merqurio, and j3bb9z reacted with thumbs up emoji parasyte reacted with confused emoji stefan2904 reacted with heart emoji
All reactions
  • 👍 9 reactions
  • 😕 1 reaction
  • ❤️ 1 reaction
@apapirovski
src: fix integer overflow in GetNow
3bb7fdf
@nodejs-github-bot

nodejs-github-bot commented Aug 9, 2018

Copy link
Copy Markdown
Collaborator

@apapirovski build started: https://ci.nodejs.org/blue/organizations/jenkins/node-test-pull-request-lite-pipeline/detail/node-test-pull-request-lite-pipeline/477/pipeline

All reactions

Sorry, something went wrong.

Uh oh!

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

@nodejs-github-bot nodejs-github-bot added the c++ Issues and PRs that require attention from people who are familiar with C++. label Aug 9, 2018
addaleax
addaleax approved these changes Aug 9, 2018
View reviewed changes
addaleax
addaleax reviewed Aug 9, 2018
View reviewed changes
Comment thread src/env.cc
@@ -617,7 +617,7 @@ Local<Value> Environment::GetNow() {
CHECK_GE(now, timer_base());
now -= timer_base();
if (now <= 0xffffffff)

@addaleax addaleax Aug 9, 2018

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this have an U suffix…?

Sorry, something went wrong.

Uh oh!

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

All reactions

@apapirovski apapirovski Aug 9, 2018

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It shouldn't matter in this case, right? I thought they were equivalent since this won't fit into an int and the next type is unsigned int.

Sorry, something went wrong.

Uh oh!

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

All reactions

@addaleax addaleax Aug 9, 2018

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I looked it up – without the suffix it is still signed, but it’s a long int in that case, so we’re probably fine here. :)

Sorry, something went wrong.

Uh oh!

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

All reactions
cjihrig
cjihrig approved these changes Aug 9, 2018
View reviewed changes
@apapirovski

apapirovski commented Aug 9, 2018

Copy link
Copy Markdown
Contributor Author

CI: https://ci.nodejs.org/job/node-test-pull-request/16298/

All reactions

Sorry, something went wrong.

Uh oh!

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

bmeck
bmeck approved these changes Aug 9, 2018
View reviewed changes
mmarchini
mmarchini approved these changes Aug 9, 2018
View reviewed changes
TimothyGu
TimothyGu approved these changes Aug 9, 2018
View reviewed changes
lpinca
lpinca approved these changes Aug 9, 2018
View reviewed changes
@ChALkeR

ChALkeR commented Aug 9, 2018 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

This was introduced in #18486 and shouldn't affect versions prior to 10.0.0, correct?

All reactions

Sorry, something went wrong.

Uh oh!

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

@ChALkeR ChALkeR added dont-land-on-v6.x timers Issues and PRs related to timers, setImmediate(), setInterval(), and setTimeout(). labels Aug 9, 2018
BridgeAR
BridgeAR approved these changes Aug 9, 2018
View reviewed changes
ChALkeR
ChALkeR approved these changes Aug 9, 2018
View reviewed changes
jasnell
jasnell approved these changes Aug 9, 2018
View reviewed changes
benjamingr
benjamingr approved these changes Aug 9, 2018
View reviewed changes
@maclover7 maclover7 added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Aug 10, 2018
trivikr
trivikr approved these changes Aug 12, 2018
View reviewed changes
@trivikr

trivikr commented Aug 12, 2018

Copy link
Copy Markdown
Member

Landed in 01a160a

ChALkeR, MatthewHerbst, and merqurio reacted with hooray emoji
All reactions
  • 🎉 3 reactions

Sorry, something went wrong.

Uh oh!

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

@trivikr trivikr closed this Aug 12, 2018
trivikr pushed a commit that referenced this pull request Aug 12, 2018
@apapirovski @trivikr
src: fix integer overflow in GetNow
01a160a
PR-URL: #22214
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Bradley Farias <[email protected]>
Reviewed-By: Matheus Marchini <[email protected]>
Reviewed-By: Tiancheng "Timothy" Gu <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Сковорода Никита Андреевич <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
targos pushed a commit that referenced this pull request Aug 12, 2018
@apapirovski @targos
src: fix integer overflow in GetNow
5b7419b
PR-URL: #22214
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Bradley Farias <[email protected]>
Reviewed-By: Matheus Marchini <[email protected]>
Reviewed-By: Tiancheng "Timothy" Gu <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Сковорода Никита Андреевич <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
@rvagg rvagg mentioned this pull request Aug 13, 2018
Release proposal: v10.9.0 #22295
Merged
@apapirovski
apapirovski deleted the fix-integer-overflow-timers branch August 15, 2018 14:46
This was referenced Aug 16, 2018
2018-08-15 Version 10.9.0 (Current) @rvagg beevelop/docker-android-nodejs#230
Closed
2018-08-15 Version 10.9.0 (Current) @rvagg beevelop/docker-nodejs#215
Closed
2018-08-15 Version 10.9.0 (Current) @rvagg beevelop/docker-android-nodejs#231
Closed
This was referenced Aug 16, 2018
2018-08-15 Version 10.9.0 (Current) @rvagg beevelop/docker-nodejs#216
Closed
2018-08-15 Version 10.9.0 (Current) @rvagg beevelop/docker-android-nodejs#232
Closed
2018-08-15 Version 10.9.0 (Current) @rvagg beevelop/docker-nodejs#217
Closed
2018-08-15 Version 10.9.0 (Current) @rvagg beevelop/docker-android-nodejs#233
Closed
2018-08-15 Version 10.9.0 (Current) @rvagg beevelop/docker-nodejs#218
Closed
2018-08-15 Version 10.9.0 (Current) @rvagg beevelop/docker-android-nodejs#234
Closed
2018-08-15 Version 10.9.0 (Current) @rvagg beevelop/docker-nodejs#219
Closed
@calzoneman calzoneman mentioned this pull request Aug 21, 2018
AssertionError at TLSWrap.onhandshakestart (_tls_wrap.js:66:3) #22240
Closed
@addaleax addaleax mentioned this pull request Aug 31, 2018
AssertionError in TLS module #22618
Closed
This was referenced Aug 31, 2018
Cronicle scheduler stops working after 2^31 milliseconds (~25 days) of continuous running jhuckaby/Cronicle#108
Closed
Paging "All Completed Jobs" in UI Fails jhuckaby/Cronicle#107
Open
@ziyunfei ziyunfei mentioned this pull request Sep 10, 2018
定时任务持续执行约 24 天后停止 eggjs/egg#2964
Closed
nkbt
nkbt reviewed Oct 9, 2018
View reviewed changes
Comment thread src/env.cc
@@ -617,7 +617,7 @@ Local<Value> Environment::GetNow() {
CHECK_GE(now, timer_base());
now -= timer_base();
if (now <= 0xffffffff)

@nkbt nkbt Oct 9, 2018

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean that the bug still exists for numbers in 2^31 .. 2^32 range?

Sorry, something went wrong.

Uh oh!

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

All reactions

@addaleax addaleax Oct 10, 2018

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nkbt This PR fixed the bug for those numbers – all others should remain the same

Sorry, something went wrong.

Uh oh!

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

All reactions

@nkbt nkbt Oct 10, 2018

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I was not sure if NewFromUnsigned does exactly that

Sorry, something went wrong.

Uh oh!

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

All reactions
firass111 pushed a commit to firass111/Project_node1 that referenced this pull request Apr 16, 2025
@apapirovski @rvagg
src: fix integer overflow in GetNow
82e71dd
PR-URL: nodejs/node#22214
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Bradley Farias <[email protected]>
Reviewed-By: Matheus Marchini <[email protected]>
Reviewed-By: Tiancheng "Timothy" Gu <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Сковорода Никита Андреевич <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@addaleax addaleax addaleax approved these changes
@ChALkeR ChALkeR ChALkeR approved these changes
@jasnell jasnell jasnell approved these changes
@benjamingr benjamingr benjamingr approved these changes
@lpinca lpinca lpinca approved these changes
@cjihrig cjihrig cjihrig approved these changes
@BridgeAR BridgeAR BridgeAR approved these changes
@trivikr trivikr trivikr approved these changes
+4 more reviewers
@nkbt nkbt nkbt left review comments
@bmeck bmeck bmeck approved these changes
@TimothyGu TimothyGu TimothyGu approved these changes
@mmarchini mmarchini mmarchini approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

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

Assignees

No one assigned

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. c++ Issues and PRs that require attention from people who are familiar with C++. timers Issues and PRs related to timers, setImmediate(), setInterval(), and setTimeout().

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

setInterval callback function unexpected halt

Uh oh!

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

15 participants

@apapirovski @nodejs-github-bot @ChALkeR @trivikr @nkbt @bmeck @jasnell @addaleax @benjamingr @lpinca @TimothyGu @cjihrig @mmarchini @BridgeAR @maclover7
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 01402775 — 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.