- 论坛徽章:
- 0
|
本帖最后由 shenzhisanyuan 于 2013-09-17 17:48 编辑
这几个月来FastDFS(v4.0.6) 总是时不时coredump,希望版主帮忙解决一下。
系统 CentOS release 5.8 (Final)
内核 Linux xxxxxx 2.6.18-308.el5 #1 SMP Tue Feb 21 20:06:06 EST 2012 x86_64 x86_64 x86_64 GNU/Linux
gdb 信息
warning: no loadable sections found in added symbol-file system-supplied DSO at 0x7fffb3bbb000
Core was generated by `/home/yyyyyy/local/fastdfs/bin/fdfs_storaged /home/yyyyyy/local/fastdfs/c'.
Program terminated with signal 11, Segmentation fault.
#0 0x0000000000000000 in ?? ()
(gdb) bt
#0 0x0000000000000000 in ?? ()
#1 0x0000000000435739 in dio_thread_entrance (arg=<value optimized out>) at storage_dio.c:847
#2 0x00000031f5c0677d in start_thread () from /lib64/libpthread.so.0
#3 0x00000031f50d49ad in clone () from /lib64/libc.so.6
(gdb)
我们在coredump的地方加了一些日志- pthread_t pid = pthread_self();
- time_t ttt = time(NULL);
- char *func_name = NULL;
- while ((pTask=task_queue_pop(&(pContext->queue))) != NULL)
- {
- if(((StorageClientInfo *)pTask->arg)->deal_func == storage_do_create_link)
- {
- func_name = "storage_do_create_link";
- }
- else if(((StorageClientInfo *)pTask->arg)->deal_func == dio_delete_normal_file)
- {
- func_name = "dio_delete_normal_file";
- }
- else if(((StorageClientInfo *)pTask->arg)->deal_func == dio_delete_trunk_file)
- {
- func_name = "dio_delete_trunk_file";
- }
- else if(((StorageClientInfo *)pTask->arg)->deal_func == dio_read_file)
- {
- func_name = "dio_read_file";
- }
- else if(((StorageClientInfo *)pTask->arg)->deal_func == storage_do_sync_link_file)
- {
- func_name = "storage_do_sync_link_file";
- }
- else if(((StorageClientInfo *)pTask->arg)->deal_func == dio_discard_file)
- {
- func_name = "dio_discard_file";
- }
- else if(((StorageClientInfo *)pTask->arg)->deal_func == dio_write_file)
- {
- func_name = "dio_write_file";
- }
- else if(((StorageClientInfo *)pTask->arg)->deal_func == storage_server_fetch_one_path_binlog_dealer)
- {
- func_name = "storage_server_fetch_one_path_binlog_dealer";
- }
- else if(((StorageClientInfo *)pTask->arg)->deal_func == storage_do_set_metadata)
- {
- func_name = "storage_do_set_metadata";
- }
- else if(((StorageClientInfo *)pTask->arg)->deal_func == dio_truncate_file)
- {
- func_name = "dio_truncate_file";
- }
- else if(((StorageClientInfo *)pTask->arg)->deal_func == dio_open_file)
- {
- func_name = "dio_open_file";
- }
- else if(((StorageClientInfo *)pTask->arg)->deal_func == dio_write_chunk_header)
- {
- func_name = "dio_write_chunk_header";
- }
- else
- {
- func_name = "unknown";
- }
- FILE *fp = fopen("/home/yyyyyy/aaaaa/logs_cache/fdfs_storaged_fei.log", "a");
- if(NULL != fp)
- {
- fprintf(fp, "%ld begin pid=%ld, client_ip=%s, size=%d, length=%d, offset=%d, req_count=%d, func_name=%s, total_length=%ld, total_offset=%ld, request_length=%ld, sock=%d\n", ttt, pid, pTask->client_ip, pTask->size, pTask->length, pTask->offset, pTask->req_count, func_name, ((StorageClientInfo *)pTask->arg)->total_length, ((StorageClientInfo *)pTask->arg)->total_offset, ((StorageClientInfo *)pTask->arg)->request_length, ((StorageClientInfo *)pTask->arg)->sock);
- fflush(fp);
- }
- ((StorageClientInfo *)pTask->arg)->deal_func(pTask);
- if(NULL != fp)
- {
- fprintf(fp, "%ld after pid=%ld, client_ip=%s, size=%d, length=%d, offset=%d, req_count=%d\n", ttt, pid, pTask->client_ip, pTask->size, pTask->length, pTask->offset, pTask->req_count);
- fclose(fp);
- }
- }
复制代码 得到这样的日志:- 1379396554 begin pid=1112979776, client_ip=111.111.111.218, size=262144, length=0, offset=262144, req_count=1, func_name=dio_read_file, total_length=2559207, total_offset=2359296, request_length
- =102, sock=89
- 1379396554 after pid=1112979776, client_ip=111.111.111.218, size=262144, length=199911, offset=262144, req_count=1
- 1379396554 begin pid=1108224320, client_ip=111.111.111.215, size=262144, length=10, offset=102, req_count=1, func_name=dio_read_file, total_length=3485, total_offset=0, request_length=102, sock=
- 96
- 1379396554 after pid=1108224320, client_ip=111.111.111.215, size=262144, length=3485, offset=102, req_count=1
- 1379396554 begin pid=1121433920, client_ip=111.111.111.215, size=262144, length=4431, offset=4431, req_count=1, func_name=dio_write_file, total_length=4431, total_offset=4431, request_length=443
- 1, sock=89
- 1379396554 after pid=1121433920, client_ip=111.111.111.215, size=262144, length=86, offset=4431, req_count=1
- [b][color=Red]1379396555 begin pid=1108224320, client_ip=111.111.111.215, size=262144, length=0, offset=96360, req_count=1217, func_name=unknown, total_length=4294619254, total_offset=-348042, request_length=
- 5879278, sock=96(这条日志有问题)[/color][/b]
- 1379396582 begin pid=1114749248, client_ip=111.111.111.218, size=262144, length=10, offset=86, req_count=1, func_name=dio_read_file, total_length=18369802, total_offset=0, request_length=86, soc
- k=90
- 1379396582 after pid=1114749248, client_ip=111.111.111.218, size=262144, length=262144, offset=86, req_count=1
- 1379396582 begin pid=1114749248, client_ip=111.111.111.218, size=262144, length=0, offset=262144, req_count=1, func_name=dio_read_file, total_length=18369802, total_offset=262144, request_length
- =86, sock=90
- 1379396582 after pid=1114749248, client_ip=111.111.111.218, size=262144, length=262144, offset=262144, req_count=1
- 1379396582 begin pid=1114749248, client_ip=111.111.111.218, size=262144, length=0, offset=262144, req_count=1, func_name=dio_read_file, total_length=18369802, total_offset=524288, request_length
- =86, sock=90
- 1379396582 after pid=1114749248, client_ip=111.111.111.218, size=262144, length=262144, offset=262144, req_count=1
- 1379396582 begin pid=1114749248, client_ip=111.111.111.218, size=262144, length=0, offset=262144, req_count=1, func_name=dio_read_file, total_length=18369802, total_offset=786432, request_length
- =86, sock=90
复制代码- [yyyyyy@xxxxxx data]$ ls -rt
- 00 0B 16 21 2C 37 42 4D 58 63 6E 79 84 8F 9A A5 B0 BB C6 D1 DC E7 F2 FD core.17594 core.9710 core.18796 core.2812 core.22707 core.18831 core.14056
- 01 0C 17 22 2D 38 43 4E 59 64 6F 7A 85 90 9B A6 B1 BC C7 D2 DD E8 F3 FE core.17490 core.3352 core.20708 core.28664 core.995 core.26018 core.18736
- 02 0D 18 23 2E 39 44 4F 5A 65 70 7B 86 91 9C A7 B2 BD C8 D3 DE E9 F4 FF core.3720 core.24246 core.11679 core.2422 core.16723 core.20029 core.12201
- 03 0E 19 24 2F 3A 45 50 5B 66 71 7C 87 92 9D A8 B3 BE C9 D4 DF EA F5 core.20914 core.28485 core.403 core.13392 core.24236 core.20669 core.32397 core.13323
- 04 0F 1A 25 30 3B 46 51 5C 67 72 7D 88 93 9E A9 B4 BF CA D5 E0 EB F6 core.26179 core.28950 core.22619 core.1661 core.22035 core.22483 core.4979 core.4227
- 05 10 1B 26 31 3C 47 52 5D 68 73 7E 89 94 9F AA B5 C0 CB D6 E1 EC F7 core.29175 core.12873 core.21716 core.2147 core.24149 core.16075 core.9337 core.26922
- 06 11 1C 27 32 3D 48 53 5E 69 74 7F 8A 95 A0 AB B6 C1 CC D7 E2 ED F8 core.2942 core.17386 core.22267 core.3940 core.9446 core.9884 core.10010
- 07 12 1D 28 33 3E 49 54 5F 6A 75 80 8B 96 A1 AC B7 C2 CD D8 E3 EE F9 core.20692 core.20210 core.11219 core.24495 core.19882 core.8150 core.23943
- 08 13 1E 29 34 3F 4A 55 60 6B 76 81 8C 97 A2 AD B8 C3 CE D9 E4 EF FA core.3156 core.21366 core.21450 core.24628 core.18074 core.21823 core.24958
- 09 14 1F 2A 35 40 4B 56 61 6C 77 82 8D 98 A3 AE B9 C4 CF DA E5 F0 FB core.1445 core.7236 core.22853 core.24856 core.20102 core.22172 core.24258
- 0A 15 20 2B 36 41 4C 57 62 6D 78 83 8E 99 A4 AF BA C5 D0 DB E6 F1 FC core.21729 core.20208 core.24129 core.11828 core.22290 core.12946 core.7732
- [yyyyyy@xxxxxx data]$ pwd
- /home2/fastdfs/data
- [yyyyyy@xxxxxx data]$
复制代码 |
|