Crash upon senselClose() - ntdll.dll


#1

Hello,

Any time I am calling the senselClose() function, my app crashes.

If I run the debugging, I get this message: “Exception non gérée à 0x00007FFB6C968353 (ntdll.dll) dans Max.exe : 0xC0000374: Un segment de mémoire a été endommagé (paramètres : 0x00007FFB6C9BF6B0).”.

Translation: Unhandeld exception at à 0x00007FFB6C968353 (ntdll.dll) in Max.exe: 0xC0000374: A fragment of memory has been damaged (parameters: 0x00007FFB6C9BF6B0).

Max.exe is the application’s name.

Any idea how to solve this?

Thank you in advance.


#2

Hello,

Thank you for reaching out. I will look into this issue and get back to you.


#3

Hello Alex,

Any news about this?


#4

Some suggestions from a fellow developer, if you haven’t already tried them.

  1. There are memory-heap validation functions that can be called, prior to calling senselClose() and throughout the code, which might help detect if and where memory is being overwritten/damaged. E.g. in Visual Studio one can use ASSERT(_CrtCheckMemory()); This command checks the heap at (and only at) the spot it is inserted. There are other related memory debugging mechanisms, as well.

  2. Comment-out the calls to senselClose(). Does it then crash elsewhere?


#5

Thanks TIm, I’m going to see if (1) can help but about (2), I confirm that if I comment out the line senselClose(&handle); there’s no crash any more.


#6

Hi, sorry for the delay. I was attempting to recreate the error on a few machines but I can see the solution in your latest post.

You should not send a pointer of the handle to sensel close (use senselClose(handle) instead). Hope this helps!


#7

That was it! I still don’t totally grasp the pointer stuff in C…

Thanks a lot, Alex!


#8

It’s amazing (but true) that the Visual Studio compiler doesn’t complain about the apparent type mismatch in the argument to senselClose().

The following is addressed to Alex, not amundsen.

Alex, I believe that if you change the typedef of SENSEL_HANDLE to:

struct SenselHandle { void* handle; };
typedef struct SenselHandle *SENSEL_HANDLE;

that all existing code will still work, but the compiler will then warn about the kind of error that amundsen ran into. I tested this and it seems to work.

 ...Tim...

#9

Glad to hear it worked!

Thanks Tim. Great idea!