Cycling74 / min-api

High-level C++-language application programming interface for Max
MIT License
58 stars 23 forks source link

Crashes with deferred messages #140

Closed tap closed 4 years ago

tap commented 4 years ago

Report from MR:

These crashes occur on both platforms, but perhaps are more reproducible on Windows (?), for example when an external is used in a M4L patch within a rack. The error happens here:

void deferred_message::pop() {
deferred_message x;
m_owning_message->m_deferred_messages.try_dequeue(x);
x.m_owning_message->m_function(m_args, m_inlet);
}

because after try_dequeue x can be null

I've also personally seen this in the context of the rad.waveslice~ help patcher (a project on a local machine).

tap commented 4 years ago

Here is another example of the same crash using min.phasor~ with input coming from the scheduler thread. The source of this report is Cycling74/min-devkit#139

{
    "boxes" : [         {
            "box" :             {
                "maxclass" : "newobj",
                "text" : "mtof",
                "id" : "obj-3",
                "patching_rect" : [ 193.0, 159.0, 32.0, 22.0 ],
                "outlettype" : [ "" ],
                "numinlets" : 1,
                "numoutlets" : 1
            }

        }
,       {
            "box" :             {
                "maxclass" : "newobj",
                "text" : "notein",
                "id" : "obj-2",
                "patching_rect" : [ 169.0, 66.0, 41.0, 22.0 ],
                "outlettype" : [ "int", "int", "int" ],
                "numinlets" : 1,
                "numoutlets" : 3
            }

        }
,       {
            "box" :             {
                "maxclass" : "newobj",
                "text" : "min.phasor~",
                "id" : "obj-1",
                "patching_rect" : [ 217.0, 228.0, 75.0, 22.0 ],
                "outlettype" : [ "signal" ],
                "numinlets" : 1,
                "numoutlets" : 1
            }

        }
 ],
    "lines" : [         {
            "patchline" :           {
                "source" : [ "obj-3", 0 ],
                "destination" : [ "obj-1", 0 ]
            }

        }
,       {
            "patchline" :           {
                "source" : [ "obj-2", 0 ],
                "destination" : [ "obj-3", 0 ]
            }

        }
 ],
    "appversion" :  {
        "major" : 8,
        "minor" : 1,
        "revision" : 1,
        "architecture" : "x64",
        "modernui" : 1
    }
,
    "classnamespace" : "box"
}