I think I had similar issues on Windows. I used this to sort them out: https://github.com/pyinstaller/pyinstaller/wiki/Recipe-subprocess It's written for Windows but maybe you can adapt it to work for Mac
On Wednesday, September 29, 2021 at 2:34:31 PM UTC-7 justin...@gmail.com wrote: > On Thu, Sep 30, 2021 at 9:13 AM Benjam901 <benandr...@gmail.com> wrote: > >> - I am unsure of the major differences but yes I need it compiled to a >> .app instead of a .exe >> - The crash itself I suspect to be a segfault, previously for unknown >> reasons my IDE was crashing with a SIGABRT error. > > > I've seen this kind of crash when something in python raises an exception > in certain Qt contexts like in a signal handler, or somewhere async where > the Qt stack freaks out from the python exception. > > >> - The path to ffmpeg is absolute and uses QStandardPaths to locate the >> documents folder where ffmpeg lives. >> - I have unthreaded the process and it is still the same issue, I will >> try additionally ro run a subprocess to open terminal or some other native >> app. >> > > That is a great debugging point. So then I would focus further on > debugging without a QThread involved since it seems to have no impact on > the crash. > > >> - QProcess I came across recently, what is the major difference between >> QProcess & QThread? Is it the same difference as Threading & >> Multiprocessing? >> > > In this case I don't think its a matter of threading + multiprocessing > since you are using subprocess to exec. We have seen python/qt specific > bugs around that though. > You could try QProcess to at least isolate subprocess as the problem, > since it would be using an entirely different way to launch the child > process. > > >> >> I get this error weirdly irregularly and is hard to repro 100%. It pops >> up and then goes away... >> >> *QThread: Destroyed while thread is still running* >> *Fatal Python error: Aborted* >> *Process finished with exit code 134 (interrupted by signal 6: SIGABRT)* >> > > I think that is saying that your python QThread object reference is being > destroyed, before the underlying system thread has finished. Are you > keeping a reference to it while it is still running either by holding the > python object, or by having it parented to a Qt object? > > >> >> // Ben >> >> On Wednesday, 29 September 2021 at 19:30:32 UTC+2 justin...@gmail.com >> wrote: >> >>> On Thu, Sep 30, 2021 at 4:34 AM Benjam901 <benandr...@gmail.com> wrote: >>> >>>> Hello all, >>>> >>>> It is time to finally get a project out as open source but I am having >>>> a serious roadblock issue with subprocess. >>>> >>>> - In the code I create a new QThread for the subprocess function to run >>>> on. >>>> - Once the QThread is running I use subprocess.run() OR >>>> subprocess.Popen (whatever works) to call ffmpeg to convert some audio >>>> files. >>>> >>>> This works within PyCharm HOWEVER as soon as I package it up into a >>>> .app for mac it crashes immediately upon trying to run the subprocess >>>> without any errors or stacktrace. >>>> >>>> Has anyone had any issues like this before, I would really like this >>>> project to be finished and this is the last blocker >>>> >>> >>> You are developing on a mac as well and the only difference is source vs >>> app packaging? >>> Is the crash a segfault? >>> Is the path to ffmpeg an absolute path or is it relying on $PATH which >>> may be different in the app? >>> Can you successfully run a subprocess command in the packaged app >>> without a QThread (is the QThread the factor)? >>> Have you tried QProcess? >>> >>> >>>> Cheers, >>>> >>>> Ben >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Python Programming for Autodesk Maya" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to python_inside_m...@googlegroups.com. >>>> To view this discussion on the web visit >>>> https://groups.google.com/d/msgid/python_inside_maya/672ff5b3-ceac-4d42-acaf-c448ea375013n%40googlegroups.com >>>> >>>> <https://groups.google.com/d/msgid/python_inside_maya/672ff5b3-ceac-4d42-acaf-c448ea375013n%40googlegroups.com?utm_medium=email&utm_source=footer> >>>> . >>>> >>> -- >> You received this message because you are subscribed to the Google Groups >> "Python Programming for Autodesk Maya" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to python_inside_m...@googlegroups.com. >> > To view this discussion on the web visit >> https://groups.google.com/d/msgid/python_inside_maya/ee782b0c-7cae-4807-8d8b-5363660f5328n%40googlegroups.com >> >> <https://groups.google.com/d/msgid/python_inside_maya/ee782b0c-7cae-4807-8d8b-5363660f5328n%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/efe024c8-1689-49ef-bba3-def4bc282d56n%40googlegroups.com.