Bug 240292 - [LIBPAS] Add extra assert information to malloc enumeration API
Summary: [LIBPAS] Add extra assert information to malloc enumeration API
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Justin Michaud
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-05-10 15:59 PDT by Justin Michaud
Modified: 2022-05-15 19:44 PDT (History)
2 users (show)

See Also:


Attachments
Patch (10.65 KB, patch)
2022-05-10 16:00 PDT, Justin Michaud
no flags Details | Formatted Diff | Diff
Patch (11.01 KB, patch)
2022-05-10 16:41 PDT, Justin Michaud
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Justin Michaud 2022-05-10 15:59:42 PDT
[LIBPAS] Add extra assert information to malloc enumeration API
Comment 1 Justin Michaud 2022-05-10 16:00:16 PDT
Created attachment 459138 [details]
Patch
Comment 2 Yusuke Suzuki 2022-05-10 16:05:50 PDT
Comment on attachment 459138 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=459138&action=review

r=me with comments.

> Source/bmalloc/ChangeLog:7
> +

Can you describe what is extra compared to PAS_ASSERT_WITH_DETAIL in ChangeLog? (feature putting values to specific registers before crashing etc.).
And let's also mention to PAS_DEBUG_LOG_TO_SYSLOG's extension.

> Source/bmalloc/libpas/src/libpas/pas_log.c:97
> +#pragma clang diagnostic push
> +#pragma clang diagnostic ignored "-Wformat-nonliteral"

Use `PAS_IGNORE_WARNINGS_BEGIN("format-nonliteral")`

> Source/bmalloc/libpas/src/libpas/pas_log.c:99
> +#pragma clang diagnostic pop

Put PAS_IGNORE_WARNINGS_END

> Source/bmalloc/libpas/src/libpas/pas_utils.c:94
> +        pas_crash_with_info_impl((uint64_t) format, 0, 0, 0, 0, 0, 0);

Let's remove space between (uint64_t) format

> Source/bmalloc/libpas/src/libpas/pas_utils.c:110
> +    pas_crash_with_info_impl((uint64_t) filename, line, (uint64_t) function, (uint64_t) expression, 0xbeefbff0, 42, 1337);

Ditto.

> Source/bmalloc/libpas/src/libpas/pas_utils.c:117
> +    pas_crash_with_info_impl((uint64_t) filename, line, (uint64_t) function, (uint64_t) expression, extra, 1337, 0xbeef0bff);

Ditto.
Comment 3 Justin Michaud 2022-05-10 16:41:39 PDT
Created attachment 459140 [details]
Patch
Comment 4 Justin Michaud 2022-05-14 18:27:02 PDT
Comment on attachment 459140 [details]
Patch

I think I've waited long enough for api-ios.
Comment 5 EWS 2022-05-14 19:09:13 PDT
Committed r294214 (250572@main): <https://commits.webkit.org/250572@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 459140 [details].
Comment 6 Radar WebKit Bug Importer 2022-05-14 19:10:15 PDT
<rdar://problem/93298917>
Comment 7 Yusuke Suzuki 2022-05-15 19:32:25 PDT
Committed r294220 (250578@trunk): <https://commits.webkit.org/250578@trunk>
Comment 8 Yusuke Suzuki 2022-05-15 19:44:40 PDT
Comment on attachment 459140 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=459140&action=review

> Source/bmalloc/libpas/src/libpas/pas_local_allocator_config_kind.h:86
>  #include "pas_segregated_page_config_kind.def"

I've reverted this file's change because these code can be used in the hot path, and we should keep things all inlined.
So, if we would like to collect more information, let's check things & add assertion in enumeration side :)
They are super cold code, so any perf problem does not matter.