Maya memory leak + crash on C++ MNodeMessage::addNodeDirtyPlugCallback

Maya memory leak + crash on C++ MNodeMessage::addNodeDirtyPlugCallback

Anonymous
Not applicable
990 Views
3 Replies
Message 1 of 4

Maya memory leak + crash on C++ MNodeMessage::addNodeDirtyPlugCallback

Anonymous
Not applicable

Hi,

 

When attaching callbacks with MNodeMessage::addNodeDirtyPlugCallback and MDagMessage::addWorldMatrixModifiedCallback on a Light Shape node at the same time, maya starts building up memory until it crashes.

 

Steps to reproduce:

 

In a custom maya plugin attach callbacks with the aforementioned functions to a MFn::kLight node's shape. When starting to move the light around in the scene, maya starts to leak massive amounts of memory (it fills 16gig of memory within seconds) until it crashes. Note that the callbacks fire correctly as they should - they stop fireing once u stop moving, there is no obvious recursion involved. Even if the callbacks are completely emty maya keeps crashing - registering the callbacks alone is enough to trigger the memory leak.

 

Also, this behaviour seems to be exclusive to light nodes. Registering for several different types of callbacks work fine on Mesh nodes and custom shader nodes.

 

Any hints on this? The API doc does not state that it is not allowed to register for different kinds of callbacks. I also don't see a reason why this should not work or why it should lead to such a massive memory leak.

 

PS: I'm using maya 2017 update 3

 

 

0 Likes
991 Views
3 Replies
Replies (3)
Message 2 of 4

kevin.picott
Alumni
Alumni

That sounds serious, and there is no reason for that kind of restriction to exist. Registering for multiple callbacks is perfectly reasonable. You're 100% certain it's not the contents of the callback that's leaking memory?

 

I'm filing this in our internal bug tracking system and linking it back to this post for updating if a cause is found.



Kevin "Father of the DG" Picott

Senior Principal Engineer
0 Likes
Message 3 of 4

ashaiad6194
Alumni
Alumni

Can you please give us more info

OS, OS version, plugin sample, sample scene (if possible)

Thanks

Ash

0 Likes
Message 4 of 4

Anonymous
Not applicable

Hi,

 

 

I'll try to reproduce the issue with a smaller piece of code. I'll post here if it's done,

 

Regards and thx,

 

florian putz

0 Likes