ReferenceError: attempt to access a null-pointer, when finishing Python script running

Hello.

I get this error, while using other packages.
Can anybody help me to find out where is the problem?

Thank you in advance.

ICE default IO error handler doing an exit(), pid = 304542, errno = 32
Exception in thread Thread-1:
Traceback (most recent call last):
File “/opt/anaconda3/envs/python39/lib/python3.9/threading.py”, line 980, in _bootstrap_inner
self.run()
File “/opt/anaconda3/envs/python39/lib/python3.9/threading.py”, line 917, in run
self._target(*self._args, **self._kwargs)
File “/opt/anaconda3/envs/python39/lib/python3.9/site-packages/ROOT/_application.py”, line 91, in _process_root_events
gSystem.ProcessEvents()
ReferenceError: attempt to access a null-pointer

_ROOT Version: 6.28
_Platform: Ubuntu 20.04.3

Hi @David_Israyelyan,

thank you for your question. Could you tell us what exactly you are trying to run and what are the other packages that you mention?

Cheers,
Marta

Hi @mczurylo,

Thank you for your reply.

I am trying to run the Fermi-LAT analysis package, and it works fine, but when it comes to the last lines of the script it throws this error message and exits with an error.

In my script, I am using the multiprocessing package, for better and faster performance. In the previous version, I have never met this error message. I have just updated ROOT to the 6.28 version and got this error message.

Hi @David_Israyelyan,

thanks for giving us more details. Maybe @vpadulan has an idea what might be going on?

Cheers,
Marta

Dear @David_Israyelyan ,

The error you report is probably too generic to point to a specific problem in your code. A minimal reproducer of what you are trying to do would help in understanding the issue.

In general, I could think that your different processes are using some ROOT objects and they are not properly cleaned up when they finish. The presence of gSystem.ProcessEvents() kind of tells me that you are running some type of GUI, but not much more.

Cheers,
Vincenzo

@mczurylo @vpadulan Thank you for your response. I will try briefly summarize what I an doing.

I have a Python script that performs fully automated Fermi-LAT analysis and calculates LightCurves using an adaptive method. As a part of the script, I am using some C++ code, which is imported into the Python environment through ROOT. The script has been functioning properly until recently.

Here’s how I import the C++ code into my Python script:

from ROOT import gROOT

gROOT.SetStyle(“Plain”)
gROOT.LoadMacro(“cutils/TS_estimate_P8.C++”)

from ROOT import initialize_TS, get_E1, psf

Issue:
When my script finishes running, instead of closing cleanly, it throws the following error message:

ICE default IO error handler doing an exit(), pid = 372539, errno = 32
Exception in thread Thread-1:
Traceback (most recent call last):
File “/opt/anaconda3/envs/python39/lib/python3.9/threading.py”, line 980, in _bootstrap_inner
self.run()
File “/opt/anaconda3/envs/python39/lib/python3.9/threading.py”, line 917, in run
self._target(*self._args, **self._kwargs)
File “/opt/anaconda3/envs/python39/lib/python3.9/site-packages/ROOT/_application.py”, line 91, in _process_root_events
gSystem.ProcessEvents()
ReferenceError: attempt to access a null-pointer

I will be very thankful If someone may help me to resolve this problem.
Seems Python cant peacefully exit ROOT, that’s why I am getting this error. But I have no idea how can I resolve this.
Thank you.

Dear @David_Israyelyan ,

As I mentioned, without a minimal reproducer I can only make guesses. It seems clear that the problem is in exiting the Python interpreter and doing the cleanup of ROOT objects. Maybe @pcanal or @Axel have a more concrete opinion.

Cheers,
Vincenzo

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.