I have experimented on my Mac with the following cases.

((i."0 1) %)~ 10 10{.(?. 100 100 $ 0)
((i."0 1) %)~ 20 20{.(?. 100 100 $ 0)
((i."0 1) %)~ 30 30{.(?. 100 100 $ 0)
...

((i."0 1) %)~ 90 90{.(?. 100 100 $ 0)

None of the above produces a segmentation fault.
But beginning with

((i."0 1) %)~ 91 91{.(?. 100 100 $ 0)

I get a segmentation fault.


  a=:  91 91{.(?. 100 100 $ 0)

I experimented by looking for the largest and smallest fraction in a and
eliminating them (as shown for the largest below), but still got a fault.

   <./,a
5.76835e_5
   >./,a
0.999899

   <./,a
5.76835e_5
   b=: <./,a
   b i.~ ,a
3832
   91(|,>.@%~)3832
10 43
   (< 42 10 ){a
5.76835e_5
   aa=: 0.5 (< 42 10 )}a

   ((i."0 1) %)~ aa NB. also, segmentation fault

   aa =: 0.5 (< 18 87 )}a
   ((i."0 1) %)~ aa NB. also, segmentation fault


Looking at the 91st row and column did not uncover anything unusual to me,
either (see below). So I wonder if the problem is in the size of the
argument, because I then tried using ? instead of ?. with 100 100 size
argument and got the fault as well.

  _6]\{:a
 0.985428 0.0872343  0.444892 0.0163434  0.178708 0.0625026
  0.32906  0.865677  0.796171  0.489302  0.973809  0.218955
 0.752501  0.719862  0.482846   0.94233   0.94595  0.618933
 0.897338  0.145172  0.448141  0.988398  0.230103   0.79877
 0.627963  0.338744  0.824904  0.433525 0.0554301  0.102989
 0.135655    0.1369  0.138592  0.185219  0.671222  0.503072
 0.724707 0.0229626 0.0956952   0.69172   0.88753  0.602157
  0.20677  0.481021  0.906718  0.740903 0.0122884  0.627619
 0.833898  0.489128 0.0569035  0.890661  0.654715  0.369796
0.0352394   0.31373  0.209669  0.645301  0.315698  0.728158
 0.837917  0.854889  0.448077  0.261297  0.827286  0.342382
 0.618343  0.271867   0.51941  0.237344   0.88356   0.44756
 0.310798  0.919258   0.89035  0.494202  0.547433 0.0110521
   0.6318  0.856076  0.969984  0.200378  0.744663  0.399086
 0.192825  0.564519  0.159782  0.492985  0.614004  0.860859
0.0196752         0         0         0         0         0
  _6]\{:"1 a
 0.847631   0.946235  0.694527  0.738811 0.0971692 0.152071
 0.679391   0.112777  0.728898  0.253617  0.154239 0.974696
 0.482069   0.466348   0.04714  0.869879  0.181372 0.423818
 0.272937   0.903995  0.157414  0.500219  0.338167 0.677583
  0.94459   0.250007  0.336625 0.0169775  0.796695 0.654411
 0.170526   0.895435  0.356342  0.729993  0.458651 0.985116
 0.735815   0.769903  0.330332  0.893481  0.170579 0.779591
0.0809311  0.0113751 0.0251464  0.252098  0.814933 0.715675
  0.96469   0.466113 0.0411245 0.0912059  0.876649 0.418362
0.0499488   0.146906  0.299066  0.220726 0.0277604 0.133132
0.0481802 0.00644751  0.479049  0.742696  0.388223 0.021414
 0.722758   0.900545  0.404907  0.514502  0.879775 0.946914
0.0627949   0.587971  0.768972  0.538484  0.117544 0.564618
 0.595333    0.80489  0.698897   0.62371   0.82849 0.552645
 0.709086   0.833338   0.94291  0.826878  0.160421 0.613533
0.0196752          0         0         0         0        0






On Wed, May 22, 2013 at 1:57 AM, Christopher Rosin <[email protected]>wrote:

> The J interpreter was seg faulting when testing a program on random inputs.
> Narrowing down the problem, this phrase demonstrates the issue:
>    ((i."0 1) %)~ (?. 100 100 $ 0)
>
> This causes the J interpreter to crash with a segmentation fault.
> This happens with 64-bit j602a and j701a running on Ubuntu Linux (both
> 12.10 and 13.04),
> and 64-bit j701a for Mac (running under MacOS 10.6).
>
> The crash happens if the phrase above is the first thing typed into
> jconsole on these platforms.
>
> Under Linux (though not MacOS), this variant also seg faults under those
> conditions:
>    ((i."0 1) %)~ (?. 30 30 $ 0)
>
> But, strangely, if the following is instead the first thing typed in to
> jconsole:
>    ((i."0 1) %)~ (?. 20 20 $ 0)
> that doesn't seg fault, and then after that the 30 30 input can be
> completed successfully without seg faulting:
>    ((i."0 1) %)~ (?. 30 30 $ 0)
>
>
> -Chris
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>



-- 
(B=) <-----my sig
Brian Schott
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to