我在让 rrdtool(版本 1.4.8)在我的系统(x86_64 CentOS 4.1、内核 2.6.18.128 和 ext3 文件系统类型)上创建数据库时遇到问题。
我尝试运行一个简单的命令来创建本教程所示的数据库,但我收到一个 SIGBUS 错误,它似乎与 memcpy() 有关。我在下面展示了来自 gdb 的回溯。
(gdb) run create test.rrd --start 920804400 DS:speed:COUNTER:600:U:U RRA:AVERAGE:0.5:1:24 RRA:AVERAGE:0.5:6:10
Starting program: rrdtool-1.4.8/src/.libs/rrdtool create test.rrd --start 920804400 DS:speed:COUNTER:600:U:U RRA:AVERAGE:0.5:1:24 RRA:AVERAGE:0.5:6:10
(no debugging symbols found)
Program received signal SIGBUS, Bus error.
0x00002acb298da7d3 in memcpy () from /lib64/tls/libc.so.6
(gdb) bt
#0 0x00002b46e74ae7d3 in memcpy () from /lib64/tls/libc.so.6
#1 0x00002b46e731d612 in rrd_write (rrd_file=0x1c46e230, buf=0x1c46e0a0, count=128) at rrd_open.c:716
#2 0x00002b46e731515e in rrd_create_fn (file_name=0x7fffc38b9a3f "test.rrd", rrd=0x7fffc38b8b60) at rrd_create.c:727
#3 0x00002b46e7314a28 in rrd_create_r (filename=0x7fffc38b9a3f "test.rrd", pdp_step=300, last_up=920804400, argc=3, argv=0x7fffc38b9070) at rrd_create.c:580
#4 0x00002b46e731330e in rrd_create (argc=7, argv=0x7fffc38b9050) at rrd_create.c:113
#5 0x00000000004028db in HandleInputLine (argc=8, argv=0x7fffc38b9048, out=0x2b46e766a680) at rrd_tool.c:646
#6 0x00000000004023a2 in main (argc=8, argv=0x7fffc38b9048) at rrd_tool.c:521
(gdb) up
#1 0x00002b46e731d612 in rrd_write (rrd_file=0x1c46e230, buf=0x1c46e0a0, count=128) at rrd_open.c:716
716 memcpy(rrd_simple_file->file_start + rrd_file->pos, buf, count);
(gdb) p rrd_file->pos
$21 = 0
(gdb) p (char *)buf
$25 = 0x1c46e0a0 "RRD"
(gdb) p rrd_simple_file->file_start
$22 = 0x2b46ea64b000 "RRD"
(gdb) p count
$23 = 128
这里有什么问题,我该如何解决?