FIXED: MQTT crash - Potential conflict with custom dll in python

Hello Derivative team,

We’re encountering a crash with something we built, it’s pretty specific but I was hoping we could get your help with this.

Here’s some background: Internally we use a standardized api for all our monitoring/show control purposes for all software which is called “tasktoolkit”. To avoid the burden of every single software team having to implement and maintain the api we have created a dll that can be loaded into all softwares which takes care of everything for us. In the case of TouchDesigner this dll is being loaded through a python module called “pulse” and is running in another thread. It’s important to note that the dll does some communication through the mqtt protocol but uses its own version of the paho library (contained in the python package) and not the TouchDesigner mqtt operator.

So the crash we are getting happens when using the “pulse” library and having a native TouchDesigner mqtt operator in our project. But for the crash to happen there has to be an info CHOP with the “connected” channel linked to the mqtt node or we must be actively polling the isConnected python member of the mqtt class. Note that for the crash to happen the mqtt operator and the “pulse” library don’t have to necessarily be connected to a broker. Also it is worth mentioning that I’ve tested that the crash is happening on Windows in the latest stable release.

I’ve attached attached a zip file with files to be able to reproduce the crash. The “main.toe” will not crash as there is no mqtt operator with a connected info CHOP in the project and the “mainWithCrash.toe” will crash after a few seconds (the time is pretty variable but it will crash pretty quickly after opening the project). In the lib folder there’s the “pulse” python library and in the PULSE folder there’s a modified version of the component we use in TouchDesigner along with its extension that imports the “pulse” library. On some computers I also had to install vc_redist 2022 for our dll to function properly which you can find the link to here: Latest supported Visual C++ Redistributable downloads | Microsoft Learn.

We imagine there is some sort of conflict happening here with the mqtt libraries and we were hoping you could give us a hand in debugging this.

Thanks in advance

Alex

PULSE_diagnostic.zip (2.2 MB)

Hey @alexandrelu

Thanks for the report.

This is logged for a developer to look into it and get back to you.

Best,
Michel

@alexandrelu

This should be fixed in build 2022.35230+

Thanks for the report,

Best,
Michel

Hey @JetXS

Just making sure here, but do you mean in future builds above 2022.35280. Because I still get the crash in 2022.35280.

Alex

Apologies @alexandrelu

2022.35300+

Best,
Michel