#
557f0446 |
| 26-Apr-2023 |
Augustin Cavalier <waddlesplash@gmail.com> |
kernel: Introduce THREAD_BLOCK_TYPE_OTHER_OBJECT.
THREAD_BLOCK_TYPE_OTHER implies the "object" pointer in the wait information is a string. But sometimes we want to pass through objects which are no
kernel: Introduce THREAD_BLOCK_TYPE_OTHER_OBJECT.
THREAD_BLOCK_TYPE_OTHER implies the "object" pointer in the wait information is a string. But sometimes we want to pass through objects which are not strings, for inspection in KDL.
show more ...
|
#
2c588b03 |
| 06-Aug-2019 |
Augustin Cavalier <waddlesplash@gmail.com> |
kernel: Properly separate and handle THREAD_BLOCK_TYPE_USER.
Consider this scenario: * A userland thread puts its ID into some structure so that it can be woken up later, sets its wait_status to
kernel: Properly separate and handle THREAD_BLOCK_TYPE_USER.
Consider this scenario: * A userland thread puts its ID into some structure so that it can be woken up later, sets its wait_status to initiate the begin of the wait, and then calls _user_block_thread. * A second thread finishes whatever task the first thread intended to wait for, reads the ID almost immediately after it was written, and calls _user_unblock_thread. * _user_unblock_thread was called so soon that the first thread is not yet blocked on the _user_block_thread block, but is instead blocked on e.g. the thread's main mutex. * The first thread's thread_block() call returns B_OK. As in this example it was inside mutex_lock, it thinks that it now owns the mutex. * But it doesn't own the mutex, and so (until yesterday) all sorts of mayhem and then a random crash occurs, or (after yesterday) an assert-failure is tripped that the thread does not own the mutex it expected to.
The above scenario is not a hypothetical, but is in fact the exact scenario behind the strange panics in #15211.
The solution is to only have _user_unblock_thread actually unblock threads that were blocked by _user_block_thread, so I've introduced a new BLOCK_TYPE to differentiate these. While I'm at it, remove the BLOCK_TYPE_USER_BASE, which was never used (and now never will be.) If we want to differentiate different consumers of _user_block_thread for debugging purposes, we should use the currently-unused "object" argument to thread_block, instead of cluttering the relatively-clean block type debugging code with special types.
One final note: The race condition which was the case of this bug does not, in fact, imply a deadlock on the part of the rw_lock here. The wait_status is protected by the thread's mutex, which is acquired by both _user_block_thread and _user_unblock_thread, and so if _user_unblock_thread succeeds faster than _user_block_thread can initiate the block, it will just see that wait_status is already <= 0 and return immediately.
Fixes #15211.
show more ...
|
#
513403d4 |
| 15-Jun-2018 |
Augustin Cavalier <waddlesplash@gmail.com> |
Revert team and thread changes for COMPAT_MODE (hrev52010 & hrev52011).
This reverts commit c558f9c8fe54bc14515aa62bac7826271289f0e4. This reverts commit 44f24718b1505e8d9c75e00e59f2f471a79b5f56. Th
Revert team and thread changes for COMPAT_MODE (hrev52010 & hrev52011).
This reverts commit c558f9c8fe54bc14515aa62bac7826271289f0e4. This reverts commit 44f24718b1505e8d9c75e00e59f2f471a79b5f56. This reverts commit a69cb330301c4d697daae57e6019a307f285043e. This reverts commit 951182620e297d10af7fdcfe32f2b04d56086ae9.
There have been multiple reports that these changes break mounting NTFS partitions (on all systems, see #14204), and shutting down (on certain systems, see #12405.) Until they can be fixed, they are being backed out.
show more ...
|
#
95118262 |
| 20-May-2018 |
Jérôme Duval <jerome.duval@gmail.com> |
kernel/x86_64: setup a new team in compatibility mode.
* in load_image_internal(), elf32_load_user_image checks whether the binary format requires the compatibility mode. * we then set up the flag T
kernel/x86_64: setup a new team in compatibility mode.
* in load_image_internal(), elf32_load_user_image checks whether the binary format requires the compatibility mode. * we then set up the flag THREAD_FLAGS_COMPAT_MODE and the address space size. * the compatibility mode runtime_loader is hardcoded with x86/runtime_loader. * if needed, the 64-bit flat_args structure is converted in-place to its 32-bit layout. * a 32-bit flat_args isn't handled yet (a 32-bit team execs a 64-bit binary).
Change-Id: Ia6a066bde8d1774d85de29b48dc500e27ae9668f
show more ...
|
#
772568c4 |
| 16-Sep-2013 |
Pawel Dziepak <pdziepak@quarnos.org> |
system: Use B_PAGE_SIZE to define stack sizes
As korli suggested use B_PAGE_SIZE for defining stack size related definitions what seems to be more natural for them and also may help if we ever supp
system: Use B_PAGE_SIZE to define stack sizes
As korli suggested use B_PAGE_SIZE for defining stack size related definitions what seems to be more natural for them and also may help if we ever support an architecture with page size different than 4kB.
show more ...
|
#
228524af |
| 17-Sep-2013 |
François Revol <revol@free.fr> |
Merge branch 'master' into sam460ex
|
#
f06af2e2 |
| 16-Sep-2013 |
Pawel Dziepak <pdziepak@quarnos.org> |
system: Use B_PAGE_SIZE to define stack sizes
As korli suggested use B_PAGE_SIZE for defining stack size related definitions what seems to be more natural for them and also may help if we ever supp
system: Use B_PAGE_SIZE to define stack sizes
As korli suggested use B_PAGE_SIZE for defining stack size related definitions what seems to be more natural for them and also may help if we ever support an architecture with page size different than 4kB.
show more ...
|
#
25a7b01d |
| 05-May-2013 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
Merge branch 'master' into package-management
Additional changes: * Add src/system/kernel/lib/zlib, which builds a kernel version of zlib, needed by packagefs. * BuildFeatures: Add a build feature
Merge branch 'master' into package-management
Additional changes: * Add src/system/kernel/lib/zlib, which builds a kernel version of zlib, needed by packagefs. * BuildFeatures: Add a build feature "gcc2" to allow for easier checks. * Referenceable.cpp: Include <OS.h> instead of <debugger.h>. The latter is not needed and prevents building for the build platform. * zlib/zutil.h: Fix gcc 2 build. We really should use the external package instead.
Conflicts: .gitignore build/jam/BuildSetup build/jam/FileRules build/jam/FloppyBootImage build/jam/HaikuImage build/jam/ImageRules build/jam/KernelRules build/jam/NetBootArchive build/jam/OptionalBuildFeatures build/jam/OptionalLibPackages build/jam/OptionalPackageDependencies build/jam/OptionalPackages build/scripts/build_haiku_image configure data/bin/installoptionalpackage data/system/boot/Bootscript headers/os/app/Message.h headers/os/package/PackageInfo.h headers/os/package/PackageInfoAttributes.h headers/os/package/PackageInfoSet.h headers/os/package/PackageRoster.h headers/os/package/PackageVersion.h headers/os/package/hpkg/PackageInfoAttributeValue.h headers/os/storage/FindDirectory.h headers/os/storage/Node.h headers/os/support/StringList.h headers/private/system/directories.h src/add-ons/kernel/drivers/audio/ac97/es1370/Jamfile src/add-ons/kernel/file_systems/packagefs/AttributeIndex.cpp src/add-ons/kernel/file_systems/packagefs/Jamfile src/add-ons/kernel/file_systems/packagefs/Package.cpp src/add-ons/kernel/file_systems/packagefs/Package.h src/add-ons/kernel/file_systems/packagefs/PackageDomain.cpp src/add-ons/kernel/file_systems/packagefs/PackageDomain.h src/add-ons/kernel/file_systems/packagefs/PackageFSRoot.cpp src/add-ons/kernel/file_systems/packagefs/PackageLinkDirectory.cpp src/add-ons/kernel/file_systems/packagefs/PackageLinkDirectory.h src/add-ons/kernel/file_systems/packagefs/PackageLinkSymlink.cpp src/add-ons/kernel/file_systems/packagefs/PackageLinkSymlink.h src/add-ons/kernel/file_systems/packagefs/PackageLinksDirectory.cpp src/add-ons/kernel/file_systems/packagefs/PackageNode.h src/add-ons/kernel/file_systems/packagefs/ResolvableFamily.cpp src/add-ons/kernel/file_systems/packagefs/Version.cpp src/add-ons/kernel/file_systems/packagefs/Version.h src/add-ons/kernel/file_systems/packagefs/Volume.cpp src/add-ons/kernel/file_systems/packagefs/Volume.h src/add-ons/kernel/file_systems/packagefs/kernel_interface.cpp src/add-ons/kernel/file_systems/userlandfs/shared/driver_settings.c src/apps/deskbar/BarApp.cpp src/apps/deskbar/BarMenuBar.cpp src/apps/deskbar/BarMenuBar.h src/apps/deskbar/BarView.cpp src/apps/deskbar/BarView.h src/apps/deskbar/BarWindow.cpp src/apps/deskbar/BarWindow.h src/apps/deskbar/DeskbarMenu.cpp src/apps/deskbar/DeskbarMenu.h src/apps/deskbar/DeskbarUtils.cpp src/apps/deskbar/DeskbarUtils.h src/apps/deskbar/ExpandoMenuBar.cpp src/apps/deskbar/ExpandoMenuBar.h src/apps/deskbar/TeamMenu.cpp src/apps/processcontroller/ProcessController.cpp src/apps/remotedesktop/RemoteDesktop.cpp src/bin/bash/config-top.h src/bin/finddir.c src/bin/package/Jamfile src/bin/package/command_add.cpp src/bin/package/command_create.cpp src/bin/package/command_list.cpp src/bin/package_repo/command_list.cpp src/bin/pkgman/command_refresh.cpp src/build/libbe/support/Jamfile src/build/libpackage/Jamfile src/build/libroot/Jamfile src/build/libroot/fs.cpp src/build/libroot/remapped_functions.h src/kits/locale/MutableLocaleRoster.cpp src/kits/opengl/GLRendererRoster.cpp src/kits/package/PackageInfo.cpp src/kits/package/PackageInfoSet.cpp src/kits/package/PackageRoster.cpp src/kits/package/PackageVersion.cpp src/kits/package/RepositoryCache.cpp src/kits/package/hpkg/PackageWriterImpl.cpp src/kits/package/hpkg/ReaderImplBase.cpp src/kits/package/hpkg/WriterImplBase.cpp src/kits/print/PrintTransport.cpp src/kits/print/Printer.cpp src/kits/screensaver/ScreenSaverRunner.cpp src/kits/support/StringList.cpp src/kits/tracker/ContainerWindow.cpp src/kits/tracker/DeskWindow.cpp src/kits/tracker/PoseView.cpp src/libs/print/libprint/Transport.cpp src/preferences/printers/AddPrinterDialog.cpp src/preferences/screensaver/ScreenSaverWindow.cpp src/servers/debug/DebugServer.cpp src/servers/input/AddOnManager.cpp src/servers/media_addon/MediaAddonServer.cpp src/system/boot/Jamfile src/system/boot/loader/Jamfile src/system/boot/loader/loader.cpp src/system/boot/loader/vfs.cpp src/system/kernel/fs/vfs.cpp src/system/kernel/fs/vfs_boot.cpp src/system/libroot/os/find_directory.cpp src/system/runtime_loader/runtime_loader.cpp src/tools/package/Jamfile
show more ...
|
#
eecde8e3 |
| 20-Apr-2013 |
François Revol <revol@free.fr> |
Merge branch 'master' into sam460ex
|
#
46575667 |
| 17-Apr-2013 |
Pawel Dziepak <pdziepak@quarnos.org> |
Merge branch 'aslr'
|
#
3b4269ec |
| 25-Feb-2013 |
Pawel Dziepak <pdziepak@quarnos.org> |
arch: randomize initial user stack pointer
Inside the page randomization of initial user stack pointer is not only a part of ASLR implementation but also a performance improvement that helps elimina
arch: randomize initial user stack pointer
Inside the page randomization of initial user stack pointer is not only a part of ASLR implementation but also a performance improvement that helps eliminating aligned 64 kB data access.
Minimal user stack size is increased to 8 kB in order to ensure that regardless of initial stack pointer value there is still enough space on stack.
show more ...
|
#
28d17018 |
| 29-Dec-2012 |
François Revol <revol@free.fr> |
Merge branch 'master' into sam460ex
|
#
d1f280c8 |
| 01-Apr-2012 |
Hamish Morrison <hamishm53@gmail.com> |
Add support for pthread_attr_get/setguardsize()
* Added the aforementioned functions. * create_area_etc() now takes a guard size parameter. * The thread_info::stack_base/end range now refers to the
Add support for pthread_attr_get/setguardsize()
* Added the aforementioned functions. * create_area_etc() now takes a guard size parameter. * The thread_info::stack_base/end range now refers to the usable range only.
show more ...
|
#
24df6592 |
| 12-Jun-2011 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
Merged signals-merge branch into trunk with the following changes: * Reorganized the kernel locking related to threads and teams. * We now discriminate correctly between process and thread signals. S
Merged signals-merge branch into trunk with the following changes: * Reorganized the kernel locking related to threads and teams. * We now discriminate correctly between process and thread signals. Signal handlers have been moved to teams. Fixes #5679. * Implemented real-time signal support, including signal queuing, SA_SIGINFO support, sigqueue(), sigwaitinfo(), sigtimedwait(), waitid(), and the addition of the real-time signal range. Closes #1935 and #2695. * Gave SIGBUS a separate signal number. Fixes #6704. * Implemented <time.h> clock and timer support, and fixed/completed alarm() and [set]itimer(). Closes #5682. * Implemented support for thread cancellation. Closes #5686. * Moved send_signal() from <signal.h> to <OS.h>. Fixes #7554. * Lots over smaller more or less related changes.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42116 a95241bf-73f2-0310-859d-f6bbb57e9c96
show more ...
|
#
232fd3ba |
| 03-Sep-2008 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
Moved the wait type definitions to <thread_defs.h>. We're going to use them in userland, too.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27301 a95241bf-73f2-0310-859d-f6bbb57e9c96
|
#
57f2b5a0 |
| 05-Aug-2008 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
* Changed the meaning of the {KERNEL,USER}_STACK_SIZE macros to not include the guard pages. Adjusted the kernel and boot loader code accordingly -- the guard pages size is added/not removed resp
* Changed the meaning of the {KERNEL,USER}_STACK_SIZE macros to not include the guard pages. Adjusted the kernel and boot loader code accordingly -- the guard pages size is added/not removed respectively. The stack size passed to _kern_spawn_thread() is now the actually usable size, and it is no longer possible to specify a size smaller than or equal to the guard pages size. * vm_create_anonymous_area(): Precommit two pages maximum -- a stack with only one page usable size obviously doesn't need two pages.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26819 a95241bf-73f2-0310-859d-f6bbb57e9c96
show more ...
|
#
6b202f4e |
| 14-May-2008 |
Ingo Weinhold <ingo_weinhold@gmx.de> |
* Introduced new header directory headers/private/system which is supposed to contain headers shared by kernel and userland (mainly libroot). * Moved quite a few private kernel headers to the new l
* Introduced new header directory headers/private/system which is supposed to contain headers shared by kernel and userland (mainly libroot). * Moved quite a few private kernel headers to the new location. Split several kernel headers into a shared part and one that is still kernel private. Adjusted all affected Jamfiles and source in the standard x86 build accordingly. The build for other architectures and for test code may be broken. * Quite a bit of userland code still includes private kernel headers. Mostly those are <util/*> headers. The ones that aren't strictly kernel-only should be moved to some other place (maybe headers/private/shared/util).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25486 a95241bf-73f2-0310-859d-f6bbb57e9c96
show more ...
|