Commit Graph

11717 Commits

Author SHA1 Message Date
Muhammad Zahalqa
615ba0f368
AK: Fix overflow and mixed-signedness issues in binary_search() (#2961) 2020-08-02 21:10:35 +02:00
Brian Gianforcaro
2242f69cd6 Kernel: Use Userspace<T> in unveil syscall 2020-08-02 20:54:17 +02:00
Brian Gianforcaro
9db5a1b92f Kernel: Use Userspace<T> in sched_getparam syscall 2020-08-02 20:53:48 +02:00
Tom
f011c420c1 Kernel: Fix signal delivery when no syscall is made
This fixes a regression introduced by the new software context
switching where the Kernel would not deliver a signal unless the
process is making system calls. This is because the TSS no longer
updates the CS value, so the scheduler never considered delivery
as the process always appeared to be in kernel mode. With software
context switching we can just set up the signal trampoline at
any time and when the processor returns back to user mode it'll
get executed. This should fix e.g. killing programs that are
stuck in some tight loop that doesn't make any system calls and
is only pre-empted by the timer interrupt.

Fixes #2958
2020-08-02 20:50:29 +02:00
Brian Gianforcaro
6e54d0c072 AK: Remove relative_paths test from TestLexicalPath
This test appears to be testing functionality that doesn't
exist. Just remove it.

Closes old bug #2388

CC @bugaevc
2020-08-02 20:48:37 +02:00
Brian Gianforcaro
1f7c61b15f LibDebug: Disable and cleanup DebugSession breakpoints on destruction
Breakpoints need to be disabled before we detach from the debugee.

I noticed this while looking into the fact that if you continue
executing a program in sdb (/bin/ls) where you had previously
set a breakpoint, it would crash on sdb exit once the debugee died
with an assert on HashMap destruction where we were iterating
while clearing is set. This change also happens to fix this assert.
2020-08-02 19:26:58 +02:00
Matthew Olsson
81187c4ead LibWeb: Fix some SVG crashes/hangs
- parse_flag now only parses one digit instead of consuming an entirely
valid number
- match_number => match_coordinate
- match_coordinate now returns true if `ch()` is '.'
- parse_number no longer matches a +/-
- Don't crash when encountering one of the three unsupported path
commands. Instead, just skip them. No reason to crash the browser over a
silly SVG element :)
2020-08-02 19:16:40 +02:00
AnotherTest
97256ad977 ProtocolServer+LibTLS: Pipe certificate requests from LibTLS to clients
This makes gemini.circumlunar.space (and some more gemini pages) work
again :^)
2020-08-02 18:57:51 +02:00
AnotherTest
9d3ffa096a LibTLS: Add (basic) support for sending client certificates 2020-08-02 18:57:51 +02:00
AnotherTest
e54a5b7fb8 LibCrypto: Format the comments in ASN1/PEM.h correctly 2020-08-02 18:57:51 +02:00
Ben Wiederhake
3f2b78a063 Build: Build libstdc++ in parallel 2020-08-02 18:50:28 +02:00
Ben Wiederhake
cdcc09f63b Travis: 'configure' is too chatty for CI
./configure generates about 3500 lines in a few seconds. Noone will ever read
those lines and they make loading the Travis webpage slower. And if there is
ever a problem, it will be because the Travis base image changed (which happens
only rarely) in a way that interferes with compiling gcc (which is incredibly
unlikely), or we update gcc (which happens very rarely) and gcc doesn't like
the Travis iamge (which again is incredibly unlikely). In all of these cases,
finding the culprit will be self-evident.
2020-08-02 18:50:28 +02:00
Ben Wiederhake
32158c45e4 Travis: Extra safety, build Serenity in parallel
This won't have much impact, because it's *only* Serenity that will be built
in parallel. This should save about a minute.
2020-08-02 18:50:28 +02:00
Andreas Kling
7811cf3520 LibWeb: Implement the Element.contentEditable IDL attribute 2020-08-02 17:34:50 +02:00
Andreas Kling
07e13e9868 LibWeb: Only allow editing of elements with contenteditable="true"
We now respect the contenteditable HTML attribute and only let you
edit content inside explicitly editable elements.
2020-08-02 17:34:50 +02:00
Andreas Kling
8b16c61ff8 LibWeb: Add very basic backspace support to content editing 2020-08-02 17:34:50 +02:00
Andreas Kling
bc299754f6 LibWeb: Allow inserting text at the cursor by typing characters :^)
This works everywhere right now, but it's obviously not going to stay
that way forever. :^)

