Hi Everyone,

We are seeing a bad interaction on OS X that's causing a 
SIGILL/EXC_BAD_INSTRUCTION. Also see 
https://github.com/weidai11/cryptopp/issues/751 .

On OS X (and maybe others).... Currently, DEFAULT_CHANNEL is a std::string 
defined in cryptlib.h. It is const so it has internal linkage. It is heavy 
weight, and each translation gets a copy of it.

Previously, DEFAULT_CHANNEL was declared in cryptlib.h, and defined 
cryptlib.cpp. This suffers Static Initialization Order Fiasco. We received 
bug reports from other projects when they use a Crypto++ object in a global 
without strings like DEFAULT_CHANNEL being constructed.

Currently, because each translation unit gets a copy of DEFAULT_CHANNEL... 
chacha_avx.cpp's copy of DEFAULT_CHANNEL is compiled with with -mavx2. On a 
modern machine everything is OK. On an old machine, like Core2 Duo, we get 
a SIGILL because of AVX instructions are used to initialize DEFAULT_CHANNEL.

That is the bad interaction -  DEFAULT_CHANNEL needs to be constructed, and 
the choices are SIGILL due to AVX or Static Initialization Order Fiasco.

-----

We are evaluating potential solutions. If you have some feedback then 
please provide it at https://github.com/weidai11/cryptopp/issues/751.

Jeff

-- 
You received this message because you are subscribed to "Crypto++ Users". More 
information about Crypto++ and this group is available at 
http://www.cryptopp.com and 
http://groups.google.com/forum/#!forum/cryptopp-users.
--- 
You received this message because you are subscribed to the Google Groups 
"Crypto++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cryptopp-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to