BUG Simconnect crash and detach all events when use zoom feature in externalview P3Dv4

Discuss on the SimConnect SDK can be used by programmers to write add-on components for Prepar3D
FlightOnFly
Posts: 190
Joined: Wed Oct 27, 2010 12:55 pm

BUG Simconnect crash and detach all events when use zoom feature in externalview P3Dv4

Post by FlightOnFly »

Hello,

i m sw developer of one commercial addon. I have a big issue in P3Dv4, using Simconnect SDK (from legacy version).
Meanwhile i have Simconnect instance with all events attached (managed mode) and in spot view or another external view i press - or + for zoom , Simconnect instance crash and remove all events attached.
Do you are aware with this issue? It is a crucial point for me resolve this issue , because otherwise i cant make it compatible with p3d v4. All works fine in P3Dv3
Thank you
Fabio
FlightControlReplay Developer
FlightOnFly
Posts: 190
Joined: Wed Oct 27, 2010 12:55 pm

Re: BUG Simconnect crash and detach all events when use zoom feature in externalview P3Dv4

Post by FlightOnFly »

I add that it is not a real crash of simconnect class instance but ALL events attached are detached and for resume the situation i think i should renew Simconnect object class , but it is impossible to do in my addon. Please contact me for more details. Now by Now i m blocked to declare p3dv4 compatibility.
FlightControlReplay Developer
Adam Breed
Lockheed Martin
Posts: 1382
Joined: Mon Sep 20, 2010 6:17 pm

Re: BUG Simconnect crash and detach all events when use zoom feature in externalview P3Dv4

Post by Adam Breed »

Hi FlightOnFly,

Could you provide the source of a simple sample that recreates the crash?

Regards,
Adam
Prepar3D® Engineering Project Manager
FlightOnFly
Posts: 190
Joined: Wed Oct 27, 2010 12:55 pm

Re: BUG Simconnect crash and detach all events when use zoom feature in externalview P3Dv4

Post by FlightOnFly »

Hi Adam,

I can provide my addon and you can repro issue. I write you simple steps to do that. I can send you onedrive link with addon via pvt message ?
Thank you for help.
Fabio
FlightControlReplay Developer
FlightOnFly
Posts: 190
Joined: Wed Oct 27, 2010 12:55 pm

Re: BUG Simconnect crash and detach all events when use zoom feature in externalview P3Dv4

Post by FlightOnFly »

Adam Breed wrote: Sat Jun 03, 2017 12:27 am Hi FlightOnFly,

Could you provide the source of a simple sample that recreates the crash?

Regards,
Adam
Hi Adam,

i isolated the issue. In the main loop pf my addon:
while (true)
{
scReady.WaitOne();

if (simConnect == null)
continue;

simConnect.ReceiveMessage();

}

when i press - or + for zoom in and zoom out in Spot Mode simConnect.ReceiveMessage();
throw an exception with details below:

"The given key was not present in the dictionary."

with this stack trace:

at System.ThrowHelper.ThrowKeyNotFoundException()
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at Microsoft.FlightSimulator.SimConnect.SimConnect.MarshalRECVPtrToObject(UInt32 dwID, Void* pData)
at Microsoft.FlightSimulator.SimConnect.CSignalProcDelegateMarshaler.CallSignalProc(SIMCONNECT_RECV* pData, UInt32 cbData, Void* pContext)
at SimConnect_CallDispatch(Void* , IntPtr , Void* )
at Microsoft.FlightSimulator.SimConnect.SimConnect.ReceiveDispatch(SignalProcDelegate pfcnSignal)
at Microsoft.FlightSimulator.SimConnect.SimConnect.ReceiveMessage()
at SimEnvConnEngine.SimEnvConnEngine.scMessageThread() in 1108

Now i resolved with simple try catch but please verify it and let me know if i can help you.
Thanks
FlightControlReplay Developer
Adam Breed
Lockheed Martin
Posts: 1382
Joined: Mon Sep 20, 2010 6:17 pm

Re: BUG Simconnect crash and detach all events when use zoom feature in externalview P3Dv4

Post by Adam Breed »

FlightOnFly wrote: Sat Jun 03, 2017 6:24 am
I can send you onedrive link with addon via pvt message ?
Hi Fabio,

That would be fine.

