Software Archive
Read-only legacy content
17061 토론

Amplifier fails with fibers

George_Kotorlis
초급자
1,401 조회수
Hello,

when using Amplifier with a fiber-based application I get the assertion "stack_region_bottom > stack_region_top" and then a runtime error that terminates the process.

On Vista x64 the "stack_region_top" value will not be modified when calling "SwitchToFiber()" since it does not affect the code execution.

Is it possible to remove this assertion?

Thanks
George
0 포인트
6 응답
Vladimir_T_Intel
중재자
1,401 조회수
Hello George,

Is that possible to provide us with a simple test case that would reproduce the problem?

0 포인트
George_Kotorlis
초급자
1,401 조회수
Here is a small example:

#include 

#define MAX_FIBERS 100

LPVOID fiber[MAX_FIBERS];

void WINAPI FiberProc(LPVOID lpv)
{
for (;;)
SwitchToFiber(fiber[(long)lpv]);
}

void main()
{
fiber[0] = ConvertThreadToFiber(0);

for (long i = 1; i < MAX_FIBERS; ++i)
fiber = CreateFiber(0, FiberProc, (void*)((i + 1) % MAX_FIBERS));

for (;;)
SwitchToFiber(fiber[1]);
}

Compile it for x64 and run it. You will get immediately the assertion.
0 포인트
Vladimir_T_Intel
중재자
1,401 조회수
Thanks for the code sample, I'll check it soon.

Is that particularly x64 problem? Did you reproduce it on x32 system? Which compiler (VS version) you were using?

0 포인트
George_Kotorlis
초급자
1,401 조회수
Thanks for the code sample, I'll check it soon.

Is that particularly x64 problem? Did you reproduce it on x32 system? Which compiler (VS version) you were using?


Yes, the problem occurs only on x64 (I tested on Vista), not on x32 where SwitchToFiber() sets the stack_top value.
The compiler I used was VS2008 Professional.
0 포인트
Vladimir_T_Intel
중재자
1,401 조회수

Hello George,

I've reproduced the problem exactly on x64 system. Thanks again for submitting it.

We are going to fix it. Unfortunately, the bug fix won't be ready for the very next public release. So, we have to wait further releases.


0 포인트
Vladimir_T_Intel
중재자
1,401 조회수
Just in case this is relevant: the bug was fixed long ago in the Amplifier Update 2. Sorry for the late notification.
0 포인트
응답