View Issue Details

IDProjectCategoryView StatusLast Update
0002134NoesisGUIC++ SDKpublic2021-11-25 00:07
Reportersteveh Assigned Tojsantos  
PrioritynormalSeverityminorReproducibilitysometimes
Status resolvedResolutionfixed 
Product Version3.0 
Target Version3.1.2Fixed in Version3.1.2 
Summary0002134: Incorrect asert logic in BaseVector<T>::Append
DescriptionHi guys,

I've just been given an assert to look into. It's triggered on the following line:

template<typename T>
inline void BaseVector<T>::Append(const T* first, const T* last)
{
    NS_ASSERT(last < Begin() || first >= End()); // <<<< HERE

The end of the callstack is here:

> Game.exe!Noesis::BaseVector<unsigned char>::Append(const unsigned char * first, const unsigned char * last) Line 434 C++ Symbols loaded.
     Game.exe!Noesis::VGL::AddSVGPath(Noesis::VGLPath * p, const Noesis::SVGPath & path) Line 220 C++ Symbols loaded.
     Game.exe!Noesis::GeometryProxy::GetPath() Line 44 C++ Symbols loaded.


T* first 0x0000000148240080 "\x2" const unsigned char *
T* last 0x0000000148240100 "\x2" const unsigned char *

Vector<T>::mBegin 0x0000000148240100 void *

So the SVG path contains 128 bytes worth of data from address 0x148240080 -> 0x148240100, and the address for the vector's heap allocated data starts at the last address 0x1482040100. This is perfectly valid from what I can see, it's just that both address spaces are contiguous and the SVG path is just before the path's data in memory.

I think the asserts need to be last <= Begin, i.e:

NS_ASSERT(last <= Begin() || first >= End());

Cheers,

-Steven
Steps To ReproduceN/A, randomly happens depending on address allocation.
TagsNo tags attached.
PlatformAny

Activities

jsantos

jsantos

2021-09-29 16:13

manager   ~0007489

You are right, the assert is not correct and there are more place in Vector (and String probably) with the same error. I will carefully review all of them.

Thanks steve!
jsantos

jsantos

2021-11-25 00:06

manager   ~0007611

Fixed in r10936

Thanks steve!

Issue History

Date Modified Username Field Change
2021-09-29 02:08 steveh New Issue
2021-09-29 02:11 steveh Description Updated
2021-09-29 16:12 jsantos Assigned To => jsantos
2021-09-29 16:12 jsantos Status new => assigned
2021-09-29 16:12 jsantos Target Version => 3.1.2
2021-09-29 16:13 jsantos Note Added: 0007489
2021-11-25 00:06 jsantos Product Version => 3.0
2021-11-25 00:06 jsantos Status assigned => resolved
2021-11-25 00:06 jsantos Resolution open => fixed
2021-11-25 00:06 jsantos Note Added: 0007611
2021-11-25 00:07 jsantos Product Version 3.0 => 3.1.1
2021-11-25 00:07 jsantos Product Version 3.1.1 => 3.0
2021-11-25 00:07 jsantos Fixed in Version => 3.1.2