Skip to content
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

[GTK][WPE] CGroupMemoryController::getCgroupFileValue not stack if not numerical value is scanned from the file input (e.g: max) #28337

Conversation

psaavedra
Copy link
Contributor

@psaavedra psaavedra commented May 9, 2024

a5f69d0

[GTK][WPE] CGroupMemoryController::getCgroupFileValue not stack if not numerical value is scanned from the file input (e.g: max)
https://bugs.webkit.org/show_bug.cgi?id=273931

Reviewed by Carlos Alberto Lopez Perez.

Improves the CGroupMemoryController::getCgroupFileValue by ensuring it
handles non-numeric values (e.g., max).

Fixes TestNetworkProcessMemoryPressure API test (webkit.org/b/263016).

* Source/WebKit/UIProcess/linux/MemoryPressureMonitor.cpp:
(WebKit::CGroupMemoryController::getCgroupFileValue):
* Tools/TestWebKitAPI/glib/TestExpectations.json:

Canonical link: https://commits.webkit.org/278599@main

f8e9b61

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style βœ… πŸ›  ios βœ… πŸ›  mac βœ… πŸ›  wpe βœ… πŸ›  wincairo
βœ… πŸ§ͺ bindings βœ… πŸ›  ios-sim βœ… πŸ›  mac-AS-debug βœ… πŸ§ͺ wpe-wk2
βœ… πŸ§ͺ webkitperl βœ… πŸ§ͺ ios-wk2 βœ… πŸ§ͺ api-mac βœ… πŸ§ͺ api-wpe
βœ… πŸ§ͺ ios-wk2-wpt βœ… πŸ§ͺ mac-wk1 βœ… πŸ›  wpe-skia
βœ… πŸ§ͺ api-ios βœ… πŸ§ͺ mac-wk2 βœ… πŸ›  gtk
βœ… πŸ›  tv βœ… πŸ§ͺ mac-AS-debug-wk2 βœ… πŸ§ͺ gtk-wk2
βœ… πŸ›  tv-sim βœ… πŸ§ͺ mac-wk2-stress βœ… πŸ§ͺ api-gtk
βœ… πŸ›  πŸ§ͺ merge βœ… πŸ›  watch
βœ… πŸ›  watch-sim

@psaavedra psaavedra requested a review from a team as a code owner May 9, 2024 12:33
@psaavedra psaavedra self-assigned this May 9, 2024
@psaavedra psaavedra added the WebKit Misc. For miscellaneous bugs in the WebKit framework (and not JavaScriptCore or WebCore). label May 9, 2024
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label May 9, 2024
@psaavedra psaavedra removed the merging-blocked Applied to prevent a change from being merged label May 9, 2024
@psaavedra psaavedra force-pushed the eng/CGroupMemoryControllergetCgroupFileValue-not-stack-if-not-numerical-value-is-scanned-from-the-file-input-e-g-max branch from 454075d to f94a266 Compare May 9, 2024 12:42
@psaavedra psaavedra force-pushed the eng/CGroupMemoryControllergetCgroupFileValue-not-stack-if-not-numerical-value-is-scanned-from-the-file-input-e-g-max branch from f94a266 to 65ed88a Compare May 9, 2024 14:49
Comment on lines 443 to 445
int res = fscanf(file, "%" STRINGIFY(VALUE_BUFFER_SIZE) "[^\n]", rawValue);

if (res < 1)
Copy link
Contributor

Choose a reason for hiding this comment

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

the variable res is not really needed, we can check the return code from fscanf in the if() ifself

Copy link
Contributor Author

Choose a reason for hiding this comment

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

valid point. PR just updated according with this suggestion.

@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label May 9, 2024
@psaavedra psaavedra removed the merging-blocked Applied to prevent a change from being merged label May 9, 2024
@psaavedra psaavedra force-pushed the eng/CGroupMemoryControllergetCgroupFileValue-not-stack-if-not-numerical-value-is-scanned-from-the-file-input-e-g-max branch from 65ed88a to f8e9b61 Compare May 9, 2024 19:15
@psaavedra psaavedra added the merge-queue Applied to send a pull request to merge-queue label May 9, 2024
@webkit-commit-queue webkit-commit-queue added merging-blocked Applied to prevent a change from being merged and removed merge-queue Applied to send a pull request to merge-queue labels May 9, 2024
@psaavedra psaavedra added the safe-merge-queue Applied to automatically send a pull-request to merge-queue after passing EWS checks label May 9, 2024
@webkit-ews-buildbot webkit-ews-buildbot added merge-queue Applied to send a pull request to merge-queue and removed safe-merge-queue Applied to automatically send a pull-request to merge-queue after passing EWS checks labels May 9, 2024
@webkit-ews-buildbot
Copy link
Collaborator

Safe-Merge-Queue: Build #20331.

@psaavedra psaavedra added safe-merge-queue Applied to automatically send a pull-request to merge-queue after passing EWS checks and removed merging-blocked Applied to prevent a change from being merged merge-queue Applied to send a pull request to merge-queue labels May 10, 2024
@webkit-ews-buildbot webkit-ews-buildbot removed the safe-merge-queue Applied to automatically send a pull-request to merge-queue after passing EWS checks label May 10, 2024
@webkit-ews-buildbot
Copy link
Collaborator

Safe-Merge-Queue: Build #20353.

@webkit-ews-buildbot webkit-ews-buildbot added the merge-queue Applied to send a pull request to merge-queue label May 10, 2024
…t numerical value is scanned from the file input (e.g: max)

https://bugs.webkit.org/show_bug.cgi?id=273931

Reviewed by Carlos Alberto Lopez Perez.

Improves the CGroupMemoryController::getCgroupFileValue by ensuring it
handles non-numeric values (e.g., max).

Fixes TestNetworkProcessMemoryPressure API test (webkit.org/b/263016).

* Source/WebKit/UIProcess/linux/MemoryPressureMonitor.cpp:
(WebKit::CGroupMemoryController::getCgroupFileValue):
* Tools/TestWebKitAPI/glib/TestExpectations.json:

Canonical link: https://commits.webkit.org/278599@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/CGroupMemoryControllergetCgroupFileValue-not-stack-if-not-numerical-value-is-scanned-from-the-file-input-e-g-max branch from f8e9b61 to a5f69d0 Compare May 10, 2024 05:11
@webkit-commit-queue
Copy link
Collaborator

Committed 278599@main (a5f69d0): https://commits.webkit.org/278599@main

Reviewed commits have been landed. Closing PR #28337 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit a5f69d0 into WebKit:main May 10, 2024
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label May 10, 2024
@psaavedra psaavedra added the GLib Suggested Backport Suggest this merge request be backported to current WPE/GTK stable branch label May 10, 2024
@aperezdc
Copy link
Contributor

aperezdc commented May 10, 2024

Backported into the 2.44 branch as commit 4f68fd3

@aperezdc aperezdc removed the GLib Suggested Backport Suggest this merge request be backported to current WPE/GTK stable branch label May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WebKit Misc. For miscellaneous bugs in the WebKit framework (and not JavaScriptCore or WebCore).
Projects
None yet
6 participants