swiftwasm / swiftwasm/JavaScriptKit
Memory corruption take 2
Open
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 986
- Forks
- 76
- Avg merge
- 21h 11m
- Merged PRs (30d)
- 4
Description
I still see the following crash if I re-enable the Examples/Testing tests.
RuntimeError: memory access out of bounds
at CounterPackageTests.xctest.dlmalloc (wasm://wasm/CounterPackageTests.xctest-0f40d596:wasm-function[89702]:0x115e7de)
at CounterPackageTests.xctest.malloc (wasm://wasm/CounterPackageTests.xctest-0f40d596:wasm-function[89701]:0x115e22a)
at CounterPackageTests.xctest.swift::Demangle::__runtime::Demangler::demangleBoundGenerics(swift::Demangle::__runtime::Vector<swift::Demangle::__runtime::Node*>&, swift::Demangle::__runtime::Node*&) (wasm://wasm/CounterPackageTests.xctest-0f40d596:wasm-function[28248]:0x522adc)
at CounterPackageTests.xctest.swift::Demangle::__runtime::Demangler::demangleBoundGenericType() (wasm://wasm/CounterPackageTests.xctest-0f40d596:wasm-function[28200]:0x512379)
at CounterPackageTests.xctest.swift::Demangle::__runtime::Demangler::demangleOperator() (wasm://wasm/CounterPackageTests.xctest-0f40d596:wasm-function[28174]:0x50e156)
at CounterPackageTests.xctest.swift::Demangle::__runtime::Demangler::demangleType(__swift::__runtime::llvm::StringRef, std::__2::function<swift::Demangle::__runtime::Node* (swift::Demangle::__runtime::SymbolicReferenceKind, swift::Demangle::__runtime::Directness, int, void const*)>) (wasm://wasm/CounterP
ackageTests.xctest-0f40d596:wasm-function[28172]:0x50db25)
at CounterPackageTests.xctest.swift_getTypeByMangledName (wasm://wasm/CounterPackageTests.xctest-0f40d596:wasm-function[27912]:0x4ee2ad)
at CounterPackageTests.xctest.(anonymous namespace)::DecodedMetadataBuilder::resolveOpaqueType(swift::Demangle::__runtime::Node*, __swift::__runtime::llvm::ArrayRef<__swift::__runtime::llvm::ArrayRef<swift::MetadataPackOrValue>>, unsigned int) (wasm://wasm/CounterPackageTests.xctest-0f40d596:wasm-functio
n[27992]:0x500764)
at CounterPackageTests.xctest.swift::Demangle::__runtime::TypeDecoder<(anonymous namespace)::DecodedMetadataBuilder>::decodeMangledType(swift::Demangle::__runtime::Node*, unsigned int, bool) (wasm://wasm/CounterPackageTests.xctest-0f40d596:wasm-function[27925]:0x4f3cfe)
at CounterPackageTests.xctest.swift::Demangle::__runtime::TypeDecoder<(anonymous namespace)::DecodedMetadataBuilder>::decodeGenericArgs(swift::Demangle::__runtime::Node*, unsigned int, __swift::__runtime::llvm::SmallVectorImpl<swift::MetadataPackOrValue>&) (wasm://wasm/CounterPackageTests.xctest-0f40d596
:wasm-function[27971]:0x4fc426)
Toolchain version: DEVELOPMENT-SNAPSHOT-2025-10-02-a
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with Examples/Testing and the referenced lines 249-250 in ExampleTests.swift, then reproduce the crash using the DEVELOPMENT-SNAPSHOT-2025-10-02-a toolchain. Trace the reported memory access failure through the test run; done means the re-enabled tests complete without the out-of-bounds crash.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift, wasm
- Domain
- testing
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100