Crash when loading external dll (DllImport)

nadavnadav Posts: 3
edited August 25, 2015 12:45PM in ANTS Performance Profiler 9
Hello.
I'm using Ants Performance Profiler version 9.2.0.485.
My program is using external dll (written in C++), when the program needs to load the dll (using DllImport) the profiler crash.
When the program is running regularly (not with the profiler) there is no crash.

Comments

  • Jessica RJessica R Posts: 1,319 Rose Gold 4
    Hi nadav,

    Thanks for your post and sorry to hear you're experiencing an issue with the profiler!

    To help us understand what's going wrong, can I please check:

    - Are there any error details when the crash occurs? If an error dialog box from Red Gate appears after the crash asking if you'd like to send a report to us, please do send one in with your email address included.
    - Are there any additional errors in Event Viewer (Windows log >Application) regarding the profiler or your application?
    - Does it make any difference what profiling mode you use (i.e. line-level timings, method-level timings, or sampling)?

    Thank you!

    Jessica Ramos | Product Support Engineer | Redgate Software

    Have you visited our Help Center?


  • I build a small project that calls the external DLL and print row to console after it finished.
    When I tried to run this project via Ants Performance Profiler we can see the following rows in the console:
    "OMP:< Error #178: Function SetThreadAffinityMask() failed:
    OMP: System error # 2147487259: Unspecified error.

    There are no errors in the event viewer and there are no other exceptions.

    * This error can be seen only if you change the profiling mode to sample method level timings, in higher mode there are no error only stop the process.
  • Jessica RJessica R Posts: 1,319 Rose Gold 4
    Hi nadav,

    I've emailed the following workaround, but please let us know if you're still running into issues!

    ----

    That particular error that's coming up when you're profiling actually happens because your application sets its own CPU affinity mask and the profiler will try to set this as well (when using a non-sampling mode). Since the profiler will have already set it, the application will throw an error when calling the SetThreadAffinityMask() function. To get around the error though, you can disable the profiler from setting the mask. In the profiler settings file:

    %localappdata%Red GateANTS Performance Profiler 9PerformanceProfilerSettings.xml

    please change:

    <Property Name="UseThreadAffinity">
    <Object Type="System.Boolean">True</Object>
    </Property>

    to

    <Property Name="UseThreadAffinity">
    <Object Type="System.Boolean">False</Object>
    </Property>

    Jessica Ramos | Product Support Engineer | Redgate Software

    Have you visited our Help Center?


  • neutrinoneutrino Posts: 1 New member
    Same here. I have just downloaded the trial version and started to profile our SW. The program crashed with the same error.

    Changing the setting in the XML file like mentioned didn't help. 
    The program continues to crash.
Sign In or Register to comment.