Crash of a ZOS-API Python application

  • 7 March 2021
  • 4 replies
  • 121 views

Hi,


We are using the python interface to ZOS-API and for some reason it is crashing out. To Debug we attempted to check the app objects precense with the following: 


    logMessage('App Object Check: '+str(zos.TheApplication))


and it indicates correctly that the object exists:


     App Object Check: ZemaxUI.Common.ViewModels.ZOSAPI_Application


However immediatly after that call it crashes out with the following:


System.Runtime.Remoting.RemotingException: Object '/ef964475_20c0_44b1_b91a_d1be251d9e4c/yqd6tswp6jnufd1newpgn9sc_1.rem' has been disconnected or does not exist at the server.


Server stack trace: 

   at System.Runtime.Remoting.Channels.ChannelServices.CheckDisconnectedOrCreateWellKnownObject(IMessage msg)

   at System.Runtime.Remoting.Channels.ChannelServices.DispatchMessage(IServerChannelSinkStack sinkStack, IMessage msg, IMessage& replyMsg)


Exception rethrown at [0]: 

   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)

   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)

   at System.Object.ToString()

   at Python.Runtime.ClassBase.tp_str(IntPtr ob)


Have any ZOS-API users reported such behaviour? and if so are there any remedies or clues as to what might be happening?


Secondly, what is the ZOSAPI.APINetCallback for? and how can we use it? As I have a suspicion that it's related to the above crash, or could help solve it. I'm interested in using InitializeLifetimeService() however I did not see it in any examples provided. 


Your help would be greatly appreciated.


4 replies

Badge

Hi Jingran!


 


Looks like a weird error. I personally have not experienced these specific errors, but a couple of questions.


1. Which python version are you using? I usually use either 3.7 or 3.8. Never had big problems with those versions so far.


2. Do you experience the crash only in the standalone application mode? Sometimes I do have the issues with the Standalone applications, since if you forget to delete the class instance at the end of your program, re-running it causes crashes from time to time. Does the Interactive mode leads to the same crash?


3. Any chance to see some of your code?


 

Userlevel 6
Badge +2

Hi Jingran


I would recommend trying one of our sample files \ZOS-API Sample Code\Python and let us know if you observe the same behaviour.


Sandrine

Userlevel 6
Badge +2

I don't know what ZOSAPI.APINetCallback is. I will check with our developers.

Userlevel 6
Badge +2

Hi Jingran,


I have asked the developers and ZOSAPI.APINetCallback is a new interface that we internally call “in-process API”. It is not fully functional yet, which is why it is not documented. It still appears in ZOS-API Syntax help because our help is automatically generated. When it will be ready, the main benefit of it for API users would be an increased speed when using UDOCs.


So I don't think it is relevant for your case. Thank you.


Sandrine

Reply