您尚未登录。

楼主 #1 2020-07-07 22:10:58

shaoxi2010
会员
注册时间: 2019-06-13
已发帖子: 367
积分: 316

记录分享libgomp的bug

最近在使用jupyter-notebook下用opencv出现了个奇怪的错误。辛辛苦苦google了好久总算找到这个问题的解决办法了
LD_PRELOAD=libgomp.so.1 jupyter-notebook,提前加载经确认就是个bug,分享下防止小伙伴们撞枪口了。

Jakub Jelinek 2019-06-19 15:57:30 UTC
That is a bug in whatever dlopened libgomp.so.1 and before doing that ate all the preallocated TLS area.
The GNU TLS2 model which I'm afraid aarch64 uses unfortunately eats from the same TLS preallocated pool as libraries that require static TLS like libgomp, where it is performance critical to have it as static TLS.
Either don't dlopen libgomp, or LD_PRELOAD it, link it with the application that dlopens it, cut down the uses of other TLS or dlopen libgomp earlier.
There is nothing that can be done on the gcc side.

https://bugzilla.redhat.com/show_bug.cgi?id=1722181

ImportErrorTraceback (most recent call last)
<ipython-input-2-07a3f2957c05> in <module>
      1 get_ipython().run_line_magic('matplotlib', 'inline')
      2 import numpy as np
----> 3 import cv2
      4 from matplotlib import pyplot as plt
      5 import urllib.request as ul

ImportError: /lib/aarch64-linux-gnu/libgomp.so.1: cannot allocate memory in static TLS block

离线

#2 2020-07-07 22:23:40

我就是废物
Moderator
注册时间: 2020-06-22
已发帖子: 2
积分: 2

Re: 记录分享libgomp的bug

就是说要设置一个环境变量 LD_PRELOAD 才能跑了?

离线

楼主 #3 2020-07-07 22:32:30

shaoxi2010
会员
注册时间: 2019-06-13
已发帖子: 367
积分: 316

Re: 记录分享libgomp的bug

恩,和加载顺序有关,简直坑中之坑

离线

#4 2020-07-07 22:35:32

我就是废物
Moderator
注册时间: 2020-06-22
已发帖子: 2
积分: 2

Re: 记录分享libgomp的bug

shaoxi2010 说:

恩,和加载顺序有关,简直坑中之坑

很想知道LD_PRELOAD是不是libc里面内置的环境变量?

离线

楼主 #5 2020-07-08 00:15:20

shaoxi2010
会员
注册时间: 2019-06-13
已发帖子: 367
积分: 316

Re: 记录分享libgomp的bug

我记得是连接器ld.so里面的环境变量

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn