Rocket U2 | UniVerse & UniData

 View Only

 Abnormal termination of UniVerse. Fault type is 11. Layer type is Verb.

Dave Evans's profile image
Dave Evans posted 01-12-2023 14:45


I've added 3 attachments
    file "OPENPYXLTEST.txt"   is this basic program that calls Python program named "openpyxlText.py".  From inside an Accuterm7  windows I RUN OPENPYXLTEST program 3 consecutive times. with out changing any code  or anything.  I get the output below.     

As a test I ran this python code in Linux and windows neither test caused an error nor OS failure.

 We are using universe 11.3.4 
The python openpyxl library is the most recent available.  I've attached the requirements20230111.txt file also that I created yesterday.

I have a few print() statements in python code to show the flow.
====== output from python openpyxlTest.py from AccuTerm 7 window ======
>RUN OPENPYXLTEST
Called build_u2_object
Loading variables
return control to U2
loaded start_U2excel method
At top of method, load_csv_from_file()
loading openpyxl library
Just after import openpyxl line
ran load_csv()
>
>
>RUN OPENPYXLTEST
Called build_u2_object
Loading variables
return control to U2
loaded start_U2excel method
At top of method, load_csv_from_file()
loading openpyxl library        <----------------------------------------------------------- line after this print() , is where it fails.  Importing openpyxl library
/disk1/mv-pkg/Python-3.9.2/Modules/_decimal/libmpdec/context.c:57:
warning: mpd_setminalloc: ignoring request to set MPD_MINALLOC a second time

load csv error Objects/structseq.c:401: bad argument to internal function
ran load_csv()
>
>
>RUN OPENPYXLTEST
Abnormal termination of UniVerse.
Fault type is 11. Layer type is Verb.
Derek Hayse's profile image
PARTNER Derek Hayse
Hi Dave - only two attachments  are visible...
Dave Evans's profile image
Dave Evans
I added the 3rd upload file.  I found the upload process does not allow files with .py extensions to be uploaded.  I change the name of the file by adding  .txt as the extension.
Jonathan Smith's profile image
ROCKETEER Jonathan Smith
Dave,

Could you retry running the program 3 times but before you do enter the command 'REINIT.PYTHON OFF'
Dave Evans's profile image
Dave Evans
Jonathan Smith,
Thank you for your suggestion,  not sure where that command came from.

My results:   
       I tried your command "REINIT.PYTHON OFF" before running my test program, I received no more memory alloc errors....   It worked. I was all smiles. 

Sooooooo, I decided to test more.

Bottomline:
UniVerse 11.3.4 session will NOT unset the REINIT.PYTHON flag, even after running REINIT.PYTHON ON and checking REINIT.PYTHON STATUS (showed "ON").   I have to close the term window(session) and re-log in to get REINIT.PYTHON flag set back ON at session level.

Testing:
I tested by changing my python program to print some garbage.  It would not print the garbage.  I had to close my accuterm7 window and re-log  in the UniVerse TCL prompt.  Then I ran the python program and the garbage printed.   I set Reinit to OFF and back ON.  After doing that, I removed my garbage print statement from python(saved it), then ran the basic program which calls the python test program and I continued to get the garbage.  Reinit did not set back to ON.

I did one more test. 
I reloaded my TCL window and modified  my basic program, at the top I added EXECUTE "REINIT.PYTHON OFF" and at the bottom I added EXECUTE "REINIT.PYTHON ON" . I ran my test program 3 times and received the memory alloc error and crashed my session.  So running the commands with-in a basic program will not work.  Hey Rocket,  This would be a great addition.
We wrote a small basic program to just run
     EXECUTE "REINIT.PYTHON OFF" 
then run: 
    EXECUTE "REINIT.PYTHON STATUS"
then run
     EXECUTE "REINIT.PYTHON ON"
then run:
     EXECUTE "REINIT.PYTHON STATUS"

The output showed what we wanted to see    First status output showed OFF,  Second status output showed ON.
Jonathan Smith's profile image
ROCKETEER Jonathan Smith
Dave,

The problem with  the 'REINIT.PYTHON ON' after issuing a 'REINIT.PYTHON OFF' is a known problem and will be fixed in a later release of both UniVerse (and UniData).  The reason why the verb was introduced is it each time python is invoked from UniVere or UniData the python environment itself is re-initalized. The problem that you saw with the re-initialization turned on is that depending on the coding techniques and assumptions made in the Python code being used, the implied re-initialization of the Python environment might not be supported when used for a second time in the same session.

Regards,