Alzathar / b-tk.googlecode.backup

Automatically exported from code.google.com/p/b-tk
Other
1 stars 1 forks source link

Calling btkReadAcquisition several times in one MATLAB session gives segmentation violation #72

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Call btkReadAcquisition('xxx.c3d') several times in succession

Get this error:
Error using btkReadAcquisition
Unexpected exception occurred: bad allocation

2. Call btkReadAcquisition('yyy.c3d')

Get this error:

------------------------------------------------------------------------
       Segmentation violation detected at Wed Oct 30 18:41:51 2013
------------------------------------------------------------------------

Configuration:
  Crash Decoding  : Disabled
  Default Encoding: windows-1252
  MATLAB Root     : C:\Program Files\MATLAB\R2012b
  MATLAB Version  : 8.0.0.783 (R2012b)
  Operating System: Microsoft Windows 7
  Processor ID    : x86 Family 6 Model 37 Stepping 5, GenuineIntel
  Virtual Machine : Java 1.6.0_17-b04 with Sun Microsystems Inc. Java HotSpot(TM) Client VM mixed mode
  Window System   : Version 6.1 (Build 7601: Service Pack 1)

Fault Count: 1

Abnormal termination:
Segmentation violation

Register State (from fault):
  EAX = 00000000  EBX = ffffffff
  ECX = 26c1c288  EDX = 00000000
  ESP = 0086c484  EBP = 07dfe1f8
  ESI = 047c7a80  EDI = 0086c49f

  EIP = 0d4b863b  EFL = 00010246

   CS = 0000001b   DS = 00000023   SS = 00000023
   ES = 00000023   FS = 0000003b   GS = 00000000

Stack Trace (from fault):
[  0] 0x0d4b863b C:\Program 
Files\BTK\share\btk-0.2\Wrapping\Matlab\btk\btkReadAcquisition.mexw32+00296507 
( mexFunction+289163 )
[  1] 0x0d4b8885 C:\Program 
Files\BTK\share\btk-0.2\Wrapping\Matlab\btk\btkReadAcquisition.mexw32+00297093 
( mexFunction+289749 )
[  2] 0x0d4797a0 C:\Program 
Files\BTK\share\btk-0.2\Wrapping\Matlab\btk\btkReadAcquisition.mexw32+00038816 
( mexFunction+031472 )
[  3] 0x0d4730cd C:\Program 
Files\BTK\share\btk-0.2\Wrapping\Matlab\btk\btkReadAcquisition.mexw32+00012493 
( mexFunction+005149 )
[  4] 0x0d4725b7 C:\Program 
Files\BTK\share\btk-0.2\Wrapping\Matlab\btk\btkReadAcquisition.mexw32+00009655 
( mexFunction+002311 )
[  5] 0x778f2fe7                      C:\Windows\SYSTEM32\ntdll.dll+00339943 ( 
RtlAllocateHeap+000529 )
[  6] 0x778f2e82                      C:\Windows\SYSTEM32\ntdll.dll+00339586 ( 
RtlAllocateHeap+000172 )
[  7] 0x700a3db8 
C:\Windows\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.6161_none_50
934f2ebcb7eb57\MSVCR90.dll+00409016 ( malloc+000121 )
[  8] 0x700a3c3a 
C:\Windows\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.6161_none_50
934f2ebcb7eb57\MSVCR90.dll+00408634 ( free+000236 )
[  9] 0x7db5755b C:\Program Files\MATLAB\R2012b\bin\win32\libmx.dll+00030043 ( 
mxAddToAllocList+000123 )
[ 10] 0x0d4ed9b7 C:\Program 
Files\BTK\share\btk-0.2\Wrapping\Matlab\btk\btkReadAcquisition.mexw32+00514487 
( mexFunction+507143 )
[ 11] 0x0d471dfa C:\Program 
Files\BTK\share\btk-0.2\Wrapping\Matlab\btk\btkReadAcquisition.mexw32+00007674 
( mexFunction+000330 )

This error was detected while a MEX-file was running. If the MEX-file
is not an official MathWorks function, please examine its source code
for errors. Please consult the External Interfaces Guide for information
on debugging MEX-files.

If this problem is reproducible, please submit a Service Request via:
    http://www.mathworks.com/support/contact_us/

A technical support engineer might contact you with further information.

Thank you for your help.** This crash report has been saved to disk as 
C:\Users\jmcaputo\AppData\Local\Temp\matlab_crash_dump.4436-1 **

Caught MathWorks::System::FatalException
[Please exit and restart MATLAB]>> 

What is the expected output? What do you see instead?
See above. Just expect to create a handle to use in other btk functions.

What version of the product are you using? On what operating system?
0.2 on Windows 7 32 bit Matlab 2012b

Please provide any additional information below.

Original issue reported on code.google.com by 6A.6D...@gmail.com on 30 Oct 2013 at 10:44

GoogleCodeExporter commented 9 years ago
btkDeleteAcquisition seems to have resolved the issue.

I suspected such a function existed but could not find it in my initial 
searching.

Perhaps putting a link to it here: 
http://b-tk.googlecode.com/svn/doc/Matlab/0.2/classbtk_read_acquisition.html 
would help others avoid this pitfall in the future.

Thanks!

Original comment by 6A.6D...@gmail.com on 31 Oct 2013 at 4:03

GoogleCodeExporter commented 9 years ago
This is indeed right. You will find more explanation in the FAQ: 
http://b-tk.googlecode.com/svn/doc/Matlab/0.2/_f_a_q.html#q3

I will improve the documentation of the function btkReadAcquisition.

Original comment by arnaud.barre on 31 Oct 2013 at 4:32

GoogleCodeExporter commented 9 years ago
Thanks so much--should've read the FAQ in greater detail. :D

Original comment by 6A.6D...@gmail.com on 31 Oct 2013 at 6:11

GoogleCodeExporter commented 9 years ago
Commit e0a0b4c964478587e87accd01e4d1beec3d7c368 adds more details in the Matlab 
documentation for the release of the memory associated with an acquisition.

Original comment by arnaud.barre on 10 Nov 2013 at 5:49