免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2202 | 回复: 1
打印 上一主题 下一主题

[FastDFS] FastDFS v4.0.6 coredump问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2013-09-17 17:44 |只看该作者 |倒序浏览
本帖最后由 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的地方加了一些日志
  1.                 pthread_t pid = pthread_self();
  2.                 time_t ttt = time(NULL);
  3.                 char *func_name = NULL;
  4.                 while ((pTask=task_queue_pop(&(pContext->queue))) != NULL)
  5.                 {
  6.                         if(((StorageClientInfo *)pTask->arg)->deal_func == storage_do_create_link)
  7.                         {
  8.                                 func_name = "storage_do_create_link";
  9.                         }
  10.                         else if(((StorageClientInfo *)pTask->arg)->deal_func == dio_delete_normal_file)
  11.                         {
  12.                                 func_name = "dio_delete_normal_file";
  13.                         }
  14.                         else if(((StorageClientInfo *)pTask->arg)->deal_func == dio_delete_trunk_file)
  15.                         {
  16.                                 func_name = "dio_delete_trunk_file";
  17.                         }
  18.                         else if(((StorageClientInfo *)pTask->arg)->deal_func == dio_read_file)
  19.                         {
  20.                                 func_name = "dio_read_file";
  21.                         }
  22.                         else if(((StorageClientInfo *)pTask->arg)->deal_func == storage_do_sync_link_file)
  23.                         {
  24.                                 func_name = "storage_do_sync_link_file";
  25.                         }
  26.                         else if(((StorageClientInfo *)pTask->arg)->deal_func == dio_discard_file)
  27.                         {
  28.                                 func_name = "dio_discard_file";
  29.                         }
  30.                         else if(((StorageClientInfo *)pTask->arg)->deal_func == dio_write_file)
  31.                         {
  32.                                 func_name = "dio_write_file";
  33.                         }
  34.                         else if(((StorageClientInfo *)pTask->arg)->deal_func == storage_server_fetch_one_path_binlog_dealer)
  35.                         {
  36.                                 func_name = "storage_server_fetch_one_path_binlog_dealer";
  37.                         }
  38.                         else if(((StorageClientInfo *)pTask->arg)->deal_func == storage_do_set_metadata)
  39.                         {
  40.                                 func_name = "storage_do_set_metadata";
  41.                         }
  42.                         else if(((StorageClientInfo *)pTask->arg)->deal_func == dio_truncate_file)
  43.                         {
  44.                                 func_name = "dio_truncate_file";
  45.                         }
  46.                         else if(((StorageClientInfo *)pTask->arg)->deal_func == dio_open_file)
  47.                         {
  48.                                 func_name = "dio_open_file";
  49.                         }
  50.                         else if(((StorageClientInfo *)pTask->arg)->deal_func == dio_write_chunk_header)
  51.                         {
  52.                                 func_name = "dio_write_chunk_header";
  53.                         }
  54.                         else
  55.                         {
  56.                                 func_name = "unknown";
  57.                         }

  58.                         FILE *fp = fopen("/home/yyyyyy/aaaaa/logs_cache/fdfs_storaged_fei.log", "a");   
  59.                         if(NULL != fp)
  60.                         {
  61.                                 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);
  62.                                 fflush(fp);
  63.                         }
  64.                         ((StorageClientInfo *)pTask->arg)->deal_func(pTask);
  65.                         if(NULL != fp)
  66.                         {
  67.                                 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);
  68.                                 fclose(fp);
  69.                         }
  70.                 }
复制代码
得到这样的日志:
  1. 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
  2. =102, sock=89
  3. 1379396554 after pid=1112979776, client_ip=111.111.111.218, size=262144, length=199911, offset=262144, req_count=1
  4. 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=
  5. 96
  6. 1379396554 after pid=1108224320, client_ip=111.111.111.215, size=262144, length=3485, offset=102, req_count=1
  7. 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
  8. 1, sock=89
  9. 1379396554 after pid=1121433920, client_ip=111.111.111.215, size=262144, length=86, offset=4431, req_count=1
  10. [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=
  11. 5879278, sock=96(这条日志有问题)[/color][/b]
  12. 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
  13. k=90
  14. 1379396582 after pid=1114749248, client_ip=111.111.111.218, size=262144, length=262144, offset=86, req_count=1
  15. 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
  16. =86, sock=90
  17. 1379396582 after pid=1114749248, client_ip=111.111.111.218, size=262144, length=262144, offset=262144, req_count=1
  18. 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
  19. =86, sock=90
  20. 1379396582 after pid=1114749248, client_ip=111.111.111.218, size=262144, length=262144, offset=262144, req_count=1
  21. 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
  22. =86, sock=90
复制代码
  1. [yyyyyy@xxxxxx data]$ ls -rt
  2. 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
  3. 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
  4. 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
  5. 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
  6. 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
  7. 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
  8. 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
  9. 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
  10. 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
  11. 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
  12. 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
  13. [yyyyyy@xxxxxx data]$ pwd
  14. /home2/fastdfs/data
  15. [yyyyyy@xxxxxx data]$
复制代码

论坛徽章:
4
2015年辞旧岁徽章
日期:2015-03-03 16:54:152015年迎新春徽章
日期:2015-03-04 09:56:11IT运维版块每日发帖之星
日期:2016-08-11 06:20:00IT运维版块每日发帖之星
日期:2016-08-15 06:20:00
2 [报告]
发表于 2013-09-18 17:16 |只看该作者
升级到v4.07试试
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP