EgorBo / EgorBo/SimdJsonSharp

AccessViolations caused by missing padding (SIMDJSON_PADDING with AVX2)

Open
#20 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
687
Forks
48
PR merge metrics
No merged PRs in 30d

Description

Using SimdJsonSharp.Managed nuget with a .Net5 console application in VS19 on Windows 10 with AVX2 support i am able to reproduce an access violation with some Json files.

After a first investigation it looks like the expected padding (SIMDJSON_PADDING) doesn't work. My memory window is showing that there were only very few additional bytes added at the end of my json byte array (probably by debug mode).

![grafik](https://user-images.githubusercontent.com/15040273/120563008-e32b1a00-c407-11eb-8fdc-4aab2ed04399.png)
The value of 'ptr' was pointing to the selected character shown in the memory window / see 'Autos' window bottom left.

The shown decompiled line seems to correspond to: https://github.com/EgorBo/SimdJsonSharp/blob/0786341a50919f33c2a86a47d4a1848713c9d60e/src/FullyManagedImpl/Utils/stringparsing.cs#L108

If it helps i can share the source code and json .

**Workaround**: Adding the padding of 32 bytes and the end of the input byte array solved this issue.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.