View Issue Details

IDProjectCategoryView StatusLast Update
0002033CCdciel[All Projects] Generalpublic18-12-07 15:35
ReporterCedric RaguenaudAssigned ToPatrick Chevalley 
PrioritynormalSeveritycrashReproducibilityhave not tried
Status resolvedResolutionfixed 
Product Version 
Target Version1.0Fixed in Version 
Summary0002033: Application crash
DescriptionLast night I experienced 2 application crashes with ccdciel simply exiting without warning (both during unattended processing of a sequence).
Steps To ReproduceFaulting application name: ccdciel.exe, version: 0.0.0.0, time stamp: 0x00000000
Faulting module name: mswsock.dll, version: 10.0.17134.1, time stamp: 0xd0d9b906
Exception code: 0xc0000409
Fault offset: 0x0000dc07
Faulting process ID: 0x13b0
Faulting application start time: 0x01d4804fa28f58c1
Faulting application path: C:\Software\ccdciel\src\ccdciel.exe
Faulting module path: C:\WINDOWS\system32\mswsock.dll
Report ID: 83aac564-c39e-441f-b0e5-cfb85cf4522c
Faulting package full name:
Faulting package-relative application ID:
TagsNo tags attached.

Relationships

duplicate of 0002023 closedPatrick Chevalley Application crash 
has duplicate 0002032 closedPatrick Chevalley Multiple crashes 

Activities

Patrick Chevalley

18-11-20 16:58

administrator   ~0005114

This is the same error as 0002023

So the increase of the stack size do not change the problem.
Do you use my version 0.9.48 ? or do you compile it yourself? in the last case are you sure the stack size (option -Cs ) is set.

Cedric Raguenaud

18-11-20 17:51

reporter   ~0005116

Good point. I compile it myself. I will check.

Cedric Raguenaud

18-11-20 18:43

reporter   ~0005117

The memory options are in the project files. Isn't it enough?

I just ran a preview loop and it ran out of memory after a while.

Cedric Raguenaud

18-11-20 19:11

reporter   ~0005118

Trying with the precompiled download now.

Cedric Raguenaud

18-11-20 19:28

reporter   ~0005119

Just got a crash with the precompiled version.

Faulting application name: ccdciel.exe, version: 0.0.0.0, time stamp: 0x00000000
Faulting module name: mswsock.dll, version: 10.0.17134.1, time stamp: 0xd0d9b906
Exception code: 0xc0000409
Fault offset: 0x0000dc07
Faulting process ID: 0x2478
Faulting application start time: 0x01d480fa0b785719
Faulting application path: C:\Program Files (x86)\CCDciel\ccdciel.exe
Faulting module path: C:\WINDOWS\system32\mswsock.dll
Report ID: c82b1b69-fee6-4adc-9c3d-f447071c6bbc
Faulting package full name:
Faulting package-relative application ID:

Cedric Raguenaud

18-11-20 19:30

reporter   ~0005120

Burning obvious with the memory (screen cap).

Cedric Raguenaud

18-11-20 19:31

reporter  

Cedric Raguenaud

18-11-20 19:31

reporter   ~0005121

/burning/nothing/

Patrick Chevalley

18-11-20 21:54

administrator   ~0005122

I am surprised the stack overflow is always in mswsock.dll.

Can you try to run the same kind of sequence you do above but deactivate any function that use the sockets:
- "Preference/ allow to get program status from tcp/ip..."
- do not connect the autoguider
- do not connect the planetarium

Cedric Raguenaud

18-11-26 16:59

reporter   ~0005134

I ran about 6 hours of sequences last night using the simulators: no crash. So this would confirm that there is an issue between one of the actual drivers and ccdciel (the same issue doesn't exist with APT). Now, knowing what that issue is is another problem.

Patrick Chevalley

18-11-27 10:14

administrator   ~0005135

Thank you for this test.
Yes, now we have to search for difference between the operation with the simulator and the real hardware.
For example do you always debayer the preview from your camera? In this case I can search more in detail this part of the program.
Do you have other idea of this kind?
Also with APT do you use the QHY Ascom driver or is direct access from APT to the QHY SDK?

Cedric Raguenaud

18-11-27 10:59

reporter   ~0005136

I have used the preview with debayer and without. I think I had crashed in both cases.

I used APT with the same drivers (ASCOM). It is very possible that APT had the same issue but hid it. It's impossible to know.

I'll try to investigate a bit more.

Patrick Chevalley

18-11-29 17:00

administrator   ~0005138

Today I do a lot of testing on Windows with my real camera.
I compared the Ascom trace when using CCDciel or APT and I make a few change to make less solicitation on the driver by caching values that cannot change by themselves.
Now with this changes the trace are pretty similar and I cannot find a difference in the operation of the two software. Please compile this last version before to do more testing.

Can you activate the Ascom trace with your camera driver ? in this case can you run a short session (just one or two preview image) with both software and upload the trace here. (files are in Documents/ASCOM/date/)

Another tool I find useful is the Ascom conformance checker. For example I find that my camera return only garbage for the LastExposureStartTime property.
Can you install the conformance checker from: https://ascom-standards.org/Downloads/DevTools.htm
Then connect your camera, run the test and upload the result file here. (it also is in Documents/ASCOM/date/)

If you can do this two points I think we are done with the camera.

Patrick Chevalley

18-11-30 11:44

administrator   ~0005141

As the error is always in the Windows socket library I look now at the internal tcp server, even if the function that raise the stack overflow is not necessarily the one that filled the stack.

In your previous log from November 13 there is the message about the server listen on port 3277 at the start of the log.
But in the log from November 21 you added to 0002032 it is not.

Do you deactivate the function (Preference/Files, last option at the bottom) ? or is it possible that something prevent the server to start (firewall, antivirus) ?

Cedric Raguenaud

18-11-30 11:51

reporter   ~0005142

Yes I did when I was testing all networky stuff. I don't use the web interface at the moment since I access the machine in the observatory via RDP.

Cedric Raguenaud

18-11-30 13:01

reporter   ~0005143

The QHY Ascom driver doesn't have a trace mode that I can see.

Here are the confomity test results for the camera:
  
ConformanceCheck ASCOM Device Conformance Checker Version 6.4.62.0, Build time: 19/09/2018 14:33:12
ConformanceCheck Running on: ASCOM Platform 6.4 SP1 6.4.1.2695
 
ConformanceCheck Driver ProgID: ASCOM.QHYCCD.Camera
 
Error handling
Error number for "Not Implemented" is: 80040400
Error number for "Invalid Value 1" is: 80040405
Error number for "Value Not Set 1" is: 80040402
Error number for "Value Not Set 2" is: 80040403
Error messages will not be interpreted to infer state.
 
13:00:25.282 Driver Access Checks OK
13:00:25.400 AccessChecks ERROR Error creating driver object using late binding: System.BadImageFormatException: Creating an instance of the COM component with CLSID {FAAC07AE-5A0B-4157-A6DD-5E7C03D7B529} from the IClassFactory failed due to the following error: 8007000b Tentative de chargement d’un programme de format incorrect. (Exception from HRESULT: 0x8007000B).
                                                       at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
                                                       at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
                                                       at System.Activator.CreateInstance(Type type, Boolean nonPublic)
                                                       at System.Activator.CreateInstance(Type type)
                                                       at Conform.DeviceTesterBaseClass.CheckAccessibility(String p_ProgId, DeviceType p_DeviceType) in J:\Conform\Conform\Devices\DeviceTesterBaseClass.vb:line 420
 
13:00:26.068 AccessChecks INFO Driver does not expose interface ICamera
13:00:26.085 AccessChecks INFO Driver does not expose interface ICameraV2
13:00:26.134 AccessChecks ERROR Error creating driver using driver access toolkit: Creating an instance of the COM component with CLSID {FAAC07AE-5A0B-4157-A6DD-5E7C03D7B529} from the IClassFactory failed due to the following error: 8007000b Tentative de chargement d’un programme de format incorrect. (Exception from HRESULT: 0x8007000B).
 
 
Conform is using ASCOM.DriverAccess.Camera to get a Camera object
13:00:26.208 Initialise ERROR .NET - Exception: Creating an instance of the COM component with CLSID {FAAC07AE-5A0B-4157-A6DD-5E7C03D7B529} from the IClassFactory failed due to the following error: 8007000b Tentative de chargement d’un programme de format incorrect. (Exception from HRESULT: 0x8007000B).
 
ConformanceCheck Further tests abandoned as Conform cannot create the driver
Conformance test interrupted by STOP button or to protect the device.
 
Your driver had 3 errors, 0 warnings and 0 issues

But it works witin APT and CCDCiel, so I'm thinking maybe the 64bits driver is messed up (the 32bits is normally used).

Patrick Chevalley

18-11-30 13:37

administrator   ~0005144

Yes the driver do not work in 64bit.

After you start Conform, open the menu Options, Conformance options, and check "Run as 32bit on 64bit OS".
It restart and you see "32bit mode" on the first line.

Patrick Chevalley

18-11-30 13:40

administrator   ~0005145

As you are in this option menu you can open the "Camera test" tab and set the max binning to 4 for x and y because we not need a test frame with every possible binning.

Cedric Raguenaud

18-11-30 14:07

reporter   ~0005146

Ah that's better. Camera test:

 
ConformanceCheck ASCOM Device Conformance Checker Version 6.4.62.0, Build time: 19/09/2018 14:33:06
ConformanceCheck Running on: ASCOM Platform 6.4 SP1 6.4.1.2695
 
ConformanceCheck Driver ProgID: ASCOM.QHYCCD.Camera
 
Error handling
Error number for "Not Implemented" is: 80040400
Error number for "Invalid Value 1" is: 80040405
Error number for "Value Not Set 1" is: 80040402
Error number for "Value Not Set 2" is: 80040403
Error messages will not be interpreted to infer state.
 
14:04:55.958 Driver Access Checks OK
14:04:56.742 AccessChecks OK Successfully created driver using late binding
14:04:59.203 AccessChecks OK Successfully connected using late binding
14:04:59.210 AccessChecks INFO The driver is a COM object
14:04:59.890 AccessChecks INFO Driver does not expose interface ICamera
14:05:00.311 AccessChecks INFO Device exposes interface ICameraV2
14:05:02.421 AccessChecks OK Successfully created driver using driver access toolkit
14:05:02.823 AccessChecks OK Successfully connected using driver access toolkit
 
Conform is using ASCOM.DriverAccess.Camera to get a Camera object
14:05:04.865 ConformanceCheck OK Driver instance created successfully
14:05:05.356 ConformanceCheck OK Connected OK
 
Common Driver Methods
14:05:05.426 InterfaceVersion OK 2
14:05:05.466 Connected OK True
14:05:05.506 Description OK QHYCCD-Cameras-Capture
14:05:05.547 DriverInfo OK Information about the driver itself. Version: 0.1
14:05:05.588 DriverVersion OK 0.1
14:05:05.629 Name OK QHYCCDCameras
14:05:05.670 CommandString INFO Conform cannot test the CommandString method
14:05:05.677 CommandBlind INFO Conform cannot test the CommandBlind method
14:05:05.684 CommandBool INFO Conform cannot test the CommandBool method
14:05:05.692 Action INFO Conform cannot test the Action method
14:05:05.752 SupportedActions OK Driver returned an empty action list
 
Can Properties
14:05:05.846 CanAbortExposure OK True
14:05:05.857 CanAsymmetricBin OK False
14:05:05.866 CanGetCoolerPower OK True
14:05:05.874 CanPulseGuide OK True
14:05:05.883 CanSetCCDTemperature OK True
14:05:05.892 CanStopExposure OK True
14:05:05.900 CanFastReadout OK False
 
Pre-run Checks
 
Last Tests
14:05:06.085 LastExposureDuration OK LastExposureDuration correctly generated a COM exception before an exposure was made
14:05:06.103 LastExposureStartTime OK LastExposureStartTime correctly generated a COM exception before an exposure was made
 
Properties
14:05:06.179 MaxBinX OK 2
14:05:06.227 MaxBinY OK 2
14:05:06.276 BinX Read OK 1
14:05:06.325 BinY Read OK 1
14:05:06.387 BinX Write OK Exception correctly generated on setting BinX to 0
14:05:06.399 BinX Write OK Exception correctly generated on setting BinX to 3
14:05:06.412 BinY Write OK Exception correctly generated on setting BinY to 0
14:05:06.424 BinY Write OK Exception correctly generated on setting BinY to 3
14:05:06.436 BinXY Write OK Successfully set symmetric xy binning: 1 x 1
14:05:06.447 BinXY Write OK Successfully set symmetric xy binning: 2 x 2
14:05:06.459 CameraState OK cameraIdle
14:05:06.509 CameraXSize OK 5544
14:05:06.559 CameraYSize OK 3684
14:05:06.611 CCDTemperature OK 25
14:05:06.662 CoolerOn Read OK False
14:05:06.713 CoolerOn Write OK Successfully changed CoolerOn state
14:05:06.727 CoolerPower OK 0
14:05:06.778 ElectronsPerADU OK 1
14:05:06.830 FullWellCapacity OK 65535
14:05:06.881 HasShutter OK False
14:05:06.938 HeatSinkTemperature OK Optional member threw a PropertyNotImplementedException exception.
14:05:06.993 ImageReady OK False
14:05:07.048 ImageArray OK Exception correctly generated when ImageReady is false
14:05:07.063 ImageArrayVariant OK Exception correctly generated when ImageReady is false
14:05:07.076 IsPulseGuiding OK False
14:05:07.128 MaxADU OK 255
14:05:07.182 NumX Read OK 5544
14:05:07.237 NumX write OK Successfully wrote 2772
14:05:07.251 NumY Read OK 3684
14:05:07.305 NumY write OK Successfully wrote 1842
14:05:07.323 PixelSizeX OK 2.4
14:05:07.399 PixelSizeY OK 2.4
14:05:07.456 SetCCDTemperature Read OK -9.5
14:05:07.514 SetCCDTemperature Write OK Successfully wrote 0
14:05:07.533 SetCCDTemperature Write INFO Setpoint lower limit (to nearest 5 degrees) found: -50
14:05:07.571 SetCCDTemperature Write INFO Setpoint high limit (to nearest 5 degrees) found: 50
14:05:07.607 StartX Read OK 0
14:05:07.683 StartX write OK Successfully wrote 2772
14:05:07.700 StartY Read OK 0
14:05:07.777 StartY write OK Successfully wrote 1842
14:05:07.810 SensorType Read OK Monochrome
14:05:07.847 BayerOffsetX Read OK Sensor type is Monochrome and a PropertyNotImplementedException exception was generated as expected
14:05:07.884 BayerOffsetY Read OK Sensor type is Monochrome and a PropertyNotImplementedException exception was generated as expected
14:05:07.921 ExposureMax Read OK 3600
14:05:07.957 ExposureMin Read OK 0.001
14:05:07.993 ExposureMin OK ExposureMin is less than or equal to ExposureMax
14:05:08.029 ExposureResolution Read OK 0
14:05:08.065 ExposureResolution OK ExposureResolution is less than or equal to ExposureMax
14:05:08.102 FastReadout Read OK Optional member threw a PropertyNotImplementedException exception.
14:05:08.139 FastReadout Write OK Optional member threw a PropertyNotImplementedException exception.
14:05:08.176 GainMin Read OK 0
14:05:08.212 GainMax Read OK 54
14:05:08.247 GainMinMax OK Both GainMin and GainMax are readable or both throw exceptions
14:05:08.285 Gains Read OK Optional member threw a PropertyNotImplementedException exception.
14:05:08.331 Gain Read OK 11
14:05:08.367 PercentCompleted Read OK 100
14:05:08.403 ReadoutModes Read OK Fast
14:05:08.438 ReadoutModes Read OK Normal
14:05:08.475 ReadoutMode Read OK 0
14:05:08.511 ReadoutMode Index OK ReadReadoutMode is within the bounds of the ReadoutModes ArrayList
14:05:08.547 ReadoutMode Index INFO Current value: Fast
14:05:08.583 SensorName Read OK QHYCCD
 
Methods
14:05:08.719 AbortExposure OK No exception generated when camera is already idle
14:05:10.779 PulseGuide guideNorth OK Synchronous pulse guide found OK
14:05:12.841 PulseGuide guideSouth OK Synchronous pulse guide found OK
14:05:14.901 PulseGuide guideEast OK Synchronous pulse guide found OK
14:05:16.962 PulseGuide guideWest OK Synchronous pulse guide found OK
14:05:17.024 StopExposure OK No exception generated when camera is already idle
 
Take image full frame 1 x 1 bin
14:05:22.545 StartExposure OK Asynchronous exposure found OK: 2 seconds
14:05:22.563 LastExposureDuration OK LastExposureDuration is: 2 seconds
14:05:22.599 LastExposureStartTime OK LastExposureStartTime is correct to within 2 seconds: 2018-11-30T14:05:17 UTC
14:05:23.278 ImageArray OK Successfully read 32 bit integer array (1 plane) 5544 x 3684 pixels
14:05:30.095 ImageArrayVariant ERROR .NET - Exception: exception when reading ImageArrayVariantASCOM.DriverException: CheckDotNetExceptions ASCOM.QHYCCD.Camera ImageArrayVariant Get System.OutOfMemoryException: Insufficient memory to continue the execution of the program. (See Inner Exception for details) ---> System.OutOfMemoryException: Insufficient memory to continue the execution of the program.
                                                       --- End of inner exception stack trace ---
                                                       at Microsoft.VisualBasic.CompilerServices.Symbols.Container.InvokeMethod(Method TargetProcedure, Object[] Arguments, Boolean[] CopyBack, BindingFlags Flags)
                                                       at Microsoft.VisualBasic.CompilerServices.NewLateBinding.ObjectLateGet(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack)
                                                       at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateGet(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack)
                                                       at Conform.CameraTester.CameraExposure(String p_Description, Int32 p_BinX, Int32 p_BinY, Int32 p_StartX, Int32 p_StartY, Int32 p_NumX, Int32 p_NumY, Double p_Duration, String p_ExpectedErrorMessage)
 
Take image full frame 2 x 2 bin
14:05:36.240 StartExposure OK Asynchronous exposure found OK: 2 seconds
14:05:36.257 LastExposureDuration OK LastExposureDuration is: 2 seconds
14:05:36.293 LastExposureStartTime OK LastExposureStartTime is correct to within 2 seconds: 2018-11-30T14:05:30 UTC
14:05:36.492 ImageArray OK Successfully read 32 bit integer array (1 plane) 2772 x 1842 pixels
14:05:39.239 ImageArrayVariant OK Successfully read variant array (1 plane) with System.Int32 elements 2772 x 1842 pixels
 
StartExposure error cases
14:05:39.396 StartExposure OK Exception correctly generated for negative duration
14:05:39.460 StartExposure OK Exception correctly generated for X size larger than binned chip size, Bin 1x1
14:05:39.523 StartExposure OK Exception correctly generated for Y size larger than binned chip size, Bin 1x1
14:05:39.585 StartExposure OK Exception correctly generated for X start outside binned chip size, Bin 1x1
14:05:39.648 StartExposure OK Exception correctly generated for Y start outside binned chip size, Bin 1x1
14:05:39.711 StartExposure OK Exception correctly generated for X size larger than binned chip size, Bin 2x2
14:05:39.773 StartExposure OK Exception correctly generated for Y size larger than binned chip size, Bin 2x2
14:05:39.836 StartExposure OK Exception correctly generated for X start outside binned chip size, Bin 2x2
14:05:39.900 StartExposure OK Exception correctly generated for Y start outside binned chip size, Bin 2x2
 
Post-run Checks
14:05:40.062 PostRunCheck OK Camera returned to initial cooler temperature
 
Conformance test complete
 
Your driver had 1 error, 0 warnings and 0 issues

Patrick Chevalley

18-11-30 15:42

administrator   ~0005147

Thank you for this test. Good to confirm that with your camera the initial NumX value is coherent with CameraXSize, so no problem with that.

A strange value is MaxADU=255, is the camera initially in 8bit mode? Be sure the option "Maximum ADU" in Preference/Camera is set to a higher value, otherwise this can prevent the detection of stars for auto-focus.

Can this be related to ReadoutMode=Fast by default? Can you change to ReadoutMode=normal from the driver settings or do I need to add a setting for that in CCDciel?

The OutOfMemoryException is not relevant for CCDciel because I not use the ImageArrayVariant but the ImageArray that work. Anyway this is strange because the Ascom documentation indicate the ImageArrayVariant take 26bytes per pixel, this is 506MB for your image. This is a lot but strange it cannot be allocated on your system.

Another minor error is SensorType=Monochrome but CCDciel do not rely on this value.

Cedric Raguenaud

18-11-30 15:54

reporter   ~0005148

I've changed the Max ADU value to 65535.

I can't change the value for ReadoutMode in th driver.

The SensorType=Monochrome seems to be a QHY thing. APT and other programs also report that. I vaguely remember somebody from QHY saying that this was because it was what the sensor was seeing and it was up to applications to know to debayer the images.

BTW I've been running preview loops all afternoon and I still get random crashes. I tried to debug, but when it happens Lazarus reports an exception in winnt, I can't get a stack trace, and ccdciel dies.

Patrick Chevalley

18-12-05 09:55

administrator   ~0005151

OK, if this work I not change anything for readoutmode and maxadu.

About sensortype qhy has a very personal interpretation of the standard, it must be rggb. There is a lot of explanation here:
https://ascom-standards.org/Help/Developer/html/P_ASCOM_DeviceInterface_ICameraV2_SensorType.htm

About the issue here, I continue to cleanup the ascom camera interface to avoid to send too much command to the driver and also to avoid any other query during the image download.
A new version 0.9.49 with this changes is available.
Can you try a series of bias for example, if possible using a configuration where tcp server is disable, autoguider is set to None and no planetarium connected.

Cedric Raguenaud

18-12-05 10:26

reporter   ~0005152

I'll try that now.

BTW, I had a thought: my focuser is connected from the control server via HTTP. So when CCDCiel requests temperature or tries to move the focuser, the request goes through an HTTP call (from the focuser driver) over wifi. Could it be where the winsock error comes from, rather than the camera?

Cedric Raguenaud

18-12-05 10:30

reporter   ~0005153

I tested with debug a few days ago and the last crash happened between write header and pad of image file:

2018-12-01T01:26:09.617 3: ASCOM.HomeMade.Focuser: Temperature: 7.5
2018-12-01T01:26:14.242 3: ASCOM.QHYCCD.Camera: start exposure.
2018-12-01T01:26:14.968 3: ASCOM.QHYCCD.Camera: status:2, image ready:False
2018-12-01T01:26:15.671 3: ASCOM.QHYCCD.Camera: status:2, image ready:False
2018-12-01T01:26:16.387 3: ASCOM.QHYCCD.Camera: status:2, image ready:False
2018-12-01T01:26:17.109 3: ASCOM.QHYCCD.Camera: status:2, image ready:False
2018-12-01T01:26:17.828 3: ASCOM.QHYCCD.Camera: status:2, image ready:False
2018-12-01T01:26:18.544 3: ASCOM.QHYCCD.Camera: status:4, image ready:False
2018-12-01T01:26:19.250 3: ASCOM.QHYCCD.Camera: status:0, image ready:True
2018-12-01T01:26:19.465 3: ASCOM.QHYCCD.Camera: read image.
2018-12-01T01:26:20.131 3: ASCOM.QHYCCD.Camera: width:5544 height:3684
2018-12-01T01:26:20.346 3: ASCOM.QHYCCD.Camera: set fits header
2018-12-01T01:26:20.562 3: ASCOM.QHYCCD.Camera: write header
2018-12-01T01:26:20.779 3: ASCOM.QHYCCD.Camera: write image
2018-12-01T01:26:21.682 3: ASCOM.QHYCCD.Camera: pad fits
2018-12-01T01:26:21.911 3: ASCOM.QHYCCD.Camera: display image
2018-12-01T01:26:27.470 3: ASCOM.QHYCCD.Camera: start exposure.
2018-12-01T01:26:28.185 3: ASCOM.QHYCCD.Camera: status:2, image ready:False
2018-12-01T01:26:28.898 3: ASCOM.QHYCCD.Camera: status:2, image ready:False
2018-12-01T01:26:29.617 3: ASCOM.QHYCCD.Camera: status:2, image ready:False
2018-12-01T01:26:30.340 3: ASCOM.QHYCCD.Camera: status:2, image ready:False
2018-12-01T01:26:31.059 3: ASCOM.QHYCCD.Camera: status:2, image ready:False
2018-12-01T01:26:31.769 3: ASCOM.QHYCCD.Camera: status:4, image ready:False
2018-12-01T01:26:32.483 3: ASCOM.QHYCCD.Camera: status:0, image ready:True
2018-12-01T01:26:32.701 3: ASCOM.QHYCCD.Camera: read image.
2018-12-01T01:26:33.368 3: ASCOM.QHYCCD.Camera: width:5544 height:3684
2018-12-01T01:26:33.584 3: ASCOM.QHYCCD.Camera: set fits header
2018-12-01T01:26:33.802 3: ASCOM.QHYCCD.Camera: write header

Patrick Chevalley

18-12-05 10:45

administrator   ~0005154

There is no direct interaction with the camera driver at this time, the program read the provided safearray and copy the data to a stream.

Can you try with and without the focuser, this is a serious candidate for the winsock issue.
Do you use other network connected devices?

Cedric Raguenaud

18-12-05 10:48

reporter   ~0005155

That's the only network-connected device I'm using at the moment that is linked to CCDCiel.

But I also have a home-made weather station and a home-made sky watcher that are used during sessions (but not linked to CCDCiel).

Cedric Raguenaud

18-12-05 10:50

reporter   ~0005156

What surprised me is that the focuser driver catches all exceptions from the HTTP connection. So nothing should go up to CCDCiel.

Patrick Chevalley

18-12-05 11:14

administrator   ~0005157

Yes but the stack is common.

CCDciel probably put too much load on it, I will look to reduce that the same way I do for the camera.
At the moment every second it ask for: Connected, Position, Temperature.
I can easily remove Connected and rely on exception to handle the case.
For Position and Temperature I can reduce the frequency, do you know the typical time it take to get this values?
If the driver do not support multi-tasking this can pose problem if the next query arrive before the first is completed.

But the first test is to run a long capture without the focuser connected to be sure this is a direction.

Cedric Raguenaud

18-12-05 14:05

reporter   ~0005158

With no guider and no focuser, I took 700 bias frames without problem. I'm now trying with the focuser.

In the meantime I've modified the focuser driver to protect the calls with a semaphore and limited the rate of temperature calls to avoid overload.

Patrick Chevalley

18-12-05 14:41

administrator   ~0005159

Good.
I commit a change to reduce the number of call to driver for all the devices and decrease polling frequency, for periodic check and when waiting for a movement to complete.
https://github.com/pchev/ccdciel/commit/f0218cf9a35d77d138c10d0c3619566cb410a5d3

Cedric Raguenaud

18-12-05 14:53

reporter   ~0005160

I just did the same on my local copy. I'll get your version.

Cedric Raguenaud

18-12-05 16:18

reporter   ~0005161

Just got an exception displaying an image. CCDCiel caught it and dealt with it fine then continued with the sequence.

Patrick Chevalley

18-12-05 16:52

administrator   ~0005162

Not evident because line 552 is the end of the timer procedure and further call are cleanup functions generated by the compiler.
Do you remember the exception code ?
Is an error message from a trapped exception in the log?

This look like the implicit release of the img variable that use TVarData. Maybe I must not call SafeArrayDestroy(img) ?

Cedric Raguenaud

18-12-05 17:53

reporter  

sigsegv.png (4,112 bytes)
sigsegv.png (4,112 bytes)

Cedric Raguenaud

18-12-05 17:53

reporter   ~0005164

I just another one, but this time the callstack isn't in the application.

callstack.png (33,209 bytes)
callstack.png (33,209 bytes)

Cedric Raguenaud

18-12-05 17:56

reporter  

callstack-2.png (48,728 bytes)
callstack-2.png (48,728 bytes)

Cedric Raguenaud

18-12-05 17:56

reporter   ~0005165

Another one just now.

sigsegv-2.png (4,226 bytes)
sigsegv-2.png (4,226 bytes)

Cedric Raguenaud

18-12-05 18:15

reporter   ~0005167

These last 2 errors didn't get recorded as winsock errors. So I think there are 2 causes of crashes: memory problems, probably related to the camera drivers, and network problems, probably related to the focuser.

The latter are much better now. Between the protection of sensitive zones with semaphores and caching edded in the driver, plus slower requests from CCDCiel, everything seems a lot stable. I haven't seen a winsock error since earlier this afternoon.

Cedric Raguenaud

18-12-05 18:58

reporter   ~0005168

I don't think you need to call SafeArrayDestroy. I removed the call and it doesn't look like CCDCiel is leaking memory and I haven't had a single crash. Presumably the garbage collector takes care of it.

memoryusage.png (20,024 bytes)
memoryusage.png (20,024 bytes)

Patrick Chevalley

18-12-05 19:13

administrator   ~0005169

Yes, this last bug is a totally different than the original problem.
The good new is I can reproduce it with the simulator in a virtual machine. Strangely I not get it if I boot my real machine on Windows. I investigate more tonight.

I look to remove this SafeArrayDestroy call if it is useless.

Cedric Raguenaud

18-12-05 19:19

reporter   ~0005170

I assume FPascal has garbage collection. I'd say that when you get data from a COM component, it is duplicated, so the COM component frees its copy and the garbage collector should take care of yours. It's certainly working well without it. 250 images so far without an error.

Cedric Raguenaud

18-12-05 20:11

reporter   ~0005171

Oh I see that FPascal is a cross compiler for the .Net CLR!

Cedric Raguenaud

18-12-05 20:21

reporter   ~0005172

Last edited: 18-12-05 20:21

View 2 revisions

600 images and no error! (with SafeArrayDestroy removed)

Patrick Chevalley

18-12-05 20:35

administrator   ~0005173

I also remove SafeArrayDestroy and since then I cannot reproduce the error.

Where do you find this FPascal?
FreePascal is a compiler that produce native code for a variety of processor. https://www.freepascal.org/

Cedric Raguenaud

18-12-05 20:41

reporter   ~0005175

I meant FreePascal. I thought I could see statistics related to it in terms of memory management, etc from the .Net CLR. But maybe it's because Windows somehow links all executables to the CLR. My days of assembly programming are far behind me so I no longer know how things work internally. It's not important.

Patrick Chevalley

18-12-05 21:56

administrator   ~0005178

OK, sure FreePascal use the system functionality for memory management.
And all this SafeArray function are finally mapped to oleaut32.dll because this is specific to Windows. The first time I read the Ascom documentation and see the data is returned as a safearray I scratched my head for a moment.

Patrick Chevalley

18-12-07 15:35

administrator   ~0005181

I think I can close the issue now but please reopen if necessary.

Issue History

Date Modified Username Field Change
18-11-20 14:53 Cedric Raguenaud New Issue
18-11-20 16:54 Patrick Chevalley Relationship added duplicate of 0002023
18-11-20 16:58 Patrick Chevalley Status new => feedback
18-11-20 16:58 Patrick Chevalley Target Version => 1.0
18-11-20 16:58 Patrick Chevalley Note Added: 0005114
18-11-20 17:51 Cedric Raguenaud Note Added: 0005116
18-11-20 17:51 Cedric Raguenaud Status feedback => new
18-11-20 18:43 Cedric Raguenaud Note Added: 0005117
18-11-20 19:11 Cedric Raguenaud Note Added: 0005118
18-11-20 19:28 Cedric Raguenaud Note Added: 0005119
18-11-20 19:30 Cedric Raguenaud Note Added: 0005120
18-11-20 19:31 Cedric Raguenaud File Added: Screenshot_2018-11-20-19-27-18-305_com.microsoft.rdc.android.png
18-11-20 19:31 Cedric Raguenaud Note Added: 0005121
18-11-20 21:54 Patrick Chevalley Note Added: 0005122
18-11-26 16:59 Cedric Raguenaud Note Added: 0005134
18-11-27 10:14 Patrick Chevalley Note Added: 0005135
18-11-27 10:59 Cedric Raguenaud Note Added: 0005136
18-11-29 17:00 Patrick Chevalley Note Added: 0005138
18-11-29 17:01 Patrick Chevalley Status new => feedback
18-11-30 10:20 Patrick Chevalley Relationship added has duplicate 0002032
18-11-30 11:44 Patrick Chevalley Note Added: 0005141
18-11-30 11:51 Cedric Raguenaud Note Added: 0005142
18-11-30 11:51 Cedric Raguenaud Status feedback => new
18-11-30 13:01 Cedric Raguenaud Note Added: 0005143
18-11-30 13:37 Patrick Chevalley Note Added: 0005144
18-11-30 13:40 Patrick Chevalley Note Added: 0005145
18-11-30 14:07 Cedric Raguenaud Note Added: 0005146
18-11-30 15:42 Patrick Chevalley Note Added: 0005147
18-11-30 15:54 Cedric Raguenaud Note Added: 0005148
18-12-05 09:55 Patrick Chevalley Status new => feedback
18-12-05 09:55 Patrick Chevalley Note Added: 0005151
18-12-05 10:26 Cedric Raguenaud Note Added: 0005152
18-12-05 10:26 Cedric Raguenaud Status feedback => new
18-12-05 10:30 Cedric Raguenaud Note Added: 0005153
18-12-05 10:45 Patrick Chevalley Note Added: 0005154
18-12-05 10:48 Cedric Raguenaud Note Added: 0005155
18-12-05 10:50 Cedric Raguenaud Note Added: 0005156
18-12-05 11:14 Patrick Chevalley Note Added: 0005157
18-12-05 14:05 Cedric Raguenaud Note Added: 0005158
18-12-05 14:41 Patrick Chevalley Note Added: 0005159
18-12-05 14:53 Cedric Raguenaud Note Added: 0005160
18-12-05 16:18 Cedric Raguenaud File Added: ccdciel-callstack-051218.png
18-12-05 16:18 Cedric Raguenaud Note Added: 0005161
18-12-05 16:52 Patrick Chevalley Note Added: 0005162
18-12-05 17:53 Cedric Raguenaud File Added: sigsegv.png
18-12-05 17:53 Cedric Raguenaud File Added: callstack.png
18-12-05 17:53 Cedric Raguenaud Note Added: 0005164
18-12-05 17:56 Cedric Raguenaud File Added: callstack-2.png
18-12-05 17:56 Cedric Raguenaud File Added: sigsegv-2.png
18-12-05 17:56 Cedric Raguenaud Note Added: 0005165
18-12-05 18:15 Cedric Raguenaud Note Added: 0005167
18-12-05 18:58 Cedric Raguenaud File Added: memoryusage.png
18-12-05 18:58 Cedric Raguenaud Note Added: 0005168
18-12-05 19:13 Patrick Chevalley Note Added: 0005169
18-12-05 19:19 Cedric Raguenaud Note Added: 0005170
18-12-05 20:11 Cedric Raguenaud Note Added: 0005171
18-12-05 20:21 Cedric Raguenaud Note Added: 0005172
18-12-05 20:21 Cedric Raguenaud Note Edited: 0005172 View Revisions
18-12-05 20:35 Patrick Chevalley Note Added: 0005173
18-12-05 20:41 Cedric Raguenaud Note Added: 0005175
18-12-05 21:56 Patrick Chevalley Note Added: 0005178
18-12-07 15:35 Patrick Chevalley Assigned To => Patrick Chevalley
18-12-07 15:35 Patrick Chevalley Status new => resolved
18-12-07 15:35 Patrick Chevalley Resolution open => fixed
18-12-07 15:35 Patrick Chevalley Note Added: 0005181