playMaker

Author Topic: Playmaker causing exception "Non matching Profiler.EndSample"  (Read 11078 times)

mindlube

  • Playmaker Newbie
  • *
  • Posts: 32
    • View Profile
Playmaker causing exception "Non matching Profiler.EndSample"
« on: October 22, 2012, 11:27:36 AM »
I have a scene using Playmaker + Unity (4.0b12), which prints this exception only when the Profiler window is open::

Non matching Profiler.EndSample (BeginSample and EndSample count must match)
(Filename: /Applications/buildAgent/work/a0f11f3559d72c6d/Runtime/Profiler/Profiler.cpp
Line: 525)

I opened a bug report with with Unity, but they closed it saying it's because, as the exception says, there are not a matching number of BeginSample and EndSample. They identified that playmaker.dll is where the profiler calls are coming from.

Can you please remove BeginSample/EndSample calls from the .dll? Or is there something I can turn off in the playmaker preferences? I haven't used any actions that would cause this. Pretty much just using like Invoke Method, and Start Coroutine in my state actions.


edit: I also went & submitted this report using the Playmaker menus report bug tool. forgot about that before.
« Last Edit: October 26, 2012, 10:42:51 PM by mindlube »

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3893
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: Playmaker causing exception "Non matching Profiler.EndSample"
« Reply #1 on: December 03, 2012, 10:55:38 AM »
I think this is a bug in Unity 4. The dll doesn't include any BeginSample/EndSample calls...

I sent Unity this info, but I didn't have a bug number, so I'm not sure if it reached the right person. Perhaps you can re-open your bug with this info:

This command used in EditorWindow.Update seems to cause the exception in Unity 4:

window.SendEvent(EditorGUIUtility.CommandEvent("RepaintAll"));

RepaintAll is my own command that triggers a repaint of all Playmaker windows. I have to use SendEvent because the EditorWindow class is outside the dll, a legacy from the days before EditorWindows could be put in dlls.

This code works fine in 3.4.x and 3.5.x, but throws an exception in 4.0

My guess is EditorWindow.SendEvent is jumping into the middle of some internal BeginSample/EndSample group...?

mindlube

  • Playmaker Newbie
  • *
  • Posts: 32
    • View Profile
Re: Playmaker causing exception "Non matching Profiler.EndSample"
« Reply #2 on: December 03, 2012, 11:55:31 AM »
Thanks Alex, your last email actually went to the right place (appended to Unity case # 494631)
It's still open and supposedly passed along to the Unity devs.
Cheers

sgoon

  • Playmaker Newbie
  • *
  • Posts: 8
    • View Profile
Re: Playmaker causing exception "Non matching Profiler.EndSample"
« Reply #3 on: February 04, 2013, 04:27:33 AM »
Any new info on this, or a temporary workaround? This just started happening to me, and its making it impossible to profile my game correctly, which is kind of a problem. Is the unity case number you mentioned for this specific issue, because if so, I can add my voice to the "please get this fixed" chorus to unity.

-Sean

Update:

and just like that, to spite me, it stopped again... so not urgent, but I'd still be happy to help bug unity to get it resolved if that helps at all (assuming mine wasn't just a freak occurance).
« Last Edit: February 04, 2013, 04:44:34 AM by sgoon »

mindlube

  • Playmaker Newbie
  • *
  • Posts: 32
    • View Profile
Re: Playmaker causing exception "Non matching Profiler.EndSample"
« Reply #4 on: February 04, 2013, 01:12:41 PM »
Yep, the Unity bug report is still open- I just bumped it on the Unity-beta group.

By the way, there is an inconvenient but simple work around: just unclick the "Error Pause" button in the Console. Then the Profiler will actually work fine, but your game wont pause on errors.

cmvrgr

  • Junior Playmaker
  • **
  • Posts: 64
    • View Profile
Re: Playmaker causing exception "Non matching Profiler.EndSample"
« Reply #5 on: March 01, 2013, 07:55:24 PM »
any news on that bug ?

mindlube

  • Playmaker Newbie
  • *
  • Posts: 32
    • View Profile
Re: Playmaker causing exception "Non matching Profiler.EndSample"
« Reply #6 on: March 01, 2013, 09:48:30 PM »
No news, bug 494631 is still open. Maybe Alex Chouls can exert some pressure on Unity devs. The bug has been open since 10/19/2012.

mindlube

  • Playmaker Newbie
  • *
  • Posts: 32
    • View Profile
Re: Playmaker causing exception "Non matching Profiler.EndSample"
« Reply #7 on: March 01, 2013, 09:50:26 PM »
Actually wait! I think it is actually fixed in Unity 4.1 (I am using a beta)