Commit graph

24892 commits

Author SHA1 Message Date
Thomas Wagenveld
9222064439 Documentation: Remove more potentially harmful Debian advice
Serenity build tooling autodetects gcc 10 so update-alternatives
is not necessary. Also, switching apt repositories on the fly can
cause issues with dependencies, package downgrades and leave the
system in a broken state.
2021-07-30 23:51:10 +02:00
Gunnar Beutner
dff8b3d2d9 Meta: Make rsync a hard dependency and remove the fallback code
Previously we'd fall back to using cp if rsync wasn't available. Not
only is this considerably slower it also breaks when some of the files
in the target directory are symlinks because cp tries to dereference
them.

Fixes #8672.
2021-07-30 23:50:29 +02:00
Linus Groh
9ea8aa7ffe LibJS/Tests: Compare results in Temporal.Now.plainDateTimeISO() test 2021-07-30 22:13:13 +01:00
Linus Groh
2c85f076c8 LibJS/Tests: Compare results in Temporal.Now.plainDateTime() test 2021-07-30 22:13:13 +01:00
Timothy Flynn
b3569fab7c LibJS: Add tests for Unicode property escapes
LibJS gets this for free from LibRegex, but let's add test cases for it.
2021-07-30 21:26:31 +01:00
Timothy Flynn
d485cf29d7 LibRegex+LibUnicode: Begin implementing Unicode property escapes
This supports some binary property matching. It does not support any
properties not yet parsed by LibUnicode, nor does it support value
matching (such as Script_Extensions=Latin).
2021-07-30 21:26:31 +01:00
Timothy Flynn
f1dd770a8a LibJS: Parse RegExp literals at AST creation time, not execution time
The spec requires that invalid RegExp literals must cause a Syntax Error
before the JavaScript is executed. See:
https://tc39.es/ecma262/#sec-patterns-static-semantics-early-errors

This is explicitly tested in the RegExp/property-escapes test262 tests.
For example, see unsupported-property-Line_Break.js:

    $DONOTEVALUATE();
    /\p{Line_Break}/u;

That RegExp literal is invalid because Line_Break is not a supported
Unicode property. $DONOTEVALUATE() just throws an exception when it is
executed. The test expects that this file will fail to be parsed.

Note that RegExp patterns can still be parsed at execution time by way
of "new RegExp(...)".
2021-07-30 21:26:31 +01:00
Timothy Flynn
1400e3cf58 LibRegex: Allow separately parsing patterns and creating Regex objects
Adds a static method to parse a regex pattern and return the result, and
a constructor to accept a parse result. This is to allow LibJS to parse
the pattern string of a RegExpLiteral once and hand off regex objects
any number of times thereafter.
2021-07-30 21:26:31 +01:00
Timothy Flynn
b162517065 LibRegex: Take ownership of pattern string and fix move operations
The Regex object created a copy of the pattern string anyways, so tweak
the constructor to allow callers to move() pattern strings into the
regex.

The Regex move constructor and assignment operator currently result in
memory corruption. The Regex object stores a Matcher object, which holds
a reference to the Regex object. So when the Regex object is moved, that
reference is no longer valid. To fix this, the reference stored in the
Matcher must be updated when the Regex is moved.
2021-07-30 21:26:31 +01:00
Timothy Flynn
4a72b2c879 LibRegex: Allow RegexOptions to be declared at compile time 2021-07-30 21:26:31 +01:00
Timothy Flynn
f1809db994 LibUnicode: Add public methods to compare and lookup Unicode properties
Adds methods to retrieve a Unicode property from a string and to check
if a code point matches a Unicode property.

Also adds a <LibUnicode/Forward.h> header.
2021-07-30 21:26:31 +01:00
Timothy Flynn
3f80791ed5 LibUnicode: Manually assign special code point properties
The Unicode standard defines a few extra properties that are not defined
in any UCD file, so we must assign them manually.
2021-07-30 21:26:31 +01:00
Timothy Flynn
bba3152104 LibUnicode: Parse and generate PropertyAliases
These are all used for Unicode property escapes.
2021-07-30 21:26:31 +01:00
Timothy Flynn
761c16d873 LibUnicode: Parse and utilize DerivedCoreProperties
DerivedCoreProperties are pseudo-properties that are the union of other
categories and properties. For example, the derived property Math is the
union of the general category Sm and the property Other_Math.

Parsing these is necessary for implementing Unicode property escapes.
But it also has the added benefit that LibUnicode now does not need to
derive some of these properties at runtime.
2021-07-30 21:26:31 +01:00
Timothy Flynn
4eb4b06688 LibUnicode: Do not replace underscores in property names
Originally, this was done to make the generated enums look more like the
rest of Serenity's enums. But for Unicode property escapes, LibUnicode
will need to compare property names from a RegExp.prototype object to
these parsed property names, which will be easier without this
modification.
2021-07-30 21:26:31 +01:00
Timothy Flynn
5d09a00189 LibUnicode: Generate PropList enumeration as a bitmask
Rather than generating the PropList as a list of enums, generate it as
a bitmask. Not only will this be better for runtime property searching,
this will allow parsing of the DerivedCoreProperties list more easily.
2021-07-30 21:26:31 +01:00
Linus Groh
116c45d668 LibJS: Take prepare_temporal_fields() Vector arguments by const& 2021-07-30 20:52:39 +01:00
Brian Gianforcaro
a4dc1eb330 Lagom: Fix oss-fuzz build error due to CMake typo
The OSS-Fuzz build was failing with the following error:

 /usr/bin/ld: cannot find -l{}
2021-07-30 20:28:59 +01:00
Linus Groh
4d0f849654 LibJS: Replace TypeError with RangeError in GetOffsetNanosecondsFor
Also fix "a integral number" => "an integral number".
2021-07-30 19:53:25 +01:00
Sam Atkins
59a4e87a7e Documentation: Add BuildProfilingInstructions.md
After discussing on Discord about how to speed up the build time, I
received lots of helpful advice on measuring the build time, but none of
it was easily accessible. I thought other people might find it useful,
so I've written it down! :^)

Thanks goes to @bgianfo and @nico.
2021-07-30 20:51:11 +02:00
Luke
4ca14d6e67 Ports: Update OpenSSL to 1.1.1k 2021-07-30 20:49:56 +02:00
Luke
f5d4de8b66 LibC: Stub mlock in sys/mman
mlock is supposed to prevent memory from being paged out to swap, which
we don't have currently.

Required by OpenSSL.
2021-07-30 20:49:56 +02:00
Martin Blicha
add3a02ddd LibChess: Fix hashing of the chess board
The hash function should take the board by reference, not by value.
Also, the fact whether black can castle kingside or not was included
twice in the hash, unnecesarily.
2021-07-30 20:49:18 +02:00
Faeliore
8e3431d56d MailSettings: Add basic mail settings dialog
MailSettings: Add a GML file for Mail settings

MailSettings: Add an AF desktop file for Mail Settings

MailSettings: Unveil /res in mail settings, fix GML

MailSettings: Mail settings texteditor->textbox

MailSettings: Update mail username to correct category in settings

Modified Mail settings GML to properly represent ports >100

MailSettings: Update/fix mail settings GML

MailSettings: Adjust GML, add icons for mail settings

MailSettings: Change Okay button to OK

MailSettings: Change mail setting reset button to revert

MailSettings: Fix incorrect variable names in mail settings

MailSettings: Add newlines af EOF of all mail setting files

MailSettings: Mail settings linting issues fixed

MailSettings: Increase size of icon features
Code cleaning/styling changes as per gunnarbeutner review
Made settings descriptions more friendly per sin-ack review

MailSettings: Fixes as per PR comments

MailSettings: Fix checkbox weirdness

MailSettings: Adjust width of checkbox

MailSettings: Remove unneccessary update() call

MailSettings: Replace port SpinBox with ComboBox

MailSettings: Add colons to labels, remove port 110 option

MailSettings: Remove custom model, use ItemListModel

MailSettings: Change relative icon paths to absolute ones
2021-07-30 20:47:31 +02:00
Thomas Wagenveld
1bfd405353 Documentation: Update instructions for Debian
Simply adding a 'testing' repo on a Debian stable system is destructive
to the system. Add better hints on building Serenity on Debian.
2021-07-30 19:00:46 +02:00
Brian Gianforcaro
7fce0693a5 Prekernel: Disable KASAN, so it has no effect when enabled
I was working on some more KASAN changes and realized the system
no longer links when passing -DENABLE_KERNEL_ADDRESS_SANITIZER=ON.

Prekernel will likely never have KASAN support given it's limited
environment, so just suppress it's usage.
2021-07-30 16:58:09 +02:00
Andreas Kling
25b76462bf Revert "Kernel: Share committed COW pages between whole VMObject lineage"
This reverts commit 2c0df5e7e7.

This caused OOM on CI, so let's roll it back until we can figure it out.
2021-07-30 13:50:24 +02:00
Sam Atkins
5de7775d22 Browser: Show a message when attempting to search with no search engine
Previously, it just showed an error message saying that "" failed to
load, which made me think that search engines were broken.
2021-07-30 13:38:20 +02:00
FrHun
c88756078a LibGfx: Refactor Point.constrain to use AK 2021-07-30 13:21:27 +02:00
FrHun
cc829ed9d2 LibGui: Add bounding of rubber band to IconView
This ensures the selection rubber band in icon views stays within the
visible area.
2021-07-30 13:21:27 +02:00
Andreas Kling
2c0df5e7e7 Kernel: Share committed COW pages between whole VMObject lineage
When cloning an AnonymousVMObject, committed COW pages are shared
between the parent and child object. Whicever object COW's first will
take the shared committed page, and if the other object ends up doing
a COW as well, it will notice that the page is no longer shared by
two objects and simple remap it as read/write.

