The sanity check of the physical_page_number can't work in many cases
since physical page ranges may be discontiguous. Instead what we should
check here is that the page structure address is at an expected offset
within the pages array, and print messages if it's not (and also don't
try to read the mappings linked list if it's not.)
This would have more easily caught the problem fixed in hrev57945:
the KDLs that commit fixed were "invalid concurrent access to page",
but with a very large "expected" number, indicating an overflow.
Change-Id: I784c183c2c146077ffe3c1dede2e54817bde52c7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8051
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
(cherry picked from commit e1c13f3ff7b700c20dde1e82febd5ada14b14330)
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8058
Add the area of the tab that just got removed from the stack
to the update (redraw) region so that it will be redrawn.
Fixes #16006, #18517
Change-Id: I5a26c353e2dd2e63f72440ddd0b522b52b02b2a2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8046
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: John Scipione <jscipione@gmail.com>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: X512 X512 <danger_mail@list.ru>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
(cherry picked from commit d35bcb118c183533f29733bfce1a29cf6fe8150f)
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8035
This avoids starting the clock at 00:00, just to jump to current time.
Change-Id: I911b60716ab60722e4ac38a3d597ab495fb5945d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8049
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
(cherry picked from commit 03766d494bea7e39b5a9114a445e8bf904976ff1)
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8033
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This is what AcquireStoreRef/ReleaseStoreRef are for. We don't use
VMVnodeCache here because that is a non-"temporary" cache that
writes its pages back to disk, while we need a store for the pages
that won't discard unmodified ones when memory is low.
Add a close() to the mmap_cut_tests, which triggers the case where
this is important (a file is unlinked, mmap'ed, and then the lone
FD referring to it is closed, triggering the file's deletion unless
the mmap also acquired a reference to the vnode.)
Fixes KDLs with Firefox test builds.
(cherry picked from commit c0a12a6b7d697382511ff36e7815aad6a379b3a7)
Change-Id: I589325966f7b8eb837750aea1f5adbdd94e06aeb
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8028
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
ramfs needs to create caches that are both temporary and unmergeable,
so add another flag to make this state possible.
Otherwise, mmap'ed files from ramfs might wind up in VMCache
trying to merge the caches when the last one is closed, which
we don't want.
(cherry picked from commit a8877df135c0395285945b11a75d57e10b7aecdf)
Change-Id: Iec9549f5f36207968e1502ce1a0d5fb9354f02d1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8027
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
If some (but not all) of the dependencies failed to load, they
will be in an inconsistent state (some NEEDED unset/uninitialized, etc.)
In order to neither leak this data nor have it cause problems later,
we should unload actually call unload_library() and thus put_image()
to have the unused/uninitialized dependencies be propery unloaded.
To make this work correctly, adjust unload_library to only call
the exit hooks if the initialization hooks were also called.
Fixes a crash in Firefox startup when some dependencies aren't installed.
(cherry picked from commit 1f1be520070165ce402b46d17a44a2941c0dda2f)
Change-Id: I75fb8bea779afed223c585399e85b4b8e10aa76e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8026
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
ScrollTo(index) was introduced only in 82bfaa954dcfd90582fb2c1a0e918971eea57091,
in the implementation of autoscroll-on-drag. But if we call the virtual
methods from here, subclasses might recurse back into us when calling
other methods (MouseMoved() in particular), so in order to avoid
an infinite recursion we have to call ourselves explicitly here.
Fixes a crash on drag in list views in WonderBrush.
Change-Id: Ie7a1bbb75161815bac1f5a800c9ba5830ac43a0f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8014
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: John Scipione <jscipione@gmail.com>
(cherry picked from commit 256f79af68e5c30d573c92abdde5cde7724e5733)
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8025
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Otherwise, we will leak random kernel values to userland, and
also have incorrect output in strace for anything that doesn't
have a 64-bit return value.
Fixes strace displaying return values on 32-bit x86.
Change-Id: Ibd6304bd989580f64b25f1505a5e02fb928dce84
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8013
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
(cherry picked from commit b261d68da291a88537e552007c5b7fd2d2e77249)
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8024
Let the compiler figure it out.
(cherry picked from commit 72be912bae8ccb93da9f217a6f4253ebe61d9c53)
Change-Id: I197863f84e02aa02606b980708946ed79070c8bd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8022
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
We shouldn't proceed to "wait" if we got errors back from "select",
but should just return the count of errors-reported-as-events
directly, or return the status if we can't report them that way.
Fixes libevent kqueue backend hanging forever on startup.
(cherry picked from commit 380ed24e115ca3169ca718412b3ddd3728fdda8d)
Change-Id: Ia725c74219139199db2dd8cf0dc29337bb97c4f8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8019
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
The "(request->Length() / B_PAGE_SIZE) + 2" calculation should suffice
for any physical_entry runs that we can actually use as unbounced I/O,
since all entries except the first and last must start and end on a
page boundary.
Also, use alloca() if the buffer length is small enough.
(cherry picked from commit a432595dc467fdeaef7b4bc1fc0c0731c65d0544)
Change-Id: I2e903d47932c67af4d82fea1e79ca84d615f8a7a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8018
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
FSCreateNewFolder(): Fix entry_ref of renamed file
* If FSMakeOriginalName() renames a file, because the file name
already exists, FSCreateNewFolder() needs to set the ref to the
new filename.
* Fix copy-suffix in FSCreateNewFolder(). The space comes before the dash: " -".
Before, you ended up with "File name- 2"
FSMakeOriginalName(): Make truncation localization aware
* In FSMakeOriginalName() don't hardcode the 4 characters of "copy" when
determine to truncate an overly long filename.
* Adjust comment in that regard + typo fixes.
* Localize default suffix " copy".
Change-Id: Ica880a8b831b321657f3f2d3825509b7fb9fe72d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7960
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
(cherry picked from commit e0a6acb74df485c3c574020ac283ba19907553b4)
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8017
When scanning a directory for fonts we also include its subdirectories.
Those may already be in the list and may even have been scanned before.
That happens in a typical setup, where the system fonts directory is
obviously included and then a subdirectory is added as part of the
default mappings.
See #18979
Change-Id: I92c6b7965aee030520402e2d53c4190fdca8b0e1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8001
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
(cherry picked from commit ff3924b325c3bac93868423dc7c5e9651dc5ec61)
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8016
Includes OpenSSL 3.0, Python 3.10, and more.
(cherry picked from commit 7dea48f378ea64a3dfdeba5f2f2bc9c80d2e0254)
Change-Id: Id029ee3b91baad503ea5b5c7cd2b6a5cf2054a32
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7986
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
- Rename the package in Jamfiles as appropriate (but don't rename the
build feature)
- Remove libnetapi SSL class (not needed anymore, OpenSSL now knows how
to use pthread functions directly and seed its random generator)
- Rename or remove a few other deprecated functions
Change-Id: I624833923e113a8235932d7ce8020bf27c6e2ea6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7717
(cherry picked from commit 6c59ed739ba2adcde633b55a9f829c8b48e7e9af)
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7984
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
The IORequest internally likes to deal with transferEndOffset
not transferredBytes because of sub-requests potentially being
prepared all at once (in some paths in the I/O scheduler),
thus fTransferSize can get incremented in Advance() before we have
actually executed that transfer.
But external consumers much prefer just knowing transferredBytes
not transferEndOffset. And many of them actually named their
variables that (or "bytesTransferred") and just passed the
transferEndOffset through to variables with that name! That's
obviously wrong, and it's surprising it wasn't discovered before now.
The problem was uncovered by repeated KDLs in PrecacheIO.
That method used the "bytesTransferred" value as a count of
pages transferred, which would then run past the end of the array
if the transfer start offset was not 0 (which the majority
of the time it would be, since this method gets called on
the first mmap() of a file, probably before any pages are read in.)
Most other consumers of this API did not check the value, it seems,
or otherwise had some mitigating factor that prevented it from
causing more problems. An exception is the page code, which
may have spuriously considered writes as successful when they
really weren't.
May fix some of the "invalid concurrent access to page" KDLs.
(cherry picked from commit 3ecbb34240d2f647222aa53ff0b5dca7f3873c33)
Change-Id: Id4f0e4cf96d44760691a533dbd82d95c8bc35e9f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7983
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
The Desktop instance is currently a singleton, and by the time it starts
the GlobalFontManager's initial scan is already running, so if we
register the user paths then it will spend a long time waiting for
the lock. GlobalFontManager didn't even use the provided UID,
so just move the add-user-paths logic into the constructor.
This helps with #18669 on systems that have the default fonts set
and no font settings file. (On systems that do, the global font
manager lock will be acquired in desktop settings initialization.)
(cherry picked from commit 4909eb2091b751e2cee8eac11ecabf3315544a99)
Change-Id: I682b2c524996a9fbb2ddc0c4c661fd27c71fcec5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7982
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This wasn't noticed until now because the IPv4 module would just
truncate packets to their actual length, but the extra data would
appear in packet captures.
(cherry picked from commit 27462aa0c7cc684a0d3ed2ee7797f60b9410c44c)
Change-Id: Ied9e42dbd104e85962f280424a17bb9fe0e96c03
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7981
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Otherwise we load and unload the SCSI module thousands of times,
which is expensive. It was only added to this section for virtio
in d3b108c53d151d7c0aab32c1562bca355462868b, so avoid scanning
it here except in that case.
Confirmed that virtio_scsi still works as a boot device.
While at it, remove an unused get_attr.
Change-Id: I0882fcb3465809d6bcdd8ed45e66a4dbfe91f7ac
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7965
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
(cherry picked from commit 58c9714921c8fd4d82f2217693241fb71b29ec3a)
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7980
EFI doesn't have a boot keys mechanism so we just disable the
routine that enables it entirely. Also disable it in early kernel
output before the settings file has been read.