断言失败,进程中止

时间:2015-11-01 11:36:12

标签: julia

我已经为julia中的数组使用实现了一个递归函数,它工作正常。但是当我将它用于更大的阵列时,会出现此错误。有吧......磁盘使用情况?我使用的是ubuntu 14.04 LTS。

julia: alloc.c:788: jl_unbox_int64: Assertion `jl_is_bitstype((((jl_value_t*)(v))->type))' failed.

signal (6): Aborted
gsignal at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
abort at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
unknown function (ip: -1627718778)
unknown function (ip: -1627718606)
jl_unbox_int64 at /home/user/julia/usr/bin/../lib/libjulia-debug.so (unknown line)
unknown function (ip: -1620295030)
unknown function (ip: -1620291405)
unknown function (ip: -1620294504)
unknown function (ip: -1620291405)
jl_uncompress_ast at /home/user/julia/usr/bin/../lib/libjulia-debug.so (unknown line)
unknown function (ip: -1620660584)
unknown function (ip: -1620791458)
unknown function (ip: -1620790289)
jl_trampoline at /home/user/julia/usr/bin/../lib/libjulia-debug.so (unknown line)
unknown function (ip: -1620898893)
jl_apply_generic at /home/user/julia/usr/bin/../lib/libjulia-debug.so (unknown line)
unknown function (ip: -1620898893)
unknown function (ip: -1620882118)
jl_apply_generic at /home/user/julia/usr/bin/../lib/libjulia-debug.so (unknown line)
unknown function (ip: -1620898893)
unknown function (ip: -1620894229)
unknown function (ip: -1620888209)
unknown function (ip: -1620886672)
jl_apply_generic at /home/user/julia/usr/bin/../lib/libjulia-debug.so (unknown line)
unknown function (ip: -1620898893)
unknown function (ip: -1620882118)
jl_apply_generic at /home/user/julia/usr/bin/../lib/libjulia-debug.so (unknown line)
unknown function (ip: -1620898893)
unknown function (ip: -1620894229)
unknown function (ip: -1620888209)
unknown function (ip: -1620886672)
jl_apply_generic at /home/user/julia/usr/bin/../lib/libjulia-debug.so (unknown line)
include_from_node1 at loading.jl:134
unknown function (ip: -1620859461)
jl_trampoline at /home/user/julia/usr/bin/../lib/libjulia-debug.so (unknown line)
unknown function (ip: -1620898893)
jl_apply_generic at /home/user/julia/usr/bin/../lib/libjulia-debug.so (unknown line)
process_options at ./client.jl:285
_start at ./client.jl:354
jlcall__start_17472 at /home/user/julia/usr/bin/../lib/julia/sys.so (unknown line)
unknown function (ip: -1620859461)
jl_trampoline at /home/user/julia/usr/bin/../lib/libjulia-debug.so (unknown line)
unknown function (ip: -1620898893)
jl_apply_generic at /home/user/julia/usr/bin/../lib/libjulia-debug.so (unknown line)
unknown function (ip: 4199848)
unknown function (ip: 4202915)
julia_trampoline at /home/user/julia/usr/bin/../lib/libjulia-debug.so (unknown line)
unknown function (ip: 4203396)
__libc_start_main at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
unknown function (ip: 4199593)
unknown function (ip: 0)
Aborted (core dumped)

请告诉我,如果您需要更多信息。提前谢谢。

干杯, CLAX

PS:这是功能。我正在寻找二进制数组中的对象。如果sth被分类,则设置为2(默认值):

function recGetObjChar(h::Int,w::Int,hP::HoughPoint,locObj::Array,obAr::Array,imAr::Array)
  #points in relative position to actual point
  leftPoint=HoughPoint(hP.x,hP.y-1,false,false,false,false);
  rightPoint=HoughPoint(hP.x,hP.y+1,false,false,false,false);
  topPoint=HoughPoint(hP.x-1,hP.y,false,false,false,false);
  bottomPoint=HoughPoint(hP.x+1,hP.y,false,false,false,false);

  #check if it out of bounds
  if(topPoint.x!=0)
    if(imAr[topPoint.x,topPoint.y]==1)
     hP.canGoT=true;
    end
  end
  if(bottomPoint.x!=(h+1))
   if(imAr[bottomPoint.x,bottomPoint.y]==1)
     hP.canGoB=true;
  end
  end
  if(leftPoint.y!=0)
   if(imAr[leftPoint.x,leftPoint.y]==1)
    hP.canGoL=true;
   end
  end
   if(rightPoint.y!=(w+1))
  if(imAr[rightPoint.x,rightPoint.y]==1)
      hP.canGoR=true;
  end
  end

 # set direction options false and continue recursive with next point
 if((hP.canGoL)&&(imAr[leftPoint.x,leftPoint.y]!=2))
 locObj=[locObj,leftPoint];
 hP.canGoL=false;
 lTPoint=HoughPoint(hP.x-1,hP.y-1,false,false,false,false);
 lBPoint=HoughPoint(hP.x+1,hP.y-1,false,false,false,false);
 for l=1:length(locObj)
       if((locObj[l].x==lTPoint.x)&&(locObj[l].y==lTPoint.y))
        locObj[l].canGoB=false;
      end
      if((locObj[l].x==lBPoint.x)&&(locObj[l].y==lBPoint.y))
        locObj[l].canGoT=false;
      end
  end
 imAr[leftPoint.x,leftPoint.y]=2;
 return recGetObjChar(h,w,leftPoint,locObj,obAr,imAr);
 end
 if((hP.canGoT)&&(imAr[topPoint.x,topPoint.y]!=2))
 locObj=[locObj,topPoint];
 hP.canGoT=false;
 tLPoint=HoughPoint(hP.x-1,hP.y-1,false,false,false,false);
 tRPoint=HoughPoint(hP.x-1,hP.y+1,false,false,false,false);
 for l=1:length(locObj)
       if((locObj[l].x==tLPoint.x)&&(locObj[l].y==tLPoint.y))
        locObj[l].canGoR=false;
      end
      if((locObj[l].x==tRPoint.x)&&(locObj[l].y==tRPoint.y))
        locObj[l].canGoL=false;
      end
  end
 imAr[topPoint.x,topPoint.y]=2;
 return recGetObjChar(h,w,topPoint,locObj,obAr,imAr);
 end
 if((hP.canGoR)&&(imAr[rightPoint.x,rightPoint.y]!=2))
 locObj=[locObj,rightPoint];
 hP.canGoR=false;
 rTPoint=HoughPoint(hP.x-1,hP.y+1,false,false,false,false);
 rBPoint=HoughPoint(hP.x+1,hP.y+1,false,false,false,false);
 for l=1:length(locObj)
       if((locObj[l].x==rTPoint.x)&&(locObj[l].y==rTPoint.y))
        locObj[l].canGoB=false;
      end
      if((locObj[l].x==rBPoint.x)&&(locObj[l].y==rBPoint.y))
        locObj[l].canGoT=false;
      end
  end
  imAr[rightPoint.x,rightPoint.y]=2;
 return recGetObjChar(h,w,rightPoint,locObj,obAr,imAr);
 end
 if((hP.canGoB)&&(imAr[bottomPoint.x,bottomPoint.y]!=2))
 locObj=[locObj,bottomPoint];
 hP.canGoB=false;
 bLPoint=HoughPoint(hP.x+1,hP.y-1,false,false,false,false);
 bRPoint=HoughPoint(hP.x+1,hP.y+1,false,false,false,false);
 for l=1:length(locObj)
       if((locObj[l].x==bLPoint.x)&&(locObj[l].y==bLPoint.y))
        locObj[l].canGoR=false;
      end
      if((locObj[l].x==bRPoint.x)&&(locObj[l].y==bRPoint.y))
        locObj[l].canGoL=false;
      end
  end
 imAr[bottomPoint.x,bottomPoint.y]=2;
 return recGetObjChar(h,w,bottomPoint,locObj,obAr,imAr);
 end

  # check if any direction options are left, if yes continue with recursive function
  for c=1:length(locObj)
  # FIX check bounds for y
  xCoor=locObj[c].x;
  yCoor=locObj[c].y;

  if((locObj[c].canGoL)&&(imAr[xCoor,yCoor-1]!=2))
    missLP=HoughPoint(xCoor,yCoor-1,false,false,false,false);
    locObj=[locObj,missLP];
    locObj[c].canGoL=false;
    imAr[missLP.x,missLP.y]=2;
    return recGetObjChar(h,w,missLP,locObj,obAr,imAr);
  end
  if(locObj[c].canGoT)
    if(imAr[xCoor-1,yCoor]!=2)
    missTP=HoughPoint(xCoor-1,yCoor,false,false,false,false);
    locObj=[locObj,missTP];
    locObj[c].canGoT=false;
    imAr[missTP.x,missTP.y]=2;
    return recGetObjChar(h,w,missTP,locObj,obAr,imAr);
    end
  end
  if((locObj[c].canGoR)&&(imAr[xCoor,yCoor+1]!=2))
    missRP=HoughPoint(xCoor,yCoor+1,false,false,false,false);
    locObj=[locObj,missRP];
    locObj[c].canGoR=false;
    imAr[missRP.x,missRP.y]=2;
    return recGetObjChar(h,w,missRP,locObj,obAr,imAr);
  end
  if(locObj[c].canGoB)
    if (imAr[xCoor+1,yCoor]!=2)
    missBP=HoughPoint(xCoor+1,yCoor,false,false,false,false);
    locObj=[locObj,missBP];
    locObj[c].canGoB=false;
    imAr[missBP.x,missBP.y]=2;
    return recGetObjChar(h,w,missBP,locObj,obAr,imAr);
    end
  end
end
locObj=HoughPoints(locObj);
obAr=[obAr,locObj];
return obAr;
end

0 个答案:

没有答案