Back to the main page.

Bug 1020 - read memory error during acquisition

Status CLOSED FIXED
Reported 2011-10-07 17:05:00 +0200
Modified 2012-06-20 15:03:27 +0200
Product: FieldTrip
Component: realtime
Version: unspecified
Hardware: PC
Operating System: Windows
Importance: P1 normal
Assigned to: Boris Reuderink
URL:
Tags:
Depends on: 1234
Blocks:
See also:

anais mottaz - 2011-10-07 17:05:02 +0200

acquisition/biosemi2ft.exe crashes with a 'memory could not be read' error: -sometimes a few ms after being launched. -always when many close triggers are sent to the biosemi USB2 receiver. Crash happens in FtEventList.transform() (buffer/cpp/FtBuffer.h) when more than one event have been added in FtEventList. Problem fixed: Bad pointer arithmetic in realtime/buffer/cpp/FtBuffer.h line 483, in FtEventList.transform(), change from eventdef_t *ne = (eventdef_t *) buf + pos; to eventdef_t *ne = (eventdef_t *) (buf + pos);


Robert Oostenveld - 2011-10-07 17:31:50 +0200

Hi Philip, This bug and its fix seem straightforward. Could you check the fix that is suggested on your system? If it does not cause other problems, please reassign it to me and I'll take it into the release code and compiled version. best Robert PS @Anais: thanks for the report and suggested fix!


Robert Oostenveld - 2011-10-11 09:47:51 +0200

Hi Jorn, Are you able to recompile this on windows 32? Robert


Robert Oostenveld - 2011-10-11 09:48:45 +0200

Please note that the code change and compiled maci version have just been committed. manzana> svn commit Sending realtime/acquisition/biosemi/biosemi2ft.maci Sending realtime/buffer/cpp/FtBuffer.h Transmitting file data .. Committed revision 4419.


Jörn M. Horschig - 2011-10-11 11:33:19 +0200

Hey, not sure what file you mean, biosemi2ft.cc, FtBuffer.h? (just fyi, I cannot compile either of them)


Robert Oostenveld - 2011-10-11 13:33:32 +0200

What compiler(s) do you have on your computer? MingW by any chance? That should be the most suitable for the job. If not, I'll solve it otherwise.


Jörn M. Horschig - 2011-10-11 13:56:11 +0200

I just got Lcc and MSVC++ 2008 on my computer. Using MSVC, I get this strange error: biosemi2ft.cc(6) : fatal error C1083: Cannot open include file: 'BioSemiClient.h': No such file or directory C:\PROGRA~1\MATLAB\R2009B\BIN\MEX.PL: Error: Compile of 'biosemi2ft.cc' failed. ??? Error using ==> mex at 221 Unable to complete successfully. Note that BioSemiClient.h is in the same directory, so it should be able to find that file


Robert Oostenveld - 2011-10-11 14:06:41 +0200

it will need the Makefile, which MSVC does not support. I'll take it on me.


Jörn M. Horschig - 2011-10-11 15:14:17 +0200

okay, thx&sry


Philip van den Broek - 2011-10-11 15:40:41 +0200

Fortunately, I found the old version of the gcc-compiler (4.0.1) on my computer, which made me compiling and running biosemi2ft with no complaint about the library. I did a quick test by sending events to the buffer every 30 ms, and reading 1 sec. of data for each incoming event (loop-test via BrainStream). I kept it running for a couple of minutes, and it did run without errors. I did not verify the data since nobody was in the cap. If you need further testing, just let me know. The fixed bug, could it also lead to receiving an event with wrong sample value zero? According to the code, I think it should only happen if events were received in a very short time interval. Am I right? Gr. Philip


Robert Oostenveld - 2011-11-11 16:41:47 +0100

(In reply to comment #9) > The fixed bug, could it also lead to receiving an event with wrong sample value > zero? According to the code, I think it should only happen if events were > received in a very short time interval. Am I right? Yes.


Robert Oostenveld - 2011-11-23 09:09:20 +0100

just an update on this bug: it is still open because we have to ensure that fieldtrip is released with the latest compiled version of the executable with the fixed bug. At the moment I don't know whether that is the case. I suggest that Boris checks that the date of the compiled versions is later than the date of the fixed c-file, or that the SVN revision numbers are consistent with the executables being up to date.


Boris Reuderink - 2012-01-17 12:28:30 +0100

Ok, I'll check and add a recompiled binary if needed. Have the changes been tested; that is, is adding an up to date binary to the repository all that is needed?


Robert Oostenveld - 2012-01-17 12:31:07 +0100

(In reply to comment #12) yes, I have tested it locally on my own machine. The compilation needs to be done for all dependencies on all platforms, so it is quite some work.


Boris Reuderink - 2012-02-29 14:47:55 +0100

Manual recompilation of biosemi2ft.exe was done for bug 1234. @Anais, could you confirm that this solves your problem? Best, Boris


Boris Reuderink - 2012-06-20 15:03:27 +0200

Changed my resolved bugs to closed.