I'm trying to use the GuidoGetVoiceMap() function to work in VS2010.
In my MFC project, both debug and release modes lead to a crash : "vectors
iterators incompatible"
So I checked with the tools downloaded in "guidolib-1.49-src" and a provided
Guido file "gmn-examples\note\sample.gmn" :
- this tool works fine in debug mode, but crashes in release mode.
Do I have something wrong in my VS configuration somewhere ? Shoul I try to
build teh guidoengine in static mode ?
Thanks for your help.
Great work on this library.
Alain
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm using VS2005. However, I remember that I've got problems with VS 2010
(compiling another project).
As far as I remember, the problem was due to vector comparison operator.
In your case ( "vectors iterators incompatible") I really have no idea about
what the problem could be.
Can you trace the program and tell me where in the source code the crash
arises?
Otherwise I could also install VS2010 (are you using the free version?) but
you'll have to wait a bit (I'm afraid I won't be able to do it before mid
july).
Best
--
Dominique
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've just managed to have it work in _debug _mode, through the QGuidoPainter
p:
err = GuidoGetVoiceMap( p->getGRHandler(), pageIndex, pageFormat.width,
pageFormat.height, 1, map);
But still not working in Release, so it's the same behaviour as for the tool
"guidogetvoicemap.exe" provided in the guido source package 1.49.
I also tried to track the bug in the source code in RelWithDebInfo mode.
In the guidogetvoicemap tool, the crash occurs at line 69 : err =
GuidoGetVoiceMap( grh, page, kSize, kSize, v, map);
if I step into by several steps, the deeper I get is in the file GRSTAFF.cpp
at line 1813 : if (e) e->GetMap (sel, f, infos);
I have no idea where this could come from as it only happends in Release mode.
Thanks again for your quick reply. At least the debug mode is working now.
Alain
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thats' already a lot of information.
Could you get deeper into the e->GetMap (sel, f, infos); call?
The problem for you is certainly that it works now in debug mode, thus it
becomes hard to find the crash location.
--
Dominique
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
msvcp100d.dll!std::_Debug_message(const wchar_t * message, const wchar_t *
file, unsigned int line) Line 15 C++
GUIDOEngine.dll!std::_Vector_const_iterator<std::_Vector_val<std::pair<TimeSeg ment,TRect<float=""> >,std::allocator<std::pair<TimeSegment,TRect<float> > > >
::_Compat(const std::_Vector_const_iterator<std::_Vector_val<std::pair<TimeSe gment,TRect<float=""> >,std::allocator<std::pair<TimeSegment,TRect<float> > > > >
& _Right) Line 238 + 0x17 bytes C++
GUIDOEngine.dll!std::_Vector_const_iterator<std::_Vector_val<std::pair<TimeSeg ment,TRect<float=""> >,std::allocator<std::pair<TimeSegment,TRect<float> > > >
::operator==(const std::_Vector_const_iterator<std::_Vector_val<std::pair<Tim eSegment,TRect<float=""> >,std::allocator<std::pair<TimeSegment,TRect<float> > >
& _Right) Line 203 C++
GUIDOEngine.dll!std::_Vector_const_iterator<std::_Vector_val<std::pair<TimeSeg ment,TRect<float=""> >,std::allocator<std::pair<TimeSegment,TRect<float> > > >
::operator!=(const std::_Vector_const_iterator<std::_Vector_val<std::pair<Tim eSegment,TRect<float=""> >,std::allocator<std::pair<TimeSegment,TRect<float> > >
& _Right) Line 208 + 0xc bytes C++
GUIDOEngine.dll!guido::GuidoVoiceCollector::Graph2TimeMap(const TRect<float> &
box, const TimeSegment & dates, const GuidoElementInfos & infos) Line 97 +
0x77 bytes C++
GUIDOEngine.dll!GRNotationElement::SendMap(const NVRect & map, MapCollector &
f, Fraction date, Fraction dur, GuidoElementType type, MapInfos & infos) Line
105 + 0x1e bytes C++
GUIDOEngine.dll!GRNotationElement::SendMap(MapCollector & f, Fraction date,
Fraction dur, GuidoElementType type, MapInfos & infos) Line 111 + 0x5d bytes
C++
GUIDOEngine.dll!GRSingleRest::GetMap(GuidoeElementSelector sel, MapCollector &
f, MapInfos & infos) Line 168 + 0x84 bytes C++
GUIDOEngine.dll!GRStaff::GetMap(GuidoeElementSelector sel, MapCollector & f,
MapInfos & infos) Line 1813 + 0x21 bytes C++
GUIDOEngine.dll!GRSystemSlice::GetMap(GuidoeElementSelector sel, MapCollector
& f, MapInfos & infos) Line 177 + 0x3b bytes C++
GUIDOEngine.dll!GRSystem::GetMap(GuidoeElementSelector sel, MapCollector & f,
MapInfos & infos) Line 552 + 0x1b bytes C++
GUIDOEngine.dll!GRPage::GetMap(GuidoeElementSelector sel, MapCollector & f,
MapInfos & infos) Line 330 + 0x28 bytes C++
GUIDOEngine.dll!GRMusic::GetMap(int inPage, float w, float h,
GuidoeElementSelector sel, MapCollector & f) Line 144 + 0x1b bytes C++
GUIDOEngine.dll!GuidoGetMap(const NodeGR * handle, int page, float w, float h,
GuidoeElementSelector sel, MapCollector & f) Line 132 + 0x32 bytes C++
GUIDOEngine.dll!guido::GuidoMapCollector::process(int page, float w, float h,
std::vector<std::pair<TimeSegment,TRect<float>
,std::allocator<std::pair<TimeSegment,TRect<float> > > > * outmap) Line 109 +
0x29 bytes C++
GUIDOEngine.dll!GuidoGetVoiceMap(const NodeGR * gr, int pagenum, float w,
float h, int voice, std::vector<std::pair<TimeSegment,TRect<float>
,std::allocator<std::pair<TimeSegment,TRect<float> > > > & outmap) Line 165
C++
guidogetvoicemap.exe!main(int argc, char * * argv) Line 69 + 0x23 bytes C++
guidogetvoicemap.exe!__tmainCRTStartup() Line 555 + 0x17 bytes C
kernel32.dll!7665339a()
ntdll.dll!779a9ef2()
ntdll.dll!779a9ec5()
and the last guido code before fallinf in the std::vector code:
for (Time2GraphicMap::const_iterator i = fOutMap->begin(); i !=
fOutMap->end(); i++) {
if ( intersect( i->second, box ) )
return;
}
Here the size of fOutMap is 0...
Hope this helps. I can do further investigation if necessary.
Alain
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for the debug.
Right now, I'm leaving and I'll be away from my desktop until next week. So
I'll investigating the problem next week.
Could you also tell me your windows version? is it 7?
--
Dominique
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I'm back to the issue. The most difficult was to get Visual Studio 10 working
and compiling on my computer...
I've recompiled everything using VS10... but I can't reproduce the problem.
I'm also using windows 7 64 bits but I compiled 32 bits code since the (free)
express edition of VS10 doesn't support 64 bits compiling. I've run the
tools/guidogetvoicemap without problem (using a multi voice gmn file).
Are you compiling 64bits code?
Can you send me some code to reproduce?
--
Dominique
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Here are some details that might help ? :
- I'm using qt 4.8.0, through the VS addon.
- the guidotools solution doesn't compile without errors in that there is an error in the guido2svg.cpp file with the 'read' function (undefined) at line 108. That doesn't affect the guidogetvoicemap project though.
.
well, ... I'll send you a vcproj file, that will probably be of better help...
Alain
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I just sent you a MP with a very simple vs project presenting the same
symptoms...
There is no QT included, and it runs OK in debug mode but crashes in release.
Thanks again,
Alain
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
sorry but I can't still reproduce the problem
everything works fine on my side.
I've tried using your binaries (exe and dll) as well as using a recompiled
version.
Actually, main.cpp is exactly the same file as tools/guidogetvoicemap.cpp
which I used to make my previous tests.
So, it looks like we're facing one of these strange bugs that shows and hides
depending on a context that is particularly difficult to compare.
Let's start with the tools. Below is my version of Visual Studio.
Can you see a difference?
Do you have any other idea about how to track this issue?
--
Dominique
Microsoft Visual Studio 2010
Version 10.0.40219.1 SP1Rel
Microsoft .NET Framework
Version 4.0.30319 SP1Rel
Installed Version: VC Express
Microsoft Visual C++ 2010 01013-169-2610014-70290
Microsoft Visual C++ 2010
Microsoft Visual C++ 2010 Express - ENU Service Pack 1 (KB983509) KB983509
This service pack is for Microsoft Visual C++ 2010 Express - ENU.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've just tried the guido example (which is exactly the same code as
guidogetvoicemap tool, yes), in release mode on two other windows 7 machines
(one with win7 SP1, and the other without SP1), and it ran with no crash on
both machines.
So, I tried downloading and installing all pending windows update on the non
working machine, but with no difference regarding the crash.
I seem to have the exact same configuration as you except for the Visual
Studio. It's the full version, not the express.
At this point, it seems that I have to figure out the difference between the
working and non working machines... Sorry for wasting your time about that.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
At this point, it seems that I have to figure out the difference between the
working and non working machines... Sorry for wasting your time about that.
You should also check the compiler options, but if you used cmake to generate
the tools project, they should be the same.
Anyway, looking back to the error messages:
"vectors iterators incompatible"
should mean that somewhere, an iterator retrieved from a vector is used with
another vector. That's certainly not the case and anyway, it should always
crash.
Thus I suspect a kind of memory corruption, and that could also come from the
use of incorrect guido headers: from guido version 1.48 and 1.49, an
incompatibility has been introduced and thus you should make sure that you're
using the headers corresponding to the current library version.
--
Dominique
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I'm trying to use the GuidoGetVoiceMap() function to work in VS2010.
In my MFC project, both debug and release modes lead to a crash : "vectors
iterators incompatible"
So I checked with the tools downloaded in "guidolib-1.49-src" and a provided
Guido file "gmn-examples\note\sample.gmn" :
- this tool works fine in debug mode, but crashes in release mode.
Do I have something wrong in my VS configuration somewhere ? Shoul I try to
build teh guidoengine in static mode ?
Thanks for your help.
Great work on this library.
Alain
I'm using VS2005. However, I remember that I've got problems with VS 2010
(compiling another project).
As far as I remember, the problem was due to vector comparison operator.
In your case ( "vectors iterators incompatible") I really have no idea about
what the problem could be.
Can you trace the program and tell me where in the source code the crash
arises?
Otherwise I could also install VS2010 (are you using the free version?) but
you'll have to wait a bit (I'm afraid I won't be able to do it before mid
july).
Best
--
Dominique
Thanks for your answer.
I've just managed to have it work in _debug _mode, through the QGuidoPainter
p:
err = GuidoGetVoiceMap( p->getGRHandler(), pageIndex, pageFormat.width,
pageFormat.height, 1, map);
But still not working in Release, so it's the same behaviour as for the tool
"guidogetvoicemap.exe" provided in the guido source package 1.49.
I also tried to track the bug in the source code in RelWithDebInfo mode.
In the guidogetvoicemap tool, the crash occurs at line 69 : err =
GuidoGetVoiceMap( grh, page, kSize, kSize, v, map);
if I step into by several steps, the deeper I get is in the file GRSTAFF.cpp
at line 1813 : if (e) e->GetMap (sel, f, infos);
I have no idea where this could come from as it only happends in Release mode.
Thanks again for your quick reply. At least the debug mode is working now.
Alain
Thats' already a lot of information.
Could you get deeper into the e->GetMap (sel, f, infos); call?
The problem for you is certainly that it works now in debug mode, thus it
becomes hard to find the crash location.
--
Dominique
Here is the call stack when it crashes:
ntdll.dll!779a9ef2()
ntdll.dll!779a9ec5()
and the last guido code before fallinf in the std::vector code:
for (Time2GraphicMap::const_iterator i = fOutMap->begin(); i !=
fOutMap->end(); i++) {
if ( intersect( i->second, box ) )
return;
}
Here the size of fOutMap is 0...
Hope this helps. I can do further investigation if necessary.
Alain
Thanks for the debug.
Right now, I'm leaving and I'll be away from my desktop until next week. So
I'll investigating the problem next week.
Could you also tell me your windows version? is it 7?
--
Dominique
Thanks,
I'm using windows 7 64 bit
Alain
Hi,
I'm back to the issue. The most difficult was to get Visual Studio 10 working
and compiling on my computer...
I've recompiled everything using VS10... but I can't reproduce the problem.
I'm also using windows 7 64 bits but I compiled 32 bits code since the (free)
express edition of VS10 doesn't support 64 bits compiling. I've run the
tools/guidogetvoicemap without problem (using a multi voice gmn file).
Are you compiling 64bits code?
Can you send me some code to reproduce?
--
Dominique
Hi,
I'm also compiling 32 bit code.
Here are some details that might help ? :
- I'm using qt 4.8.0, through the VS addon.
- the guidotools solution doesn't compile without errors in that there is an error in the guido2svg.cpp file with the 'read' function (undefined) at line 108. That doesn't affect the guidogetvoicemap project though.
.
well, ... I'll send you a vcproj file, that will probably be of better help...
Alain
can you try to isolate the problem from qt (I don't have qt installed on the
VS 10 computer)
Dominique
Hi,
I just sent you a MP with a very simple vs project presenting the same
symptoms...
There is no QT included, and it runs OK in debug mode but crashes in release.
Thanks again,
Alain
sorry but I can't still reproduce the problem
everything works fine on my side.
I've tried using your binaries (exe and dll) as well as using a recompiled
version.
Actually, main.cpp is exactly the same file as tools/guidogetvoicemap.cpp
which I used to make my previous tests.
So, it looks like we're facing one of these strange bugs that shows and hides
depending on a context that is particularly difficult to compare.
Let's start with the tools. Below is my version of Visual Studio.
Can you see a difference?
Do you have any other idea about how to track this issue?
--
Dominique
Microsoft Visual Studio 2010
Version 10.0.40219.1 SP1Rel
Microsoft .NET Framework
Version 4.0.30319 SP1Rel
Installed Version: VC Express
Microsoft Visual C++ 2010 01013-169-2610014-70290
Microsoft Visual C++ 2010
Microsoft Visual C++ 2010 Express - ENU Service Pack 1 (KB983509) KB983509
This service pack is for Microsoft Visual C++ 2010 Express - ENU.
Hello,
I've just tried the guido example (which is exactly the same code as
guidogetvoicemap tool, yes), in release mode on two other windows 7 machines
(one with win7 SP1, and the other without SP1), and it ran with no crash on
both machines.
So, I tried downloading and installing all pending windows update on the non
working machine, but with no difference regarding the crash.
I seem to have the exact same configuration as you except for the Visual
Studio. It's the full version, not the express.
At this point, it seems that I have to figure out the difference between the
working and non working machines... Sorry for wasting your time about that.
You should also check the compiler options, but if you used cmake to generate
the tools project, they should be the same.
Anyway, looking back to the error messages:
should mean that somewhere, an iterator retrieved from a vector is used with
another vector. That's certainly not the case and anyway, it should always
crash.
Thus I suspect a kind of memory corruption, and that could also come from the
use of incorrect guido headers: from guido version 1.48 and 1.49, an
incompatibility has been introduced and thus you should make sure that you're
using the headers corresponding to the current library version.
--
Dominique
It works! It was probably linked to incorrect headers, as the problem disappeared when resetting all projects linkings.
Sorry for the late update. I finally had some time for looking into that again...
Anyway, Thanks a lot for your time.