mlt icon indicating copy to clipboard operation
mlt copied to clipboard

portability issue: locale misuse on OpenBSD

Open marcespie opened this issue 5 years ago • 3 comments

setlocale is never thread-safe. Even with the proper mutex locking, it still leads to memory corruption here.

Right now, OpenBSD doesn't have LC_NUMERIC support, so neutering the support will allow it to run.

src4.txt

Eventually, we might get support for strtod_l and friends.

or you could switch to uselocale() for everything but windows...

marcespie avatar May 22 '20 11:05 marcespie

with bumping minimum requirement to c++17 it could be replaced with std::from_chars(), that defines the behavior of strtod with a C locale.

sandsmark avatar Dec 15 '20 17:12 sandsmark

with bumping minimum requirement to c++17 it could be replaced with std::from_chars(

He is referring to the framework code, which is strictly C. We are moving away from supporting numeric locale with MLT v7 by adding a build option. I am not yet decided, which will be default.

ddennedy avatar Dec 15 '20 23:12 ddennedy

He is referring to the framework code, which is strictly C.

oki. I started porting it yesterday, but didn't get very far because there's a lot of stuff in mlt_property.c that isn't valid in c++, but I guess I can drop that. :-)

sandsmark avatar Dec 16 '20 13:12 sandsmark