Regards,
Adam
Prepar3D® Engineering Project Manager
Adam Breed
Lockheed Martin
Posts: 1382
Joined: Mon Sep 20, 2010 6:17 pm

Re: BUG Simconnect crash and detach all events when use zoom feature in externalview P3Dv4

Post by Adam Breed »

FlightOnFly wrote: Sun Jun 04, 2017 3:15 pm with this stack trace:
Hi Fabio,

Just to confirm, you are compiling against the FSX SimConnect, correct?

Regards,
Adam
Prepar3D® Engineering Project Manager
FlightOnFly
Posts: 190
Joined: Wed Oct 27, 2010 12:55 pm

Re: BUG Simconnect crash and detach all events when use zoom feature in externalview P3Dv4

Post by FlightOnFly »

Hi Adam!

I confirm you that i m build with fsx simconnect. Today i ll send you link via pvt message with onedrive link for donwload
My addon setup and instruction for prereq redist and steps to repro ☺ .
Fabio
FlightControlReplay Developer
FlightOnFly
Posts: 190
Joined: Wed Oct 27, 2010 12:55 pm

Re: BUG Simconnect crash and detach all events when use zoom feature in externalview P3Dv4

Post by FlightOnFly »

Hi Adam,

i sent you PVT message ;-) with all info and link
Thank you Fabio
FlightControlReplay Developer
Clifton Crane
Lockheed Martin
Posts: 1207
Joined: Tue Sep 25, 2012 2:34 pm

Re: BUG Simconnect crash and detach all events when use zoom feature in externalview P3Dv4

Post by Clifton Crane »

Hi FlightOnFly,

Could you provide more detail as to how to reproduce the exception?
  • Do I need to record or playback?
  • Should I start your add-on before or after Prepar3D?
  • Do you see the exception when using +/- keys on the keyboard or when using the +/- buttons in your add-on's user interface?
Thanks.
Clifton Crane
Prepar3D® Software Engineer Sr.
FlightOnFly
Posts: 190
Joined: Wed Oct 27, 2010 12:55 pm

Re: BUG Simconnect crash and detach all events when use zoom feature in externalview P3Dv4

Post by FlightOnFly »

Hi!
- Start p3d , wait p3d main menu
- start fcr
-automatically connect
- start a flight
- go into spot view and click - or plus a couple of times
- at this point if you are in debug you should see your exception because receivemessage of my while loop throw exception.

If you have questions please send me pm message
Thanks
Fabio
FlightControlReplay Developer
FlightOnFly
Posts: 190
Joined: Wed Oct 27, 2010 12:55 pm

Re: BUG Simconnect crash and detach all events when use zoom feature in externalview P3Dv4

Post by FlightOnFly »

Only for explain well when i talk about "- go into spot view and click - or plus a couple of times" i mean Keyboard + and -
FlightControlReplay Developer
Clifton Crane
Lockheed Martin
Posts: 1207
Joined: Tue Sep 25, 2012 2:34 pm

Re: BUG Simconnect crash and detach all events when use zoom feature in externalview P3Dv4

Post by Clifton Crane »

FlightOnFly,

I am unable to reproduce the exception you are seeing. Would you be able to provide simplified a sample demonstrating the issue? Do you have a workaround for the current issue?

Thanks.
Clifton Crane
Prepar3D® Software Engineer Sr.
FlightOnFly
Posts: 190
Joined: Wed Oct 27, 2010 12:55 pm

Re: BUG Simconnect crash and detach all events when use zoom feature in externalview P3Dv4

Post by FlightOnFly »

Hi!
Try launch p3d v4 after that launch fcr. After change view and set spot view . At this time if you press - or + keyboard simconnect receivemessage go in exception BUT i catch it and you dont see dialog. I thinked you can see it going in debug in p3d. If not i can build a version with a message box ?
Thanks
Fabio
FlightControlReplay Developer
Adam Breed
Lockheed Martin
Posts: 1382
Joined: Mon Sep 20, 2010 6:17 pm

Re: BUG Simconnect crash and detach all events when use zoom feature in externalview P3Dv4

Post by Adam Breed »

FlightOnFly wrote: Wed Jun 07, 2017 10:54 pm If not i can build a version with a message box ?
Fabio,

We would like to see the crash. If you can provide one that crashes Prepar3D - we can often spot any issue quickly.

Regards,
Adam
Prepar3D® Engineering Project Manager
Locked