When a child is COW'ed again, while still having shared committed
pages with its own parent, the grandchild object will now join in the
sharing pool with its parent and grandparent. This means that the first
2 of 3 objects that COW will draw from the shared committed pages, and
3rd will remap read/write.

Previously, we would "fork" the shared committed pages when cloning,
which could lead to a situation where the grandparent held on to 1 of
the 3 needed shared committed pages. If both the child and grandchild
COW'ed, they wouldn't have enough pages, and since the grandparent
maintained an extra +1 ref count on the page, it wasn't possible to
to remap read/write.
2021-07-30 13:17:55 +02:00
Andreas Kling
bccdc08487 Kernel: Unmapping a non-mapped region with munmap() should be a no-op
Not a regression per se from 0fcb9efd86
since we were crashing before that which is obviously worse.
2021-07-30 13:16:55 +02:00
Brian Gianforcaro
c9395d7e9a Tests: Validate unmapping 0x0 doesn't crash the Kernel
Previously unmapping any offset starting at 0x0 would assert in the
kernel, add a regression test to validate the fix.

Co-authored-by: Federico Guerinoni <guerinoni.federico@gmail.com>
2021-07-30 11:28:55 +02:00
Brian Gianforcaro
0fcb9efd86 Kernel: Return an error when unmap finds no intersecting region
We currently always crash if a user attempts to unmap a range that
does not intersect with an existing region, no matter the size. This
happens because we will never explicitly check to see if the search
for intersecting regions found anything, instead loop over the results,
which might be an empty vector. We then attempt to deallocate the
requested range from the `RangeAllocator` unconditionally, which will
be invalid if the specified range is not managed by the RangeAllocator.
We will assert validating m_total_range.contains(..) the range we are
requesting to deallocate.

This fix to this is straight forward, error out if we weren't able to
find any intersections.

You can get stress-ng to attempt this pattern with the following
arguments, which will attempt to unmap 0x0 through some large offset:

```
stress-ng --vm-segv 1
```

Fixes: #8483

Co-authored-by: Federico Guerinoni <guerinoni.federico@gmail.com>
2021-07-30 11:28:55 +02:00
Linus Groh
e7c5c3d507 LibJS: Implement Temporal.PlainTime.prototype.getISOFields() 2021-07-30 09:41:11 +01:00
Linus Groh
c7bef42975 LibJS: Implement Temporal.PlainDate.prototype.getISOFields() 2021-07-30 09:41:11 +01:00
Luke
dc34cbe28b Ports: Update curl to 7.78.0 2021-07-30 10:23:33 +02:00
Karol Kosek
c126ffa9b8 LibGfx: Use correct variable size on bitmap to buffer convertion
The issue was that size_in_bytes() returns size_t, but the buffer used
a size of the unsigned for itself, which only matched on 32-bit
systems and caused an assert error otherwise.

This fixes a crash on drag in FileManager on non 32-bit systems!
2021-07-30 10:14:07 +02:00
Idan Horowitz
d1ee31c5de LibJS: Implement Temporal.PlainTime.prototype.toPlainDateTime 2021-07-29 22:47:56 +01:00
Idan Horowitz
8f9b4a5ea6 LibJS: Implement Temporal.PlainDateTime.prototype.inLeapYear 2021-07-29 22:47:56 +01:00
Idan Horowitz
b9ed19c850 LibJS: Implement Temporal.PlainDateTime.prototype.monthsInYear 2021-07-29 22:47:56 +01:00
Idan Horowitz
fb5c0ed0d0 LibJS: Implement Temporal.PlainDateTime.prototype.daysInYear 2021-07-29 22:47:56 +01:00
Idan Horowitz
2d86cbae45 LibJS: Implement Temporal.PlainDateTime.prototype.daysInMonth 2021-07-29 22:47:56 +01:00
Idan Horowitz
01d33174c8 LibJS: Implement Temporal.PlainDateTime.prototype.daysInWeek 2021-07-29 22:47:56 +01:00
Idan Horowitz
d4e9d572f5 LibJS: Implement Temporal.PlainDateTime.prototype.weekOfYear 2021-07-29 22:47:56 +01:00
Idan Horowitz
0800c2a958 LibJS: Implement Temporal.PlainDateTime.prototype.dayOfYear 2021-07-29 22:47:56 +01:00
Idan Horowitz
c41b7b27c9 LibJS: Implement Temporal.PlainDateTime.prototype.dayOfWeek 2021-07-29 22:47:56 +01:00
Idan Horowitz
518a9f3eab LibJS: Implement Temporal.PlainDateTime.prototype.nanosecond 2021-07-29 22:47:56 +01:00
Idan Horowitz
23bf840326 LibJS: Implement Temporal.PlainDateTime.prototype.microsecond 2021-07-29 22:47:56 +01:00
Idan Horowitz
b2f66a06ac LibJS: Implement Temporal.PlainDateTime.prototype.millisecond 2021-07-29 22:47:56 +01:00