DataView.byteOffset and element reads succeed after buffer transfer
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 70/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- csharp, typescript
- Domain
- backend
Research direction
Start by running the supplied repro with SharpTS interpretation and with standalone compilation and verification, then trace how detached ArrayBuffers are handled by DataView byteOffset and element reads. Compare the results with the Node.js behavior in the issue. Done means both SharpTS runs throw TypeError for the offset and read after transfer.
Written by the indexing model from the issue text.
Description
While checking #3819, I found that a detached DataView still reports its old offset and reads the old storage.
const buffer = new ArrayBuffer(4);
const view = new DataView(buffer, 1, 2);
structuredClone(buffer, { transfer: [buffer] });
try { console.log(view.byteOffset); } catch (error) { console.log(error.name); }
try { console.log(view.getUint8(0)); } catch (error) { console.log(error.name); }
Node.js v22.23.2 prints TypeError twice. SharpTS interpretation and IL-verified standalone both print 1 and 0.
Run as sharpts --no-tsconfig --noLib repro.js. For standalone, run sharpts --no-tsconfig --noLib --compile repro.js --standalone --verify -o repro.dll and dotnet repro.dll.
- Dominant language
- C#
- Stars
- 156
- Forks
- 4
- Avg merge
- 14h 45m
- Merged PRs (30d)
- 40
Getting set up
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.
More from nickna/SharpTS
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 57/100
Maintainers usually reply within 1 day
Similar issues
-
elsa 3
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
elsa-workflows/elsa-core#9349 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 88/100
PereViader/ManualDi#200 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Forrest-Technologies/drover#1040 ·
Maintainers usually reply within 1 day
-
todo
Difficulty 1/5 Under an hour Newbie friendliness 72/100
tonybaloney/CSnakes#864 ·