当前位置:论坛首页 > Linux面板 > 讨论

【已回应】安装宝塔后在panel目录下有两个异常文件在跑CPU

发表在 Linux面板2018-9-7 00:53 [复制链接] 3 2296

目录:/www/server/panel 有一个testcpu.c 的C源码文件 和testcpu进程文件。
testcpu.c源码:
  1. #include <stdio.h>
  2. #include <pthread.h>
  3. #include <unistd.h>
  4. #include <time.h>

  5. const int N_qsort = 10000;
  6. const int N_int   = 10000;
  7. const int N_float = 20000;
  8. const int N_pi    = 50000000;


  9. int thread_count = 0;

  10. void int_comp(void);
  11. void float_comp(void);
  12. void pi_comp(void);
  13. void to_qsort(int arr[],int low,int high);
  14. void qsort_comp(void);
  15. void thread(void);
  16. void thread_int(void);
  17. void thread_float(void);
  18. void thread_pi(void);
  19. void thread_qsort(void);

  20. int main(int argc,char** argv){
  21.         int count,i,result,type;
  22.         count = atoi(argv[1]);
  23.         type =  atoi(argv[2]);
  24.         if(argc < 3){
  25.                 printf("ERROR: Parameter error[%d]",argc);
  26.         }
  27.         pthread_t tid;
  28.         for(i=0;i<count;i++){
  29.                 switch(type){
  30.                         case 1:
  31.                                 pthread_create(&tid,NULL,(void *) thread_int,NULL);
  32.                                 break;
  33.                         case 2:
  34.                                 pthread_create(&tid,NULL,(void *) thread_float,NULL);
  35.                                 break;
  36.                         case 3:
  37.                                 pthread_create(&tid,NULL,(void *) thread_pi,NULL);
  38.                                 break;
  39.                         case 4:
  40.                                 pthread_create(&tid,NULL,(void *) thread_qsort,NULL);
  41.                                 break;
  42.                         default:
  43.                                 pthread_create(&tid,NULL,(void *) thread,NULL);
  44.                                 break;
  45.                 }
  46.                
  47.         }
  48.         
  49.         while(thread_count != count){
  50.                 sleep(0.1);
  51.         }
  52.         return 0;
  53. }

  54. void thread(void){
  55.         int_comp();
  56.         float_comp();
  57.         pi_comp();
  58.         qsort_comp();
  59.         thread_count++;
  60. }

  61. void thread_int(void){
  62.         int_comp();
  63.         thread_count++;
  64. }

  65. void thread_float(void){
  66.         float_comp();
  67.         thread_count++;
  68. }

  69. void thread_pi(void){
  70.         pi_comp();
  71.         thread_count++;
  72. }

  73. void thread_qsort(void){
  74.         qsort_comp();
  75.         thread_count++;
  76. }

  77. void int_comp(void){
  78.      int i,j;
  79.      for(i=0;i<N_int;i++)
  80.          for(j=0;j<N_float;j++);
  81. }

  82. void float_comp(void){
  83.      float i,j;
  84.      for(i=0;i<N_int;i++)
  85.              for(j=0;j<N_float;j++);
  86. }

  87. void pi_comp(void){
  88.      int m,i=1;
  89.      double s=0;
  90.      for(m=1;m<N_pi;m+=2){
  91.         s+=i*(1.0/m);
  92.         i=-i;
  93.      }
  94. }

  95. void to_qsort(int arr[],int low,int high){
  96.      if(low>=high) return;
  97.      int first=low;
  98.      int last=high;
  99.      int key=arr[first];
  100.      while(first<last){
  101.          while(first<last&&arr[last]>=key) --last;
  102.          arr[first]=arr[last];
  103.          while(first<last&&arr[first]<=key) ++first;
  104.          arr[last]=arr[first];
  105.      }
  106.      arr[first]=key;
  107.      to_qsort(arr,low,first-1);
  108.      to_qsort(arr,first+1,high);
  109. }

  110. void qsort_comp(void){
  111.      int arr[N_qsort],i;
  112.      for(i=N_qsort;i>0;i--) arr[N_qsort-1]=i;
  113.      to_qsort(arr,0,N_qsort-1);
  114. }
复制代码
testcpu文件一直在跑CPU,是宝塔的程序吗?
1536252660.png
使用道具 举报 只看该作者 回复
发表于 2018-9-7 10:30:20 | 显示全部楼层
这个是宝塔跑跑分执行文件 你看是不是有在跑宝塔跑分
使用道具 举报 回复 支持 反对
发表于 2018-9-7 16:59:37 | 显示全部楼层
河妖 发表于 2018-9-7 10:30
这个是宝塔跑跑分执行文件 你看是不是有在跑宝塔跑分

跑了一天一夜都没跑完,是不是宝塔对跑分文件处理流程有遗漏,而且我也没用过跑分
使用道具 举报 回复 支持 反对
发表于 2018-9-8 09:58:21 | 显示全部楼层
Toping 发表于 2018-9-7 16:59
跑了一天一夜都没跑完,是不是宝塔对跑分文件处理流程有遗漏,而且我也没用过跑分 ...

你可以直接把这进程kill掉
使用道具 举报 回复 支持 反对
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

普通问题处理

论坛响应时间:72小时

问题处理方式:排队(仅解答)

工作时间:白班:9:00 - 18:00

紧急运维服务

响应时间:3分钟

问题处理方式:宝塔专家1对1服务

工作时间:工作日:9:00 - 18:30

宝塔专业团队为您解决服务器疑难问题

点击联系技术免费分析

工作时间:09:00至18:30

快速回复 返回顶部 返回列表