Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6634897
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T22:59:05+00:00 2026-05-25T22:59:05+00:00

I created a C++ DLL function that uses several arrays to process what is

  • 0

I created a C++ DLL function that uses several arrays to process what is eventually image data. I’m attempting to pass these arrays by reference, do the computation, and pass the output back by reference in a pre-allocated array. Within the function I use the Intel Performance Primitives including ippsMalloc and ippsFree:

Process.dll

int __stdcall ProcessImage(const float *Ref, const float *Source, float *Dest, const float *x, const float *xi, const int row, const int col, const int DFTlen, const int IMGlen)
{
int k, l;
IppStatus status;
IppsDFTSpec_R_32f *spec;
Ipp32f *y = ippsMalloc_32f(row),
    *yi = ippsMalloc_32f(DFTlen),
    *X = ippsMalloc_32f(DFTlen),
    *R = ippsMalloc_32f(DFTlen);

for (int i = 0; i < col; i++)
{
    for (int j = 0; j < row; j++)
        y[j] = Source[j + (row * i)];
    status = ippsSub_32f_I(Ref, y, row);

            // Some interpolation calculations calculations here

    status = ippsDFTInitAlloc_R_32f(&spec, DFTlen, IPP_FFT_DIV_INV_BY_N, ippAlgHintNone);
    status = ippsDFTFwd_RToCCS_32f(yi, X, spec, NULL);
    status = ippsMagnitude_32fc( (Ipp32fc*)X, R, DFTlen);

    for (int m = 0; m < IMGlen; m++)
        Dest[m + (IMGlen * i)] = 10 * log10(R[m]);
}
_CrtDumpMemoryLeaks();

ippsDFTFree_R_32f(spec);
ippsFree(y);
ippsFree(yi);
ippsFree(X);
ippsFree(R);
return(status);
}

The function call looks like this:

for (int i = 0; i < Frames; i++)
    ProcessFrame(&ref[i * FrameSize], &source[i * FrameSize], &dest[i * FrameSize], mX, mXi, NumPixels, Alines, DFTLength, IMGLength);

The function does not fail and produces the desired output for up to 6 images, more than that and it dies with:

First-chance exception at 0x022930e0 in DLL_test.exe: 0xC0000005: Access violation reading location 0x1cdda000.

I’ve attempted to debug the program, unfortunately VS reports that the call stack location is in an IPP DLL with “No Source Available”. It consistently fails when calling ippMagnitude32fc( (Ipp32fc*)X, R, DFTlen)

Which leads me to my questions: Is this a memory leak? If so, can anybody see where the leak is located? If not, can somebody suggest how to go about debugging this problem?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T22:59:06+00:00Added an answer on May 25, 2026 at 10:59 pm

    To answer your first question, no that’s not a memory leak, that’s a memory corruption.
    A memory leak is when you don’t free the memory used, and so , the memory usage is growing up. That doesn’t make the program to not work, but only end up using too much memory, which results in the computer being really slow (swaping) and ultimately any program crashing with a ‘Not enough memory error’.
    What you have is basic pointer error, as it happend all the time in C++.
    Explain how to debug is hard, I suggest you add a breakpoint just before in crash, and try to see what’s wrong.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In external (Delphi-created) DLL I've got the following function that I need to call
I have a project that uses a DLL that I have created. Everything works
I created a Form application in visual c#, that uses a function to generate
I created a DLL in C++ using Visual Studio 2005. My problem is that
i've created a dll for gamemaker. dll's arrays where really slow so after asking
I have a .Net DLL that I created that implements a WCF client that
I have a .NET assembly DLL that is created on-the-fly from pre-compiled code in
I have a Dll that was created with VC++. I'm very sure the Dll
I have a unmanaged DLL that exposes a function that takes a pointer to
I am having a problem with a C++/CLI mixed mode DLL that I created.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.