当前位置:  开发笔记 > 编程语言 > 正文

gdb:找不到新线程:泛型错误

如何解决《gdb:找不到新线程:泛型错误》经验,为你挑选了5个好方法。

当我对一个加载.so的程序运行GDB时,该程序链接到pthreads,GDB报告错误"无法找到新的线程:泛型错误".

请注意,我运行的可执行文件未与pthreads链接.

有线索吗?

$ gdb --args lua -lluarocks.require
GNU gdb (GDB) 7.0-ubuntu
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
...
Reading symbols from /usr/bin/lua...(no debugging symbols found)...done.
(gdb) run
Starting program: /usr/bin/lua -lluarocks.require
Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio
> require 'ev'
[Thread debugging using libthread_db enabled]
Cannot find new threads: generic error
(gdb) q
A debugging session is active.

    Inferior 1 [process 4986] will be killed.

Quit anyway? (y or n) y

调用此函数require 'ev':

http://github.com/brimworks/lua-ev/blob/master/lua_ev.c#L25-65

有关我的系统的其他信息:

$ uname -a
Linux localhost 2.6.31-20-generic #58-Ubuntu SMP Fri Mar 12 04:38:19 UTC 2010 x86_64 GNU/Linux
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 9.10
Release:    9.10
Codename:   karmic

ensonic.. 29

这也有效:

LD_PRELOAD =/lib/libpthread.so.0 gdb --args ./app



1> ensonic..:

这也有效:

LD_PRELOAD =/lib/libpthread.so.0 gdb --args ./app



2> Brian..:

64位Ubuntu用户应该这样做:

LD_PRELOAD=/lib/x86_64-linux-gnu/libpthread.so.0 gdb --args ./app



3> jbaylina..:

您还可以.gdbinit在包含此文本的主目录中创建一个:

set env LD_PRELOAD /lib/libpthread.so.0



4> Alexander Gl..:

当应用程序"突然"依赖于pthread时,GDB似乎不喜欢.

我发现的唯一解决方法是将主机应用程序与pthreads链接起来.

哪个很难过......



5> Gearoid Murp..:

我发现在完成链接到pthreads库的运行时之后,gdb可以附加到进程.

推荐阅读
手机用户2402851335
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有