According to https://github.com/jemalloc/jemalloc/issues/937 you could also
build jemalloc with -ftls-model=initial-exec

On Wed, Jun 17, 2020 at 10:11 AM Larry Gritz <[email protected]> wrote:

> The best solution is to make sure your OpenVDB is built with
> -DCONCURRENT_MALLOC=None.
>
> I believe it is just wrong to build a library that forces a process-wide
> malloc substitute, as it will inadvertently pollute any applications or
> other libraries it's linked into. Like, in this case, Python, which seems
> like a bad idea.
>
> Only *applications* (final link, not a single library), should specify a
> wholesale malloc replacement, it should be up to them whether it's
> appropriate.
>
> This is not a knock on jemalloc per se -- which is great. In fact, we use
> it in our renderer without trouble and have never seen this problem. (Also:
> we just did a painful pass through our studio's code base trying to root
> out places where libraries were pulling in jemalloc and other alternate
> mallocs in behind the back of applications, and mainly it required a new
> build of OpenVDB with this option set correctly and then relinking all
> libraries and apps referencing OpenVDB to switch to the new version.)
>
> You mentioned this to me once before and I made a speculative patch:
> https://github.com/OpenImageIO/oiio/pull/2535
>
> We never merged it because... it should not be necessary, and I wasn't
> sure it it really solved your problem since (a) I could never reproduce the
> symptom, and (b) there's no logical reason why it should (I'm just randomly
> changing the only two places where I use TLS from a constructed type to a
> POD, hoping that it might help).
>
> Can you apply this small patch and try it out?
>
>
> On Jun 17, 2020, at 4:42 AM, Richard Shaw <[email protected]> wrote:
>
> I'm working on building OIIO for CentOS 8 and a end user is helping me
> test it, but we're running into an issue:
>
> """
> CentOS8.2 was released today so I had a chance to test your OpenImageIO
> 2.1 packages. The utils and iv seem to be working properly so far.
> However I am getting an error using the python3-openimageio package when
> importing:
>
> >>> import OpenImageIO
> \Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> ImportError: /lib64/libjemalloc.so.2: cannot allocate memory in static TLS
> block
>
> jemalloc came as a new dependency when installing, I'd assume the error is
> related to the openvdb format support. Just guessing :)
> """
>
> Then there is this:
>
> https://github.com/jemalloc/jemalloc/issues/1237
>
> Any tips? Can this be solved on the OIIO side?
>
> Thanks,
> Richard
> _______________________________________________
> Oiio-dev mailing list
> [email protected]
> http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
>
>
> --
> Larry Gritz
> [email protected]
>
>
>
>
> _______________________________________________
> Oiio-dev mailing list
> [email protected]
> http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
>
_______________________________________________
Oiio-dev mailing list
[email protected]
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org

Reply via email to