Boost logo

Boost :

Subject: Re: [boost] [coroutine] x86 msvc11 stack corruption
From: AVZ (susuman_at_[hidden])
Date: 2016-01-29 18:14:14


Just want to share workaround which work for our company.
(Fiber fix was not acceptable for that application)
Debugging differences in make_fcontext between 1.53 vs 1.57, I found that in
1.53 context area is cleanned with 0, but not in 1.57.
So we added explicit clear after line 100 in make_x86_64_ms_pe_masm.asm:

    sub rax, 0128h

*
    ; memset context area
    pxor xmm0, xmm0
    movaps [rax+008h], xmm0
    movaps [rax+018h], xmm0
    movaps [rax+028h], xmm0
    movaps [rax+038h], xmm0
    movaps [rax+048h], xmm0
    movaps [rax+058h], xmm0
    movaps [rax+068h], xmm0
    movaps [rax+078h], xmm0
    movaps [rax+088h], xmm0
    movaps [rax+098h], xmm0
    movaps [rax+0a8h], xmm0
    movaps [rax+0b8h], xmm0
    movaps [rax+0c8h], xmm0
    movaps [rax+0d8h], xmm0
    movaps [rax+0e8h], xmm0
    movaps [rax+0f8h], xmm0
    movaps [rax+108h], xmm0
    movaps [rax+118h], xmm0
*

    ; third arg of make_fcontext() == address of context-function
    mov [rax+0118h], r8

With that we are getting same behavior as 1.53 - no crash on DLL load.

Thanks,
AZ

--
View this message in context: http://boost.2283326.n4.nabble.com/coroutine-x86-msvc11-stack-corruption-tp4657990p4683079.html
Sent from the Boost - Dev mailing list archive at Nabble.com.

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk