FatalExecutionEngineError ...

Hello!
I'm re-building the graphics display for (opensource) parametric EQ GUI for EqualizerAPO (a Forms app, VS2013.4/C++ Express/.NET 4.5).
Previous version of graphics display has been working without issues but now I need to get this working a bit faster....
I made radical changes and now I get this error after few changes in GUI (sliders):
Is it a bug or my coding making this error happen? This is a realtime system so there's quite a bit happening after each change flag from sliders.... Isn't that error code 0xc0000005 a Access violation error? Could it come from repetitive handling of
chart module?
Graphics display is based on Chart module.
Previously I had the Hz axis data (4096 data points covering 10Hz-32kHz cells)) split into 7 parts (4 different display options + smoother graph on low/high ends). 
Here's the new code (width of Hz axis is say 400px so now I collect only 400 data values logarithmically from whole Hz range). First method prepares the plot data for the chart and the second one fills the chart table cells to display
it.
private: System::Void drawFRCurves(){
if (chart1->Enabled){
initCoefficients();
clearSampleDataSlot();
double pi = 3.14159265358979323846f;
double Fs = 96000.0;
int sample;
int filterCount = 12;
int startFr, endFr;
long double w;
long double numerator;
long double denominator;
long double magnitude;
bool skip11 = !option_state[currentSpeakerMode][currentChannel].lp;
bool skip12 = !option_state[currentSpeakerMode][currentChannel].hp;
int position = 0;
//System::IO::StreamWriter^ pwriter = gcnew System::IO::StreamWriter("c:\\Temp\\plot.txt");
switch (graphMode){
case 0:
startFr = 10;
endFr = 32000;
break;
case 1:
startFr = 10;
endFr = 200; // with 400 same issue
break;
case 2:
startFr = 10;
endFr = 500;
break;
case 3:
startFr = 100;
endFr = 2000;
break;
for (sample = 1; sample < 401; sample++){
magnitude = 0.0L;
position = System::Convert::ToInt32(LogSlider(sample, 1, 400, startFr, endFr));
if (position < sample || sample < 20){ position = sample; } // smoother graph for lowest frequencies
w = 2.0L*pi*position/Fs;
for (int s = 1; s < filterCount + 1; s++){
if (bandActivity[s].Checked || s > 10){
if (s == 11 && skip11){ continue; }
if (s == 12 && skip12){ continue; }
int o = 1;
if (s == 11){ o = option_state[currentSpeakerMode][currentChannel].lpOrder; }
if (s == 12){ o = option_state[currentSpeakerMode][currentChannel].hpOrder; }
for (int j = 1; j < o + 1; j++){
numerator = coefficient[s].b0*coefficient[s].b0 +
coefficient[s].b1*coefficient[s].b1 +
coefficient[s].b2*coefficient[s].b2 +
2.0L*(coefficient[s].b0*coefficient[s].b1 +
coefficient[s].b1*coefficient[s].b2)*cosl(w) +
2.0L*coefficient[s].b0*coefficient[s].b2*cosl(2.0L*w) +
0.0000000000000001L;
denominator = 1.0L +
coefficient[s].a1*coefficient[s].a1 +
coefficient[s].a2*coefficient[s].a2 +
2.0L*(coefficient[s].a1 +
coefficient[s].a1*coefficient[s].a2)*cosl(w) +
2.0L*coefficient[s].a2*cosl(2.0L*w) +
0.0000000000000001L;
magnitude = 10 * log10(fabs(numerator / denominator));
SampleData[0][sample].output = SampleData[0][sample].output + magnitude;
if (s < 11){
SampleData[s][sample].output = magnitude;
//pwriter->WriteLine("sample " + sample.ToString() + " value = " + SampleData[0][sample].output.ToString() + " pos=" + position.ToString());
//pwriter->Close();
drawCurve(showAllGraph->Checked);
private: System::Void drawCurve(bool all){
//System::IO::StreamWriter^ pwriter = gcnew System::IO::StreamWriter("c:\\Temp\\inplot.txt");
if (chart1->Enabled){
double masterGaindB = 0.0f;
int startFr, endFr;
int endLoop = 1;
int chartWidth = 400;
int ser = 1;
String^ seriesName = nullptr;
if (all){
endLoop = 11;
for (ser = 0; ser < endLoop; ser++){
switch (ser){
case 0:
seriesName = "SeriesAll";
if (all){
chart1->Series[seriesName]->BorderWidth = 2;
else{
chart1->Series[seriesName]->BorderWidth = 1;
break;
default: seriesName = "Series"+ ser.ToString(); break; }
if (includeMasterGainInGraph->Checked && includeMasterGainInGraph->Enabled){
masterGaindB = System::Convert::ToDouble(label3->Text);
chart1->Series[seriesName]->Points->Clear();
if (ser == 0 || bandActivity[ser].Checked){
switch (graphMode){
case 0:
startFr = 10;
endFr = 32000;
break;
case 1:
startFr = 10;
endFr = 200; // with 400 same issue
break;
case 2:
startFr = 10;
endFr = 500;
break;
case 3:
startFr = 100;
endFr = 2000;
break;
for (int sample = 1; sample < chartWidth+1; sample++){
int position = System::Convert::ToInt32(LogSlider(sample, 1, 400, startFr, endFr));
if (position < sample || sample < 20){ position = sample; }
if (abs(SampleData[ser][sample].output) > 32.0f){
SampleData[ser][sample].output = 32.0f * (SampleData[ser][sample].output / abs(SampleData[ser][sample].output));
chart1->Series[seriesName]->Points->AddXY(position, (SampleData[ser][sample].output + masterGaindB));
//pwriter->WriteLine("sample " + sample.ToString() + " value = " + SampleData[ser][sample].output.ToString() + " pos=" + position.ToString());
//pwriter->Close();}

Hello!
I'm re-building the graphics display for (opensource) parametric EQ GUI for EqualizerAPO (a Forms app, VS2013.4/C++ Express/.NET 4.5).
Previous version of graphics display has been working without issues but now I need to get this working a bit faster....
I made radical changes and now I get this error after few changes in GUI (sliders):
Is it a bug or my coding making this error happen? This is a realtime system so there's quite a bit happening after each change flag from sliders.... Isn't that error code 0xc0000005 a Access violation error? Could it come from repetitive handling of
chart module?
Graphics display is based on Chart module.
Previously I had the Hz axis data (4096 data points covering 10Hz-32kHz cells)) split into 7 parts (4 different display options + smoother graph on low/high ends). 
Here's the new code (width of Hz axis is say 400px so now I collect only 400 data values logarithmically from whole Hz range). First method prepares the plot data for the chart and the second one fills the chart table cells to display
it.
private: System::Void drawFRCurves(){
if (chart1->Enabled){
initCoefficients();
clearSampleDataSlot();
double pi = 3.14159265358979323846f;
double Fs = 96000.0;
int sample;
int filterCount = 12;
int startFr, endFr;
long double w;
long double numerator;
long double denominator;
long double magnitude;
bool skip11 = !option_state[currentSpeakerMode][currentChannel].lp;
bool skip12 = !option_state[currentSpeakerMode][currentChannel].hp;
int position = 0;
//System::IO::StreamWriter^ pwriter = gcnew System::IO::StreamWriter("c:\\Temp\\plot.txt");
switch (graphMode){
case 0:
startFr = 10;
endFr = 32000;
break;
case 1:
startFr = 10;
endFr = 200; // with 400 same issue
break;
case 2:
startFr = 10;
endFr = 500;
break;
case 3:
startFr = 100;
endFr = 2000;
break;
for (sample = 1; sample < 401; sample++){
magnitude = 0.0L;
position = System::Convert::ToInt32(LogSlider(sample, 1, 400, startFr, endFr));
if (position < sample || sample < 20){ position = sample; } // smoother graph for lowest frequencies
w = 2.0L*pi*position/Fs;
for (int s = 1; s < filterCount + 1; s++){
if (bandActivity[s].Checked || s > 10){
if (s == 11 && skip11){ continue; }
if (s == 12 && skip12){ continue; }
int o = 1;
if (s == 11){ o = option_state[currentSpeakerMode][currentChannel].lpOrder; }
if (s == 12){ o = option_state[currentSpeakerMode][currentChannel].hpOrder; }
for (int j = 1; j < o + 1; j++){
numerator = coefficient[s].b0*coefficient[s].b0 +
coefficient[s].b1*coefficient[s].b1 +
coefficient[s].b2*coefficient[s].b2 +
2.0L*(coefficient[s].b0*coefficient[s].b1 +
coefficient[s].b1*coefficient[s].b2)*cosl(w) +
2.0L*coefficient[s].b0*coefficient[s].b2*cosl(2.0L*w) +
0.0000000000000001L;
denominator = 1.0L +
coefficient[s].a1*coefficient[s].a1 +
coefficient[s].a2*coefficient[s].a2 +
2.0L*(coefficient[s].a1 +
coefficient[s].a1*coefficient[s].a2)*cosl(w) +
2.0L*coefficient[s].a2*cosl(2.0L*w) +
0.0000000000000001L;
magnitude = 10 * log10(fabs(numerator / denominator));
SampleData[0][sample].output = SampleData[0][sample].output + magnitude;
if (s < 11){
SampleData[s][sample].output = magnitude;
//pwriter->WriteLine("sample " + sample.ToString() + " value = " + SampleData[0][sample].output.ToString() + " pos=" + position.ToString());
//pwriter->Close();
drawCurve(showAllGraph->Checked);
private: System::Void drawCurve(bool all){
//System::IO::StreamWriter^ pwriter = gcnew System::IO::StreamWriter("c:\\Temp\\inplot.txt");
if (chart1->Enabled){
double masterGaindB = 0.0f;
int startFr, endFr;
int endLoop = 1;
int chartWidth = 400;
int ser = 1;
String^ seriesName = nullptr;
if (all){
endLoop = 11;
for (ser = 0; ser < endLoop; ser++){
switch (ser){
case 0:
seriesName = "SeriesAll";
if (all){
chart1->Series[seriesName]->BorderWidth = 2;
else{
chart1->Series[seriesName]->BorderWidth = 1;
break;
default: seriesName = "Series"+ ser.ToString(); break; }
if (includeMasterGainInGraph->Checked && includeMasterGainInGraph->Enabled){
masterGaindB = System::Convert::ToDouble(label3->Text);
chart1->Series[seriesName]->Points->Clear();
if (ser == 0 || bandActivity[ser].Checked){
switch (graphMode){
case 0:
startFr = 10;
endFr = 32000;
break;
case 1:
startFr = 10;
endFr = 200; // with 400 same issue
break;
case 2:
startFr = 10;
endFr = 500;
break;
case 3:
startFr = 100;
endFr = 2000;
break;
for (int sample = 1; sample < chartWidth+1; sample++){
int position = System::Convert::ToInt32(LogSlider(sample, 1, 400, startFr, endFr));
if (position < sample || sample < 20){ position = sample; }
if (abs(SampleData[ser][sample].output) > 32.0f){
SampleData[ser][sample].output = 32.0f * (SampleData[ser][sample].output / abs(SampleData[ser][sample].output));
chart1->Series[seriesName]->Points->AddXY(position, (SampleData[ser][sample].output + masterGaindB));
//pwriter->WriteLine("sample " + sample.ToString() + " value = " + SampleData[ser][sample].output.ToString() + " pos=" + position.ToString());
//pwriter->Close();}
It's not clear how you defined/declared the arrays, but arrays have a zero based index. In your code, you access the elements using a "one" based index, which could be the problem unless the arrays are oversized.

Similar Messages

  • VS2013 not running in debug mode on Windows 10 Technical Preview Build 10041

    am getting the following errors every time i try to run my projects in debug mode what can be the issue.
    Managed Debugging Assistant 'FatalExecutionEngineError' has detected a problem in 'C:\Program Files (x86)\IIS Express\iisexpress.exe'.
    Additional information: The runtime has encountered a fatal error. The address of the error was at 0x73c0d5a5, on thread 0x1a0c. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user
    code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.
    Then when I continue the following appears
    An unhandled exception of type 'System.AccessViolationException' occurred in System.Data.dll
    Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
    Then it stops.. 
    This happens when a database call is made and only does this when debug, when I run it using the browser link all is good. The applications work well.

    Hi Bigmachini,
    According to my solution, what about your issue now?
    If you have been solved the issue, would you mind sharing us the solution here? So it would be helpful for other members who get the same issue.
    If not, please let us know the latest information about it.
    @Malik, could you please tell me if you try to check your issue by the above suggestion as I said?
    If no, please try the above suggestions to check this issue and then tell me the latest message about this issue.
    >>The error mostly occurs when debugging ADO.NET or database function calls. If code is run without debugging then there is no issue at all.
    You could also try to copy your project and then debug your project in debug mode on a another machine you install same Windows 10 OS check this issue again.
    Best Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

Maybe you are looking for

  • Reg.New field creation in Consumption posting area

    Dear Experts We want to create new one filed in the below refered path. SPRO->Material Management->Purchasing->Account Assignment category. in the below screen Consumption posting filed - New field to be added. How to create the above. Pls advise Tha

  • Where's the Snippets

    Dreamweaver has always saved the snippets that you make in an undisclosed location. When I reload the system or move to another machine, I lose them all. I would be great if there was a way to just save a copy in Dreamweaver like you can save color p

  • MM ECC 6.0 document

    I want to know the recent new features in MM modules for ECC 6.0 Appreciate any links or inputs

  • Cost Element and Cost element group

    Could You tell me how to chech which Cost Element Group given Cost Element belongs to? Greetings. P.

  • IMac - why do I have a "?" mark on the dock

    I have a "?" on my dock.  When the curser is over it I can see it says HP Utilities.  Is there a problem with this, or should I just dispose of it.