Commit graph

469 commits

Author SHA1 Message Date
Ali Mohammad Pur d7ba15371b Meta: Don't make wasm tests pass when they cannot read a module
Instead, just let them be treated as failing their respective test.
2021-06-04 16:07:42 +04:30
NonStandardModel c4c577b2bf Meta: Sort debug macros alphabetically 2021-06-03 18:44:45 +01:00
Ali Mohammad Pur 6b5d1eedcb Meta: Make the wasm test generator cast numbers to i32 when needed
Otherwise the sign would be out of whack
2021-06-02 16:09:16 +04:30
Ali Mohammad Pur 7fb458b7c9 Meta: Generate failing tests for unsupported assertions in wasm tests
Let's not ignore a test just because our test generator doesn't
understand it, assume the worst and generate a failing test case
instead.
2021-06-02 16:09:16 +04:30
Linus Groh 21a62fe836 Meta: Remove duplicated ensure_toolchain from serenity.sh 2021-06-02 00:34:41 +01:00
Jelle Raaijmakers 468bb54677 Meta: Make serenity.sh invoke cmake when build.ninja is missing 2021-06-01 11:33:56 +01:00
Max Wipfli 0d0ed4962f AK: Add a new, spec-compliant URLParser
This adds a new URL parser, which aims to be compliant with the URL
specification (https://url.spec.whatwg.org/). It also contains a
rudimentary data URL parser.
2021-06-01 09:28:05 +02:00
Nick Miller 10ba6f254c Kernel: Rename instances of IO port 0xe9 to BOCHS_DEBUG_PORT 2021-05-31 19:06:13 +01:00
Luke 3bc2527ce7 Lagom/Fuzzers: Add SQL parser fuzzer 2021-05-31 17:07:52 +04:30
Brian Gianforcaro 26cb64573c CMake: Hide KMALLOC_VERIFY_NO_SPINLOCK_HELD so folks don't find it
Since I introduced this functionality there has been a steady stream of
people building with `ALL_THE_DEBUG_MACROS` and trying to boot the
system, and immediately hitting this assert. I have no idea why people
try to build with all the debugging enabled, but I'm tired of seeing the
bug reports about asserts we know are going to happen at this point.

So I'm hiding this value under the new ENABLE_ALL_DEBUG_FACILITIES flag
instead. This is only set by CI, and hopefully no-one will try to build
with this thing (It's documented as not recommended).

Fixes: #7527
2021-05-31 11:30:47 +01:00
Gunnar Beutner 5f18cf75c5 AK: Replace ByteBuffer::grow with resize()/ensure_capacity()
Previously ByteBuffer::grow() behaved like Vector<T>::resize().
However the function name was somewhat ambiguous - and so this patch
updates ByteBuffer to behave more like Vector<T> by replacing grow()
with resize() and adding an ensure_capacity() method.

This also lets the user change the buffer's capacity without affecting
the size which was not previously possible.

Additionally this patch makes the capacity() method public (again).
2021-05-31 14:49:00 +04:30
Andreas Kling 33f2eeea4a pls: Drastically simplify this program
Since this program is setuid-root, it should be as simple as possible.

To that end, remove `/etc/plsusers` and use filesystem permissions to
achieve the same thing. `/bin/pls` is now only executable by `root` or
members of the `wheel` group.

Also remove all the logic that went to great lengths to `unveil()` a
minimal set of filesystem paths that may be used for the command.
The complexity-to-benefit ratio did not seem justified, and I think
we're better off keeping this simple.

Finally, remove pledge promises the moment they are no longer needed.
2021-05-30 23:09:37 +02:00
Edwin Hoksberg e68780e1ad WebServer: Put dbgln's behind WEBSERVER_DEBUG
These dbgln's caused excessive load in the WebServer process,
accounting for ~67% of the processing time when serving a webpage
with a bunch of resources like serenityos.org/happy/2nd/.
2021-05-30 17:41:56 +01:00
Ben Wiederhake 774107f37c Fuzz+LibGfx: When fuzzing GIFLoader, try to load all frames 2021-05-30 14:42:34 +01:00
Jesse Buhagiar d44e2c9ad9 Userland: Check sudoers file perms and owner in pls
As per comment found in #6319 by @bcoles, `pls` should check the
permissions and owner of the sudoers file to ensure that it hasn't
been compromised.
2021-05-29 22:33:12 +04:30
Jesse Buhagiar 82b48d867d Userland: Implement pls, a sudo clone 2021-05-29 22:33:12 +04:30
Andrew Kaster 3ece67d62d Meta/CI: Remove IRC notifications
With the increased volume of PRs being opened and merged lately,
multiple people have complained that the IRC is absolutely flooded with
SerenityBot posts. Remove the IRC notifications from the CI scripts, and
the Meta script that handles parsing the github actions context into
an IRC message.
2021-05-29 19:35:49 +02:00
Liav A c1a4dfeffb Kernel/Graphics: Remove unnecessary derived FramebufferDevice classes
It seems like overly-specific classes were written for no good reason.
Instead of making each adapter to have its own unique FramebufferDevice
class, let's generalize everything to keep implementation more
consistent.
2021-05-27 22:39:13 +02:00
Ali Mohammad Pur 0e4431af33 Meta: Run the Wasm spec tests in CI
Since LibWasm is still not capable of passing all of the spec tests,
ignore failing tests, only fail the build if some segfault/abort/etc
occurs.
2021-05-27 17:28:41 +04:30
Ali Mohammad Pur b2bd5132c4 Meta: Correctly parse numeric literals in wasm tests
This was previously parsing them as hex numbers, causing tests to fail.
With this fix, 88% of the generated tests are passing :^)
2021-05-27 17:28:41 +04:30
Max Wipfli a272c04c8a
Base: Make desktop shortcuts owned by anon (#7495)
This fixes #7492.
2021-05-27 08:52:46 +02:00
Gunnar Beutner a808fff2ec Revert "Revert "Kernel: Fix PCI layout of i440fx QEMU machine""
This reverts commit 72c097530f.

With that patch applied audio doesn't work anymore.

Fixes #7445.
2021-05-25 09:38:25 +02:00
Itamar b9021f8631 Meta: Exclude LibCpp&LanguageServer tests from check-newlines-at-eof.py 2021-05-22 15:52:11 +02:00
Liav A 72c097530f Revert "Kernel: Fix PCI layout of i440fx QEMU machine"
This reverts commit 5018b3b4b7.

Let's help our future selves by making sure we don't introduce a bug
because of duplicating a network interface name or related bug to this
topic. Therefore, we can have multiple e1000 devices in the system now.
2021-05-22 11:19:50 +01:00
Ali Mohammad Pur b808815e57 Meta: Display DistinctNumeric as its alias name in GDB if possible
All DistinctNumerics are given an identifying tag, if the tag is
generated by the macro, print the alias instead of DistinctNumeric.
2021-05-22 13:21:00 +04:30
Ali Mohammad Pur 3d0786f96b Meta: Add GDB pretty printer for AK::Variant 2021-05-22 13:21:00 +04:30
Ali Mohammad Pur 37651a28e1 Meta: Pretty-print the types in serenity_gdb.py
DistinctNumeric<T, ...> and some other types are very long, but the
template arguments provide no particular value, so just don't show them
2021-05-22 13:21:00 +04:30
Gunnar Beutner c3efae85f2 Games: Add Hearts 2021-05-21 23:38:18 +02:00
Liav A 5018b3b4b7 Kernel: Fix PCI layout of i440fx QEMU machine
Some folks on discord said adding another e1000 network adapter made it
so we don't have networking on the system anymore.
To fix this, we will use other unsupported PCI device instead.
2021-05-21 21:20:10 +02:00
Liav A f27e75ac0c Meta: Make i440fx QEMU machine PCI hierarchy a bit more complex
Let's help our future selves by ensuring we have proper support for
secondary PCI buses always.
2021-05-21 17:58:53 +01:00
Brian Gianforcaro bd1bdbe91b Meta: Add GDB pretty printer for AK::SinglyLinkedList 2021-05-21 15:23:01 +02:00
Brian Gianforcaro 0fbc5893bf Meta: Add GDB pretty printer for AK::InlineLinkedList
This allows a developer to easily dump a InlineLinkedList in the
debugger without having to manually running the list.
I needed this for a recent bug investigation in the Kernel.
2021-05-21 15:23:01 +02:00
Andrew Kaster a5889b9aad Shell: Hide job times behind SHELL_JOB_DEBUG flag 2021-05-21 12:05:34 +04:30
Ali Mohammad Pur 24b2a6c93a LibWasm+Meta: Implement instantiation/execution primitives in test-wasm
This also optionally generates a test suite from the WebAssembly
testsuite, which can be enabled via passing `INCLUDE_WASM_SPEC_TESTS`
to cmake, which will generate test-wasm-compatible tests and the
required fixtures.
The generated directories are excluded from git since there's no point
in committing them.
2021-05-21 00:15:23 +01:00
Ali Mohammad Pur b3c13c3e8a LibWasm+Meta: Add test-wasm and optionally test the conformance tests
This only tests "can it be parsed", but the goal of this commit is to
provide a test framework that can be built upon :)
The conformance tests are downloaded, compiled* and installed only if
the INCLUDE_WASM_SPEC_TESTS cmake option is enabled.
(*) Since we do not yet have a wast parser, the compilation is delegated
to an external tool from binaryen, `wasm-as`, which is required for the
test suite download/install to succeed.
This *does* run the tests in CI, but it currently does not include the
spec conformance tests.
2021-05-21 00:15:23 +01:00
Ali Mohammad Pur ba2fce14d3 Meta: Add a Wasm parser fuzzer 2021-05-21 00:15:23 +01:00
Andreas Kling 59fec42a25 StateMachineGenerator: Put output into the CMake build directory
Don't pollute the source directory with generated code.
2021-05-20 18:10:59 +02:00
Ali Mohammad Pur c6b12841ee Meta: Make generate_state_machine() generate a proper target
And use GENERATED_SOURCES (or add_dependencies) to make LibVT depend on
that target.
Fixes a FIXME.
2021-05-20 12:11:27 +01:00
Itamar 832e9c6e02 LibCpp: Add regression tests for the parser
For each .cpp file in the test suite data, there is a .ast file that
represents the "known good" baseline of the parser result.

Each .cpp file goes through the parser, and the result of
invoking `ASTNode::dump()` on the root node is compared to the
baseline to find regressions.

We also check that there were no parser errors when parsing the .cpp
files.
2021-05-19 23:19:07 +02:00
Itamar eeb98335d5 CppLanguageServer: Put cpp test files in /home/anon/cpp-tests/
This is similar to the LibJS test data that resides in
/home/anon/js-tests.
It's more convenient than storing the test programs as raw strings
in the code.
2021-05-19 23:19:07 +02:00
Ali Mohammad Pur f137c1bfaa LibJS+LibTest: Move out the test-js test runner into LibTest 2021-05-18 18:48:15 +01:00
stelar7 24c5b0e81c LibGfx: Add support for DDS images 2021-05-18 08:45:53 +01:00
Ali Mohammad Pur dfb2178519 Meta: Build LibWasm and the wasm utility as part of Lagom 2021-05-17 23:25:30 +02:00
Ali Mohammad Pur 056be42c0b LibWasm: Start implementing a naive bytecode interpreter
As the parser now flattens out the instructions and inserts synthetic
nesting/structured instructions where needed, we can treat the whole
thing as a simple parsed bytecode stream.
This currently knows how to execute the following instructions:
- unreachable
- nop
- local.get
- local.set
- {i,f}{32,64}.const
- block
- loop
- if/else
- branch / branch_if
- i32_add
- i32_and/or/xor
- i32_ne

This also extends the 'wasm' utility to optionally execute the first
function in the module with optionally user-supplied arguments.
2021-05-17 23:25:30 +02:00
Andreas Kling a15c7b7944 Build: Stop using precompiled headers (PCH)
This had very bad interactions with ccache, often leading to rebuilds
with 100% cache misses, etc. Ali says it wasn't that big of a speedup
in the end anyway, so let's not bother with it.

We can always bring it back in the future if it seems like a good idea.
2021-05-17 19:30:12 +02:00
Siddharth Kapoor dbd9d13857
Meta: Run 'du' with '--apparent-size', except on macOS
Fixes #7172.
2021-05-16 22:50:46 +01:00
Liav A 2e565f1b8a Meta: Update grub configuration to adopt the new textual boot mode 2021-05-16 19:58:33 +02:00
Liav A 20743e8aed Kernel/Graphics + SystemServer: Support text mode properly
As we removed the support of VBE modesetting that was done by GRUB early
on boot, we need to determine if we can modeset the resolution with our
drivers, and if not, we should enable text mode and ensure that
SystemServer knows about it too.

Also, SystemServer should first check if there's a framebuffer device
node, which is an indication that text mode was not even if it was
requested. Then, if it doesn't find it, it should check what boot_mode
argument the user specified (in case it's self-test). This way if we
try to use bochs-display device (which is not VGA compatible) and
request a text mode, it will not honor the request and will continue
with graphical mode.

Also try to print critical messages with mininum memory allocations
possible.

In LibVT, We make the implementation flexible for kernel-specific
methods that are implemented in ConsoleImpl class.
2021-05-16 19:58:33 +02:00
Liav A cc92538d49 Kernel/Graphics: Add basic support for Intel native accelerator
We simply modeset the resolution after determining the preferred
resolution after getting the EDID from the attached display.
2021-05-16 19:58:33 +02:00
Liav A 8515a1c49d Meta: Boot the Q35 machine without VGA support
Use the bochs-display device instead :)
2021-05-16 19:58:33 +02:00