无法 dlopen 加载模块 '/usr/lib/pa20_64/libpthread.1'因为它包含线程特定的数据

发布于 2024-10-01 16:25:45 字数 472 浏览 6 评论 0原文

我在使用 dlopen() 加载库时遇到此错误:

Cannot dlopen load module '/usr/lib/pa20_64/libpthread.1' because it contains thread specific data.

我在谷歌上查找了这个错误,以下导出修复了它。

export LD_PRELOAD=/usr/lib/hpux64/libpthread.so.1

谁能告诉我 LD_PRELOAD 到底做什么以及为什么我必须预加载这个库?为什么链接器不加载它?

使用 -lpthread 编译也没有帮助。

ENV:HP-UX hhtenb1 B.11.31 U ia64 3881169896 无限用户许可证

I get this error while loading a lib with dlopen():

Cannot dlopen load module '/usr/lib/pa20_64/libpthread.1' because it contains thread specific data.

I looked this up on google and the following export fixed it.

export LD_PRELOAD=/usr/lib/hpux64/libpthread.so.1

Can anybody tell me what exactly LD_PRELOAD does and why I have to preload this lib? Why does the linker not load it?

Compiling with -lpthread does not help either.

ENV: HP-UX hhtenb1 B.11.31 U ia64 3881169896 unlimited-user license

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

南街女流氓 2024-10-08 16:25:45

我无法告诉您有关 HPUX 的所有详细信息,但请尝试使用 -lpthread 链接您的程序 - 这可能会解决您的问题。

事实上,您正在 dlopen() 处理的库似乎在运行时挖掘以查找 libpthread 的版本。 LD_PRELOAD 只是加载指定的库,就像您已经 dlopened 它们一样,但它是在程序有机会开始运行之前执行的。

不确定细节,但有一个模糊的猜测:您正在使用的某些库在 dlopen 触发 libpthread 加载之前调用了 pthread 静态数据函数(但是如果第一个库将其作为依赖项,那么为什么它会尝试加载 pthread ? - 不确定/也许这表明以前的库静态链接了一些 pthread 内容?)。

I can't tell you all the details on HPUX, but try linking your program with -lpthread - that may solve your problem.

As is, the library you're dlopen()ing seems to be digging around at run-time to find a version of libpthread. LD_PRELOAD just loads the specified library as if you'd dlopened them, but it does it before the program has a chance to start running.

Not sure of details, but a vague guess: some library you're using has called the pthread static data functions before your dlopen triggers a load of libpthread (but why would it try to load pthread then if the first library had it as a dependency? - not sure / maybe that indicates the former library statically linked some pthread content?).

初熏 2024-10-08 16:25:45

我们在运行 DB2-10.1.2 的 hpux-11.31 IA64 上遇到了以下错误并进行了

    "export LD_PRELOAD=/usr/lib/hpux64/libpthread.so.1"  

修复。

