Opened 7 years ago

Closed 6 years ago

#11946 closed Bugs (fixed)

Boost.Context crashes on x86_64/MinGW

Reported by: tomasz.wlostowski@… Owned by: olli
Milestone: To Be Determined Component: context
Version: Boost 1.60.0 Severity: Showstopper
Keywords: Cc:

Description

Dear Boost Developers,

The GNU assembler version of the make_fcontext()/jump_fcontext() functions on x86_64 platforms have a serious bug that causes the program to segfault: the GAS code loads an invalid memory location instead of a constant due to a missing '$', for example:

Is: movq 1, rcx rcx = mem[1] Should be: movq $1, rcx rcx = 1 movq $1, %rcx -> moves

The attached patch fixes the issue.

Best Regards, Tomasz Wlostowski

Attachments (1)

boost-mingw64-context.patch (1.4 KB ) - added by tomasz.wlostowski@… 7 years ago.

Download all attachments as: .zip

Change History (6)

by tomasz.wlostowski@…, 7 years ago

Attachment: boost-mingw64-context.patch added

comment:1 by olli, 7 years ago

Hello Thomas, unfortunately the patch would not apply because the code has some significant changes. Issue regarding to 'movl 1, %rcx' is gone.

Last edited 7 years ago by olli (previous) (diff)

comment:2 by tomasz.wlostowski@…, 7 years ago

Hi,

I don't mind as long as it works again on Win64.

BTW. Are you planning to introduce any changes to the API?

Tom

in reply to:  2 comment:3 by olli, 7 years ago

Replying to tomasz.wlostowski@…:

I don't mind as long as it works again on Win64.

the unit-tests should pass

BTW. Are you planning to introduce any changes to the API?

yes, already done (see branch master/develop). I was asked to change the API for performance reasons. This applies only to fcontext_t (removed to namespace detail) - boost.context still uses the fcontext_t-API.

comment:4 by olli, 6 years ago

Ok, no further comments - so I close this issue.

comment:5 by olli, 6 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.