Bug 177392 - WebAssemly + gigacage maxNumWebAssemblyFastMemories = 10 fails
Summary: WebAssemly + gigacage maxNumWebAssemblyFastMemories = 10 fails
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebAssembly (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-09-22 15:27 PDT by JF Bastien
Modified: 2017-09-22 17:07 PDT (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description JF Bastien 2017-09-22 15:27:59 PDT
Set maxNumWebAssemblyFastMemories to 10, then run:

  ./Tools/Scripts/run-javascriptcore-tests --debug --filter=wasm --quick --no-build --no-testapi --no-testmasm --no-testb3 --no-testair

Or just:

  (cd ./JSTests/wasm/ && DYLD_FRAMEWORK_PATH=$d/WebKitBuild/$type/ $d/WebKitBuild/$type/jsc -m ./js-api/dont-mmap-zero-byte-memory.js)

This fails in gigacage allocation when trying to allocate a fast memory, because it expects that allocation to succeed and it RELEASE_ASSERTs out. I didn't investigate, but it shouldn't fail (it's a virtual allocation), and it should fall back to slow memory if so.
Comment 1 Filip Pizlo 2017-09-22 16:22:56 PDT
Not a bug. The purpose of maxNumWebAssemblyFastMemories is to protect us from this case by ensuring the we don’t ever eat up all of the gigacage just with virtual allocations.
Comment 2 JF Bastien 2017-09-22 16:24:54 PDT
(In reply to Filip Pizlo from comment #1)
> Not a bug. The purpose of maxNumWebAssemblyFastMemories is to protect us
> from this case by ensuring the we don’t ever eat up all of the gigacage just
> with virtual allocations.

Options processing should catch an invalid input for maxNumWebAssemblyFastMemories then, no? x86 used to be able to have a huge number of fast memories...
Comment 3 Filip Pizlo 2017-09-22 17:07:35 PDT
(In reply to JF Bastien from comment #2)
> (In reply to Filip Pizlo from comment #1)
> > Not a bug. The purpose of maxNumWebAssemblyFastMemories is to protect us
> > from this case by ensuring the we don’t ever eat up all of the gigacage just
> > with virtual allocations.
> 
> Options processing should catch an invalid input for
> maxNumWebAssemblyFastMemories then, no? x86 used to be able to have a huge
> number of fast memories...

It is not a goal of options processing to catch all nonsensical inputs. Also, the right maximum here is terribly difficult to deduce.