xcist / main

simulation and reconstruction package
BSD 3-Clause "New" or "Revised" License
45 stars 20 forks source link

Error running Sim_Sample_XCAT.py: Bus error and leaked semaphore warning #68

Closed tims3900 closed 4 months ago

tims3900 commented 4 months ago

Hello, I am going through the gecatsim/examples directory and am encountering an error while trying to run Sim_Sample_XCAT.py. Upon execution, I receive the following error message:

zsh: bus error python3 Sim_Sample_XCAT.py /opt/miniconda3/envs/ct_sim/lib/python3.11/multiprocessing/resource_tracker.py:254: UserWarning: resource_tracker: There appear to be 1 leaked semaphore objects to clean up at shutdown warnings.warn('resource_tracker: There appear to be %d '

zhangjy-ge commented 4 months ago

Hi,

I was not able to reproduce your errors running xcist on a Ubuntu system with BASH. I would suggest you to: 1) provide more details such as system you are running on (software/hardware), the xcist version, other output info, etc 2) try to locate the line/input parameter in xcist that causes you an error so that we can try to debug without reproducing your errors 3) rerun the simulations on a different system and see if you still have this error.

Best, Jiayong

tims3900 commented 4 months ago

I am currently running on an Intel-based Mac with Python 3.9.19, utilizing the main branch of the xcist repository. I am able to successfully run all other examples except for Sim_Sample_XCAT.py. Here are the steps I took to reproduce this error:

  1. Cloned the repo and called pip install .
  2. Created a new directory phantom (~/Desktop/ct_sim/main/phantom) and placed vmale50_chest_phantom.nrb inside (from this repo)
  3. ran python3 Sim_Sample_XCAT.py from getcatsim/examples directory This was the output before receiving the error message:
    (ctsim)  ~/Desktop/ct_sim/main/gecatsim/examples$ python3 Sim_Sample_XCAT.py 
    Airscan
    Offset scan
    Phantom scan
    phantom scan view loop...
    0%|                                                        | 0/2 [00:00<?, ?it/s]
    Starting to parse nCAT phantom.
    Done parsing nCAT phantom.
    zsh: bus error  python3 Sim_Sample_XCAT.py
    (ctsim)  ~/Desktop/ct_sim/main/gecatsim/examples$ /opt/miniconda3/envs/ctsim/lib/python3.9/multiprocessing/resource_tracker.py:216: UserWarning: resource_tracker: There appear to be 1 leaked semaphore objects to clean up at shutdown
    warnings.warn('resource_tracker: There appear to be %d '
zhangjy-ge commented 3 months ago

This issue has been fixed in the latest version of xcist, which is presumably due to the difference between clang and gcc when running multi-threaded programs.. Please let us know if you see further issues.