Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullReferenceException when debugging DateTime related code #608

Closed
patrick-haldi opened this issue May 5, 2020 · 1 comment · Fixed by nanoframework/CoreLibrary#103
Closed

Comments

@patrick-haldi
Copy link

Details about Problem

nanoFramework area: ( Visual Studio extension )

VS version: 15.9.22

VS extension version: 2017.1.8.16

Target: STM32F769I_DISCOVERY

Firmware image version:

Device capabilities output:
device_cap.txt
Assemblies:
CoreLibrary: v1.7.2-preview.5
Runtime.Native: v1.2.0-preview.15

Description

Visual Studio "Autos" window causes System.NullReferenceException in mscorlib.

Detailed repro steps so we can see the same problem

  1. make sure the target has the newest firmware (
    ST_STM32F769I_DISCOVERY-1.4.0-preview.181.zip
    ), and the VS project has the abovementioned assemblies referenced.

  2. open RTC test program:
    test_program.zip

  3. start debugging session

  4. make sure "Autos" window is closed

  5. set breakpoint, for example at line "Thread.Sleep(5000);", wait until it stops there

  6. nothing bad should happen - remove breakpoint and press continue

  7. let run for some time (15 s or so)

  8. enable "Autos" window (Debug->Windows->Autos)

  9. set same breakpoint as before, let it run into it

  10. remove breakpoint and press continue

  11. now, a "System.NullReferenceException" should happen in DateTime.cs

Other suggested things

Expected behaviour

No exception should be thrown.

Screenshot

grafik

Additional context

Make an effort to fix the bug

Our fix for the moment is to keep the "Autos" window closed. If I would have to guess about the cause of the issue, I would say it's because the debugger wants to generate a string representation for the debug output.

@josesimoes
Copy link
Member

There is nothing wrong with the PE and IL code generated for this.
Cross checked with old version of MDP.

The fact that it works when not debugging and outputing the correct values is a proof of it.

Suspecting of the evaluation calls and return parsing on VS debugger or debugger engine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants