Julia 断言失败,进程中止
我在julia中实现了一个递归函数,用于数组使用,效果很好。但当我将其用于更大的阵列时,会出现此错误。这与磁盘使用有关吗?我使用的是ubuntu 14.04 LTSJulia 断言失败,进程中止,julia,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 (
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)
如果你需要更多信息,请告诉我。提前谢谢
干杯,
克拉克斯
PS:这里是函数。我正在寻找二进制数组中的对象。如果某事物被分类,则将其设置为2(默认值):
嗨,克拉克斯!,元素类型是什么?嘿Reza Afzalan!谢谢你的快速回复。它们是Float64或Int,但通常是Float64。我试图使用Int,但同样的错误发生了。你的内存用完了吗
alloc
是分配内存的C调用。递归函数是什么样子的?阵列有多大?user@ubuntu:~$free-m已使用的可用共享缓冲区缓存内存总数:30021682130216319516-/+缓冲区/缓存:8462156交换:10210121我已经查过我的RAM usageHi clax!,元素类型是什么?嘿Reza Afzalan!谢谢你的快速回复。它们是Float64或Int,但通常是Float64。我试图使用Int,但同样的错误发生了。你的内存用完了吗alloc
是分配内存的C调用。递归函数是什么样子的?阵列有多大?user@ubuntu:~$free-m已使用的可用共享缓冲区缓存内存总数:30021682130216319516-/+缓冲区/缓存:8462156交换:10210121我已经查过我的内存使用情况了
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