我正在运行nirgam 3.0,它是我的MacBook(Mac OS X 10.10)中基于SystemC的开源NoC模拟器。我成功编译了nirgam源代码,但是当尝试运行它时,它会抛出“分段错误”显示:
╰─$ ./nirgam
SystemC 2.3.1-Accellera --- May 3 2015 19:32:31
Copyright (c) 1996-2014 by all Contributors,
ALL RIGHTS RESERVED
[1] 5067 segmentation fault ./nirgam
(lldb) r
Process 5076 launched: './nirgam' (x86_64)
我尝试使用lldb
找出错误,我得到了以下提示:
SystemC 2.3.1-Accellera --- May 3 2015 19:32:31
Copyright (c) 1996-2014 by all Contributors,
ALL RIGHTS RESERVED
Process 5076 stopped
* thread #1: tid = 0x7321, 0x00000001000c9d8d nirgam`sc_main(argc=1, argv=0x00000001004060f0) + 45 at main.cpp:62, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=2, address=0x7fff5eb2dd18)
frame #0: 0x00000001000c9d8d nirgam`sc_main(argc=1, argv=0x00000001004060f0) + 45 at main.cpp:62
59
60 int sc_main(int argc, char *argv[])
61 {
-> 62 system("rm -rf *.txt");
63 system("rm -rf jitter/GT/*");
64 system("rm -rf jitter/BE/*");
65 cout<<"---------------------------------------------------------------------------"<<endl;
(lldb) bt
* thread #1: tid = 0x7321, 0x00000001000c9d8d nirgam`sc_main(argc=1, argv=0x00000001004060f0) + 45 at main.cpp:62, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=2, address=0x7fff5eb2dd18)
* frame #0: 0x00000001000c9d8d nirgam`sc_main(argc=1, argv=0x00000001004060f0) + 45 at main.cpp:62
frame #1: 0x0000000100238778 libsystemc-2.3.1.dylib`sc_elab_and_sim + 184
frame #2: 0x00007fff879a65c9 libdyld.dylib`start + 1
frame #3: 0x00007fff879a65c9 libdyld.dylib`start + 1
以下事实可以暗示:
我可以编译和运行其他基于SystemC的程序,包括Noxim和我在系统环境中编写的其他代码。
lldb信息显示转到sc_main
时发生错误,这是基于SystemC的建模中的主要功能。
我的问题是:
调用EXC_BAD_ACCESS
函数时sc_main
的含义是什么?
我有什么方法可以用来接近这个bug的来源吗?