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

Fixes for SerenityOS #689

Closed
wants to merge 2 commits into from
Closed

Fixes for SerenityOS #689

wants to merge 2 commits into from

Conversation

linusg
Copy link
Contributor

@linusg linusg commented Dec 15, 2024

See commit messages and #688 for details.

@ivmai
Copy link
Owner

ivmai commented Dec 15, 2024

Okay, looks good, except for the comment regarding MPROTECT_VDB! I will process the PR in several day.
Meanwhile, I recommend you to go ahead and modify https://github.com/SerenityOS/serenity/blob/master/Ports/bdwgc/patches/0001-Teach-os_dep-and-gcconfig.h-about-serenity.patch

This causes a null pointer dereference crash when building without
SMALL_CONFIG.

See: ivmai#688
@linusg
Copy link
Contributor Author

linusg commented Dec 15, 2024

Meanwhile, I recommend you to go ahead and modify

I would prefer the next port update to be dropping serenity's patches altogether, happy to wait for this PR to be merged first :)

ivmai pushed a commit that referenced this pull request Dec 20, 2024
(fix of commit b48ee2b)

PR #689 (bdwgc).

As of now, Serenity OS only supports `MADV_SET_VOLATILE` and
`MADV_SET_NONVOLATILE` as `advice` argument to `madvise()`.  The later
returns `EINVAL` for other `advice` values (including `MADV_DONTNEED`).

* os_dep.c [USE_MUNMAP && !USE_WINALLOC && !SN_TARGET_PS3 && SERENITY]
(block_unmap_inner): Call `mmap(PROT_NONE)` instead of
`mprotect(PROT_NONE)` and `madvise(MADV_DONTNEED)`.
ivmai pushed a commit that referenced this pull request Dec 20, 2024
(fix of commit b48ee2b)

PR #689 (bdwgc).

For an unknown reason, enabling of incremental mode based on `mprotect`
causes a null pointer dereference in `GC_finish_collection()`.

This patch removes `define MPROTECT_VDB` for Serenity OS.

* include/private/gcconfig.h [SERENITY] (MPROTECT_VDB): Do not define.
* os_dep.c [MPROTECT_VDB && !DARWIN && !MSWIN32 && !MSWINCE
&& SERENITY] (CODE_OK): Likewise.
* os_dep.c [MPROTECT_VDB && !DARWIN && !USE_WINALLOC && !AIX
&& !CYGWIN32 && !HAIKU]: Include `sys/syscall.h` regardless of
`SERENITY`.
@ivmai
Copy link
Owner

ivmai commented Dec 20, 2024

Merged. Please test.

@ivmai ivmai closed this Dec 20, 2024
@linusg linusg deleted the serenity-fixes branch December 20, 2024 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants