cancel
Showing results for 
Search instead for 
Did you mean: 

Simulator crashes in VisualStudio after migration (only in Release-configuration)

Marco.R
Senior

Hi

I've migrated our project from 4.9.3 to 4.10.0. Now I'm getting an exception when im running the simulator in visual studio 2017.

The error ocurrs when the program will execute the following line (189) within HALSDL2.cpp

if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER) < 0)

The error only ocurrs in the release-configuration in visual studio.

Everything else works fine:

  • Simulator in Visual Studio with debug-configuration
  • Simulator In designer
  • In IAR/on hardware
  • With touchgfx 4.9.3 the simulator works with debug and release configuration within visual studio

When i'm creating a new Project with the designer, everything works fine. I've already compared the files and configuration of visual studio, but did not found a difference which solves the problem.

Has anyone a suggestion what the problem can be?

I've attached the call stack

Thanks in advance

9 REPLIES 9
Martin KJELDSEN
Chief III

Hi @Marco.R​,

Anything more further down that stack? Can you identify the places where you allocate memory dynamically? Are you able to narrow it down a bit in terms of what the application is doing at the time of crash?

Thanks!

Best regards,

Martin

Marco.R
Senior

​Hi Martin

Thanks for the quick reply. This is the whole stack I attached in the last post.

Meanwhile I've tried the following:

  • Delete the Release configuration
  • Duplicate the Debug configuration

I've made the following changes in the configuration, otherwise the build fails:

  • Change Runtime Library from /MDd to /Md
  • Change Reprocessor Definition from _DEBUG to NDEBUG

The result is the same -> the simulator stops working when initalization the SDL2 Framework.

The error occurs within _SDL_Init routine of SDL2.dll (see Disassembly_SDLInit.png)

I also attached the Stack before this line will be executed (Line_before_exception.png)

I think the memory will be allocated within the SDL2.dll.

I assume it is a configuration failure, but I don't understand why It has an impact to the SDL2.dll.

Thanks

Best regards

Marco

Marco.R
Senior
 
Marco.R
Senior
 
Martin KJELDSEN
Chief III

Hi @Marco.R​,

Thanks for the update! I'll try to investigate what this might be.

Marco.R
Senior

​Hi Martin

I've some new information. We are evaluating if we change from VS Pro to VS Enterprise. And for that I installed the trial version of VS. And I also tried the FW and everything works fine, also the simulator in release-configuration.

But I still don't know the reason for the original problem, because Git doesn't tell me any changes after I tested the new VS version. But the problem is solved. ��

Thank you for your help

Best regards

Marco

Martin KJELDSEN
Chief III

Hi @Marco.R​,

Glad you solved it, although we still don't understand the problem itself. Should we dig deeper or not? It's not something I've seen before, even with various versions of VS2017 (also community), but there could be something related to debug configurations always putting more on the stack and thus something important is less likely to get overwritten compared to a release version.

Best regards,

Martin

Marco.R
Senior

Hi Martin

I think it is not necessary that you ​dig deeper on this issue, because we did not use the "standard" structure of a TouchGFX project. We integrated TouchGFX in a more complex structure where several projects are integrated. It is very likely that it was a configuration error or that there were some old (cache) files that were not updated or something like that.

If we have the issue again, it will be worth to check what is the root cause. But up to this problem, we didn't had any problems with the TouchGFX environment.

Best regards

Marco

Martin KJELDSEN
Chief III

Hi Marco,

Ok, we'll keep an eye out for it.