So...

(1) I noticed that the version of problem.ijs I emailed was not the
version I had intended to send. The differences are inconsequential,
but I'm attaching the version which I had intended to send.

(2) Sprinkling p.c with lines which audittstack(jt), I can catch the
error on the line of this script immediately before the one which
previously I was catching it on. The offending line in p.c (jtparsea)
is:

       y=(*actionfn)(jti,QCWORD(arg1),QCWORD(arg2),jt->parserstackframe.sf);
  // set bit 0, and bit 1 if dyadic, if inplacing allowed by the verb

So... that's progress, though that's still rather ambiguous. Still, I
know it came from this line:

(-"+/ .* eqf -/ .*) m=: _100+?7 7$200x

And, running under a debugger, actionfn here is jtatomic2

Meanwhile, arg1 is:
{kchain = {k = 56, chain = 0x38, globalst = 0x38, locpath = 0x38},
flag = 0, mback = {
    m = 93824992547648, back = 0x5555555a1340, jobpyx =
0x5555555a1340, zaploc = 0x5555555a1340,
    aarg = 0x5555555a1340}, tproxy = {t = 4, proxychain = 0x4}, c = 1,
n = 1, r = 0 '\000',
  filler = 0 '\000', h = 445, origin = 0, lock = 0, s = {-100}}

That is not an A with type XNUM - that looks like a broken X, with t=4
instead of t=2.

Also, for what it's worth, arg2 is:
{kchain = {k = 72, chain = 0x48, globalst = 0x48, locpath = 0x48},
flag = 64, mback = {
    m = 93824992547688, back = 0x5555555a1368, jobpyx =
0x5555555a1368, zaploc = 0x5555555a1368,
    aarg = 0x5555555a1368}, tproxy = {t = 64, proxychain = 0x40}, c =
-9223372036854775807, n = 49,
  r = 2 '\002', filler = 0 '\000', h = 664, origin = 0, lock = 0, s = {7}}

Anyways, I'm looking for a little hint here.

Specifically, in jtparasea, where would I find the id of the verb
being handled by jtatomic2?

(Also, I'm back to wondering if something that jtparse depends on
might somehow be making a decision based on the ISGMP() macro, when
ISGMP() should really have been named ISGMPMEMORY() - it provides no
information about the J type of an array. But I haven't been able to
find any problem of that nature, and I've been looking for exactly
that problem. I'm not asking anyone to address this issue, it's just a
reflection of where I've been focussed.)

Anyways, any high level guidance on where the memorable bits are
stored in jtparsea would be great.

Thanks,

-- 
Raul

On Wed, Nov 22, 2023 at 11:11 AM Raul Miller <[email protected]> wrote:
>
> It's probably also worth noting that the version of mpir at
> https://github.com/wbhart/mpir has mpn_com
>
> --
> Raul
>
> On Wed, Nov 22, 2023 at 10:42 AM Raul Miller <[email protected]> wrote:
> >
> > Ugh...
> >
> > Very old versions of libgmp did not have mpn_com.
> >
> > And, on windows, we have been using the mpir fork of libgmp, which I
> > have very little insight into. I don't remember the technical reasons
> > about why we're using that fork there, but I'm now wondering if it
> > might be easier to create our own j specific fork of libgmp which
> > returns null for memory allocation issues...
> >
> > --
> > Raul
> >
> > On Wed, Nov 22, 2023 at 10:18 AM Henry Rich <[email protected]> wrote:
> > >
> > > When I load your script I get
> > >
> > > error loading mpn_com
> > >
> > > hhr
> > >
> > > On 11/21/2023 8:12 PM, Raul Miller wrote:
> > > > I forgot that the mail server filters out .ijs files.
> > > >
> > > > Hopefully, the attachment will come through this time, with the
> > > > extension changed to .txt
> > > >
> > > > (Also, I have seen some odd behavior in my testing, and I have some
> > > > concern that this issue might have a hardware-dependent character. So
> > > > it would be good to find out if there's machines which do not segfault
> > > > with this script with mem audit enabled on the gmp-redo0 branch.)
> > > >
> > > > Thanks,
> > > >
> > > >
> > > > ----------------------------------------------------------------------
> > > > For information about J forums see http://www.jsoftware.com/forums.htm
> > >
> > > ----------------------------------------------------------------------
> > > For information about J forums see http://www.jsoftware.com/forums.htm
eq=: 4 : 'x=y'
x=:?3 8 32$2
f=: 3 : '(=/ -: eq/) ?y$2'
,f"1 x=:7 8 9,."0 1 [ _1 0 1+  255
test =: +/ .* -: +/@(*"1 _)
f=: 4 : 0 NB. test float variants
 p =. 1 + ? 32
 xx=: (x,p) ?@$ 0
 yy=: (p,y) ?@$ 0
 assert. xx test yy
 1
)
(200000 + i. 1) f"0 ] 10 + i. 1  NB. BLAS - the test is slow
(-/ .* -:!.5e_11 */@((<0 1)&|:)) m=:(<:/~i.6) * 6 6 ?@$ 0
(-/ .* -:!.5e_11 */@((<0 1)&|:)) m=:(<:/~i.7) * 7 7 ?@$ 0
eqf=: 4 : 0
 (x -:!.t y) +. (t>|x) *. t>|y [ t=. 2^_34
)
(-"+/ .* eqf -/ .*) m=: _100+?7 7$200
(-"+/ .* eqf -/ .*) m=: _100+?7 7$200x
(-"+/ .* eqf -/ .*) m=: %/1+?2 4 4$200x  NB. <-- segfault here


(-"+/ .* eqf -/ .*) m=: %/1+?2 5 5$200x
(-"+/ .* eqf -/ .*) m=: %/1+?2 6 6$200x
_= (-/ .*) x: 4 4$_ __ 0 0 1 1 0 0 0 0 1 0 0 0 0 1         NB. test for crash
1= (+/ .*) ::1: x: 4 4$_ __ 0 0 1 1 0 0 0 0 1 0 0 0 0 1    NB. test for crash
exit''

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to