[Run] - System.Text.Json.JsonException: '0x00' is an invalid start of a value.

See original GitHub issue

Version: 1.0.0 OS Version: Microsoft Windows NT 10.0.18363.0 IntPtr Length: 8 x64: True Date: 08/12/2020 09:43:11 Exception: System.Text.Json.JsonException: ‘0x00’ is an invalid start of a value. Path: $ | LineNumber: 0 | BytePositionInLine: 0. —> System.Text.Json.JsonReaderException: ‘0x00’ is an invalid start of a value. LineNumber: 0 | BytePositionInLine: 0. at System.Text.Json.ThrowHelper.ThrowJsonReaderException(Utf8JsonReader& json, ExceptionResource resource, Byte nextByte, ReadOnlySpan`1 bytes) at System.Text.Json.Utf8JsonReader.ConsumeValue(Byte marker) at System.Text.Json.Utf8JsonReader.ReadFirstToken(Byte first) at System.Text.Json.Utf8JsonReader.ReadSingleSegment() at System.Text.Json.Utf8JsonReader.Read() at System.Text.Json.JsonSerializer.ReadCore(JsonSerializerOptions options, Utf8JsonReader& reader, ReadStack& readStack) — End of inner exception stack trace — at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack& readStack, JsonReaderException ex) at System.Text.Json.JsonSerializer.ReadCore(JsonSerializerOptions options, Utf8JsonReader& reader, ReadStack& readStack) at System.Text.Json.JsonSerializer.ReadCore(Type returnType, JsonSerializerOptions options, Utf8JsonReader& reader) at System.Text.Json.JsonSerializer.Deserialize(String json, Type returnType, JsonSerializerOptions options) at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, JsonSerializerOptions options) at PowerLauncher.SettingsWatcher.OverloadSettings() at PowerLauncher.SettingsWatcher…ctor(Settings settings) at PowerLauncher.App.<>c__DisplayClass16_0.<OnStartup>b__1() at Wox.Infrastructure.Stopwatch.Normal(String message, Action action) at PowerLauncher.App.OnStartup(Object sender, StartupEventArgs e) at System.Windows.Application.OnStartup(StartupEventArgs e) at System.Windows.Application.<.ctor>b__1_0(Object unused) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
ryanbodrug-microsoftcommented, Aug 28, 2020

@crutkas @ryanbodrug-microsoft The issue seems to be happening because of race conditions between file write by runner process and file read by FileSystemWatcher in powerlauncher process. PR #6189 would be a short term mitigation strategy. I have added logging to have better information if this issue comes up again. The long term solution would be to use IPC and notify powerlauncher process that the settings have been updated and written to the file. This would require implementing the IPC interface between the win32 and C# projects.

@crutkas: Just to expand on Divyansh’s comments above, because we are initiating the save operations via IPC messages, the code doesn’t block while writing to the disk, and we attempt to read the settings before the file has been written. I was proposing that we implement a callback system over IPC, and turn the SettingsUtils.Save method into a blocking function, and/or add an Async alternative. This won’t get done for .21 obviously. Divyansh’s fix should mitigate the crash, but doesn’t do anything for other modules, and from our testing the issue is pretty hard to repro. I was proposing that we implement the correct fix for .22 and not bother with the mentioned PR at this point, but wanted to get your opinion. What are your thoughts?

@enricogior : ^^ for visibility.

0reactions
crutkascommented, Sep 30, 2020
Read more comments on GitHub >

github_iconTop Results From Across the Web

Error on Build: JsonException: '0x00' is an invalid start of a ...
I had the exact same error message but my problem was caused by a corrupted. obj\Debug\net6.0\staticwebassets.build.json.
Read more >
System.Text.Json.JsonException 'is an invalid start of a ...
Issue resolution for System.Text.Json usage gives JsonException "System.Text.Json.JsonException: '''' is an invalid start of a property name.
Read more >
0x00' is an invalid start of a value path linenumber: 0 | ...
System.Text.Json.JsonException: Serialization JSON error for the invalid start of a property name Issue Description .NET code serialization using gives an ...
Read more >
How to allow some kinds of invalid JSON with System.Text. ...
Learn how to allow comments, trailing commas, and quoted numbers while serializing to and deserializing from JSON in .NET.
Read more >
help : r/Ryujinx
Unhandled exception. System.Text.Json.JsonException: '0x00' is an invalid start of a value. Path: $ | LineNumber: 0 | BytePositionInLine: 0 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found