我正在使用Apache/PHP/MySQL堆栈.
使用CakePHP作为框架.
我偶尔会得到一个空白的白页.我无法通过Cake调试它,所以我偷看了apache error.log,这就是我得到的:
[Wed Oct 12 15:27:23 2011] [notice] child pid 3580 exit signal Segmentation fault (11)
[Wed Oct 12 15:27:34 2011] [notice] child pid 3581 exit signal Segmentation fault (11)
[Wed Oct 12 15:30:52 2011] [notice] child pid 3549 exit signal Segmentation fault (11)
[Wed Oct 12 16:04:27 2011] [notice] child pid 3579 exit signal Segmentation fault (11)
zend_mm_heap corrupted
[Wed Oct 12 16:26:24 2011] [notice] child pid 3625 exit signal Segmentation fault (11)
[Wed Oct 12 17:57:24 …Run Code Online (Sandbox Code Playgroud) 我正在为FFmpeg编写补丁,需要调试我的代码.我正在加载一个外部库,为了测试不同的库版本,我将它们放在不同的文件夹中.要选择我想要使用哪一个,我一直在使用DYLD_LIBRARY_PATH=/path/to/lib/dir ./ffmpeg,并且工作正常.但是当我在lldb里面尝试时,它崩溃说dyld: Library not loaded和Reason: image not found.这曾经在Xcode 7.1之前工作,但我刚刚升级并停止工作.
这是我的MVCE:
#include <stdio.h>
#include <stdlib.h>
int main() {
char* str = getenv("DYLD_LIBRARY_PATH");
if (str) puts(str);
else puts("(null)");
return 0;
}
Run Code Online (Sandbox Code Playgroud)
按如下方式运行此程序会产生输出:
$ ./a.out
(null)
$ DYLD_LIBRARY_PATH=/tmp ./a.out
/tmp
Run Code Online (Sandbox Code Playgroud)
那看起来还不错.但是当我尝试使用lldb时它会失败:
$ DYLD_LIBRARY_PATH=/tmp lldb ./a.out
(lldb) target create "./a.out"
Current executable set to './a.out' (x86_64).
(lldb) run
Process 54255 launched: './a.out' (x86_64)
(null)
Process 54255 exited with status = 0 (0x00000000)
Run Code Online (Sandbox Code Playgroud)
试图在lldb中设置环境变量:
lldb ./a.out
(lldb) …Run Code Online (Sandbox Code Playgroud) 过去几天我一直在OS X Lion上试用Emacs 24(预测试24.0.95.1),但是我遇到了新gdb/MI界面的一些问题.
使用Xcode附带的GDB 6.3,但gdb/MI接口似乎根本没有加载.它似乎尝试启动GDB GUD模式,但没有命令实际工作.
我还尝试通过Homebrew安装GDB-7.4.这让我部分在那里.gdb-many-windows界面显示,但gdb提示永远不会到达.Emacs只是坐在那里吃了100%的CPU,但却没有反应迟钝.我仍然可以打开文件等.我只是无法用GDB做任何事情.
有没有其他人遇到过类似的问题?你能解决它们,如果是这样,怎么办?
编辑:2012-06-10:我刚刚尝试了新发布的Emacs 24.1.GDB 6.3(通过Xcode)的行为保持不变.GDB-7.4略差,因为它启动了GDB,而emacs耗尽了100%的CPU,但现在我无法做任何其他事情.Emacs如果被冻结:/
我已经通过自制软件在我的Mac(使用Mac OS 10.9/Mavericks)上安装了gdb并成功对其进行了编码.
在使用gdb启动调试会话之前,我编译了我的C文件,如下例所示:
gcc -g test.c -o test
Run Code Online (Sandbox Code Playgroud)
之后我打电话给gdb:
Users-MacBook-Pro:Test User$ gdb ./test
GNU gdb (GDB) 8.0.1
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
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-apple-darwin13.4.0".
Type "show configuration" for configuration details.
For bug reporting instructions, …Run Code Online (Sandbox Code Playgroud) 我在小牛队安装了一个brew版本的gdb.它是编码签名的,我可以在本地连接时调试没有问题:
$ gdb myprog
GNU gdb (GDB) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
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-apple-darwin13.3.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation …Run Code Online (Sandbox Code Playgroud) 我有一个在Linux移动设备上运行的用户级C ++测试应用程序。其中一项测试涉及启用/禁用打印机纸张传感器,这需要在设备文件上写入具有root权限。有没有办法向我的应用程序授予这种特权?如果没有,是否有解决方法?