DATA #2 : String, 49 bytes
/home/db2inst1/sqllib/lib64/icc/libgsk8iccs_64.so
CALLSTCK: (Static functions may not be resolved correctly, as they are resolved to the nearest symbol)
  [0] 0xC000000032488900 pdOSSeLoggingCallback + 0x980
  [1] 0xC000000010CC5A00 ossLog + 0x4E0
  [2] 0xC000000010CC5610 ossLog + 0xF0
  [3] 0xC00000003255E100 _Z27cryptDynamicLoadGSKitCryptoPc + 0x5F0
  [4] 0xC00000003255F460 cryptContextRealInit + 0x200
  [5] 0xC000000032561950 cryptContextCheckAndInit + 0x130
  [6] 0xC000000032561B70 cryptDHInit + 0x120
  [7] 0xC00000003384FBD0 sqlexSlcServerEncryptAccsec + 0x170
  [8] 0xC00000003384F7B0 _Z33sqlexSlcServerEncryptAuthenticateP14db2UCinterfacelPj + 0xF0
  [9] 0xC0000000321FB7D0 _Z20sqlexAppAuthenticateP14db2UCinterface + 0x1A60
  [10] 0xC0000000321F8920 _Z18sqljrDrdaArConnectP14db2UCinterface + 0x140
  [11] 0xC0000000321E96F0 _Z16sqleUCdrdaARinitP14db2UCconHandle + 0x230
  [12] 0xC000000032238CD0 sqleUCappConnect + 0x13C0
  [13] 0xC000000032647B20  _Z14CLI_sqlConnectP15CLI_CONNECTINFOP5sqlcaP19CLI_ERRORHEADERINFO + 0x32A0
  [14] 0xC0000000325D5710 _Z11SQLConnect2P15CLI_CONNECTINFOPhsS1_sS1_sS1_sh + 0xA10
  [15] 0xC0000000325ADB90 _Z17SQLDriverConnect2P15CLI_CONNECTINFOPvPhsS2_sPsthhP19CLI_ERRORHEADERINFO + 0x26E0
  [16] 0xC0000000325AAC00 _Z11SQLConnect1P15CLI_CONNECTINFOPhsS1_sS1_s + 0xB60
  [17] 0xC0000000325A8E30 SQLConnect + 0xC10
  [18] 0x4000000000001EA0 main + 0x620
  [19] 0xC00000000006E9B0 _DYNAMIC + 0xC00000000006E993

We had this error below on hpux-11.31 IA64 running DB2-10.1.2 and doing the

    "export LD_PRELOAD=/usr/lib/hpux64/libpthread.so.1"  

fixed it.

DATA #2 : String, 49 bytes
/home/db2inst1/sqllib/lib64/icc/libgsk8iccs_64.so
CALLSTCK: (Static functions may not be resolved correctly, as they are resolved to the nearest symbol)
  [0] 0xC000000032488900 pdOSSeLoggingCallback + 0x980
  [1] 0xC000000010CC5A00 ossLog + 0x4E0
  [2] 0xC000000010CC5610 ossLog + 0xF0
  [3] 0xC00000003255E100 _Z27cryptDynamicLoadGSKitCryptoPc + 0x5F0
  [4] 0xC00000003255F460 cryptContextRealInit + 0x200
  [5] 0xC000000032561950 cryptContextCheckAndInit + 0x130
  [6] 0xC000000032561B70 cryptDHInit + 0x120
  [7] 0xC00000003384FBD0 sqlexSlcServerEncryptAccsec + 0x170
  [8] 0xC00000003384F7B0 _Z33sqlexSlcServerEncryptAuthenticateP14db2UCinterfacelPj + 0xF0
  [9] 0xC0000000321FB7D0 _Z20sqlexAppAuthenticateP14db2UCinterface + 0x1A60
  [10] 0xC0000000321F8920 _Z18sqljrDrdaArConnectP14db2UCinterface + 0x140
  [11] 0xC0000000321E96F0 _Z16sqleUCdrdaARinitP14db2UCconHandle + 0x230
  [12] 0xC000000032238CD0 sqleUCappConnect + 0x13C0
  [13] 0xC000000032647B20  _Z14CLI_sqlConnectP15CLI_CONNECTINFOP5sqlcaP19CLI_ERRORHEADERINFO + 0x32A0
  [14] 0xC0000000325D5710 _Z11SQLConnect2P15CLI_CONNECTINFOPhsS1_sS1_sS1_sh + 0xA10
  [15] 0xC0000000325ADB90 _Z17SQLDriverConnect2P15CLI_CONNECTINFOPvPhsS2_sPsthhP19CLI_ERRORHEADERINFO + 0x26E0
  [16] 0xC0000000325AAC00 _Z11SQLConnect1P15CLI_CONNECTINFOPhsS1_sS1_s + 0xB60
  [17] 0xC0000000325A8E30 SQLConnect + 0xC10
  [18] 0x4000000000001EA0 main + 0x620
  [19] 0xC00000000006E9B0 _DYNAMIC + 0xC00000000006E993
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文