Note that this does not advance the cursor correctly for whitespace
since the cursor is DOM-based and doesn't take whitespace collapsing
into account yet.
2020-08-02 17:34:50 +02:00
Andreas Kling
2c679d0c8b LibWeb: Add a blinking text cursor :^)
Each Web::Frame now has a cursor that sits at a DOM::Position. It will
blink and look like a nice regular text cursor.

It doesn't really do anything yet, but it will eventually.
2020-08-02 17:34:50 +02:00
Andreas Kling
e496a74bb3 LibWeb: Add a basic DOM::Position class
This will be used for editable content. :^)
2020-08-02 17:34:50 +02:00
Ben Wiederhake
58240aedd9 Tests: License headers, clang-format, clearer output 2020-08-02 17:15:36 +02:00
Ben Wiederhake
29eceebdbf Tests: Build automatically, fix compilation errors 2020-08-02 17:15:36 +02:00
Tom
538b985487 Kernel: Remove ProcessInspectionHandle and make Process RefCounted
By making the Process class RefCounted we don't really need
ProcessInspectionHandle anymore. This also fixes some race
conditions where a Process may be deleted while still being
used by ProcFS.

Also make sure to acquire the Process' lock when accessing
regions.

Last but not least, there's no reason why a thread can't be
scheduled while being inspected, though in practice it won't
happen anyway because the scheduler lock is held at the same
time.
2020-08-02 17:15:11 +02:00
Tom
5bbf6ed46b Kernel: Fix some crashes due to missing locks
We need to hold m_lock when accessing m_regions.
2020-08-02 17:15:11 +02:00
Tom
728de56481 Kernel: Prevent recursive calls into the scheduler
Upon leaving a critical section (such as a SpinLock) we need to
check if we're already asynchronously invoking the Scheduler.
Otherwise we might end up triggering another context switch
as soon as leaving the scheduler lock.

Fixes #2883
2020-08-02 17:15:11 +02:00
Andreas Kling
a19304c9d6 Kernel: Remove a bunch of duplicate forward declarations 2020-08-02 11:01:00 +02:00
Andreas Kling
e526fa572a Kernel: Convert some more syscalls to Userspace<T>
These are really straightforward when all the helpers just work.
2020-08-02 11:01:00 +02:00
Andreas Kling
9bcf0b70cb AK: Hack Userspace<T> to not break Qt Creator syntax highlighting
This is a very cheesy patch and I don't like it, but as Qt Creator does
not grok C++20 concepts yet, this makes it possible to still use syntax
highlighting.

We'll remove this hack the moment it stops being a problem. Note that
it doesn't actually affect the build since we use GCC, not Clang.
2020-08-02 11:01:00 +02:00
Ben Wiederhake
597b0c9efd WindowServer: Redraw MenuApplets on add/delete 2020-08-02 11:00:50 +02:00
Brian Gianforcaro
2a74c59dec Kernel: Use Userspace<T> in pledge syscall 2020-08-02 10:56:43 +02:00
Brian Gianforcaro
ba4cf59d04 Kernel: Use Userspace<T> in setkeymap syscall 2020-08-02 10:56:33 +02:00
Brian Gianforcaro
e67d0c9eef LibKeyboard: Don't compile CharacterMap:set_system_map in kernel mode
In preparation for using Userspace<T> in Syscall::SC_setkeymap_params
remove the usage of SC_setkeymap_params from when compiling in kernel
mode. In kernel model we would need to do a bunch of explicit FlatPtr
cats to in order to get it to compile, and it's unused anyway, so just
avoid the pain.
2020-08-02 10:56:33 +02:00
Brian Gianforcaro
10e912d68c Kernel: Use Userspace<T> in sched_setparam syscall
Note: I switched from copying the single element out of the sched_param
struct, to copy struct it self as it is identical in functionality.
This way the types match up nicer with the Userpace<T> api's and it
conforms to the conventions used in other syscalls.
2020-08-02 10:55:38 +02:00
Brian Gianforcaro
1209bf82c1 Kernel: Use Userspace<T> in ptrace syscall 2020-08-02 00:29:04 +02:00
Luke
85b2413403 Themes: Hide title stripes on Redmond and Redmond 2000 2020-08-02 00:07:02 +02:00
Nico Weber
6dd10ad8dc Themes: Fix default theme window stripes and shadow after #2811
Change #2811 made window title stripes and window title shadow themable,
but it used the same stripe and shadow color for all window modes.
This is fine for the new 'basalt' theme which uses the same color
in all four window modes, but it changed the default theme so that
background windows had brown stripes and a brown shadow.

Instead, make the title stripe and title shadow themable per window mode,
and change the default theme to restore the colors it had before
change #2811: The title stripe color is the same as Border1 for all
window modes, and the title shadow is the same as the title stripe
darkened by 0.6.
2020-08-01 19:26:54 +02:00
AnotherTest
d366ad8232 PixelPaint: Make GenericConvolutionFilterInputDialog cancellable
Also tweaks the GUI to look a bit less...bad.
2020-08-01 17:44:40 +02:00
Ben Wiederhake
2074c9d66d LibC: Add tests for getenv, setenv, putenv 2020-08-01 16:46:04 +02:00
Ben Wiederhake
b4b39258ac LibC: setenv don't require 'overwrite' for non-existing value
Instead, require 'overwrite' only for already-existing values. I.e.,
require 'overwrite' only when overwriting.
2020-08-01 16:46:04 +02:00
Andreas Kling
3d5abae17b lsof: Fix some minor issues
Correct copyright year, fix a comment and add missing veil lock.
2020-08-01 16:30:19 +02:00
Andreas Kling
8d4d1c7457 Kernel: Use Userspace<T> in more syscalls 2020-08-01 11:37:40 +02:00
Emanuele Torre
6c1ba09fbd AK: In Userspace.h, #if defined(KERNEL) => #ifdef KERNEL 2020-08-01 10:44:42 +02:00
Emanuele Torre
5bf994d2d9 AK: Use C++20 concepts to only allow Userspace wrappers of pointers
It was a bit odd that you could create a Userspace<int> and that
Userspace<int>::ptr() returned an int instead of an int*.

Let's use C++20 concepts to only allow creating Userspace objects with
pointer types. :^)
2020-08-01 10:44:42 +02:00
Emanuele Torre
75a4b1a27e Build: Use -fconcepts flag to enable C++20 concepts. 2020-08-01 10:44:42 +02:00
Andreas Kling
dff8305138 UserspaceEmulator: Don't print backtrace offsets if we have file/line
File/line is way more interesting than offsets, so let's only do the
offsets if we don't have file/line information.
2020-08-01 09:49:03 +02:00
Andreas Kling
80eef2c014 UserspaceEmulator: Report heap buffer overflows :^) 2020-08-01 09:44:19 +02:00
Andreas Kling
030edbd513 UserspaceEmulator: Mark mmap regions as malloc blocks when mallocing
We don't have to be clever at all to figure out which MmapRegions are
malloc blocks, we can just mark the containing region as such when
the emulated process performs a malloc! :^)
2020-08-01 09:13:45 +02:00
Andreas Kling
5de7bae383 UserspaceEmulator: Forward errors from fork() correctly 2020-08-01 09:11:18 +02:00
AnotherTest
3455876976 Help: Optionally take an argument to search for 2020-08-01 08:39:26 +02:00
AnotherTest
21094b4725 Help: Add a search mode
This closes #2685, and brings some much needed nostalgia :^)
2020-08-01 08:39:26 +02:00
AnotherTest
6131417904 AK: Make MappedFile store why it is invalid
This makes AK::MappedFile save the errno either open() or mmap() failed
with.
2020-08-01 08:39:26 +02:00