I tested this is not related to 15!:0 or shared library. Loading the simple
script below with cause segfault.
@Henry, can you take a look?
a1.ijs
NB. ================
lib=. 'foo'
3 : 0''
c=. 'c'
ccdm=: 1 : ('(''"',c,'" '',u)&]')
ncdm=: ccdm
''
)
'' ncdm
NB. ================
On Fri, Jul 22, 2022 at 12:16 PM John Ference <[email protected]>
wrote:
> If all the preceding code is run, a repeatable segfault occurs on the line:
>
> >> gethostbyaddrJ=: 'gethostbyaddr * * i i' ncdm
>
>
> There are two oddities associated with this behavior:
>
> 1) If the liblapack loads are omitted, the segfault does not occur.
>
> 2) If the ncdm references are omitted OR defined directly rather than by
> reference to ccdm, the segfault does not occur.
>
> > On Jul 21, 2022, at 3:29 PM, bill lam <[email protected]> wrote:
> >
> > At which line did it crash ?
> >
> >> On Fri, Jul 22, 2022, 2:08 AM John Ference <[email protected]>
> wrote:
> >>
> >> load jpath '~temp/dllcrash.ijs'
> >>
> >> Segmentation fault: 11
> >>
> >> logout
> >>
> >> Saving session...
> >>
> >> ...copying shared history...
> >>
> >> ...saving history...truncating history files...
> >>
> >> ...completed.
> >>
> >>
> >> JVERSION
> >>
> >> Engine: j904/j64avx/darwin
> >>
> >> Beta-e: commercial/2022-07-16T19:27:13
> >>
> >> Library: 9.04.03
> >>
> >> Platform: Darwin 64
> >>
> >> Installer: J904 install
> >>
> >> InstallPath: /applications/j904
> >>
> >>
> >> =========================================================
> >> dllcrash.ijs
> >>
> >> =========================================================
> >> 3 : 0''
> >> if. 0=4!:0<'liblapack' do. '' return. end.
> >> if. UNAME-:'Linux' do.
> >> liblapack=: 'liblapack.so.3'
> >> elseif. UNAME-:'Darwin' do.
> >> liblapack=:
> >>
> >>
> '/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/vecLib'
> >> if. -.fexist liblapack do.
> >> liblapack=: '/System/Library/Frameworks/vecLib.framework/vecLib'
> >> end.
> >> elseif. do.
> >> liblapack=: DistPath,'/bin/liblapack3.dll'
> >> end.
> >> )
> >>
> >> lib=. dquote liblapack
> >> dpotrf=: (lib, ' dpotrf_ ',(IFWIN#'+'),' n *c *i *d *i *i ') & cd
> >> dpptrf=: (lib, ' dpptrf_ ',(IFWIN#'+'),' n *c *i *d *i ') & cd
> >> dsytrf=: (lib, ' dsytrf_ ',(IFWIN#'+'),' n *c *i *d *i *i *d *i *i ') &
> cd
> >> dpotrs=: (lib, ' dpotrs_ ',(IFWIN#'+'),' n *c *i *i *d *i *d *i *i ') &
> cd
> >> dpptrs=: (lib, ' dpptrs_ ',(IFWIN#'+'),' n *c *i *i *d *d *i *i ') & cd
> >> dsycon=: (lib, ' dsycon_ ',(IFWIN#'+'),' n *c *i *d *i *i *d *d *d *i
> *i ')
> >> & cd
> >> dpotri=: (lib, ' dpotri_ ',(IFWIN#'+'),' n *c *i *d *i *i ') & cd
> >> dpptri=: (lib, ' dpptri_ ',(IFWIN#'+'),' n *c *i *d *i ') & cd
> >> dgesvd=: (lib, ' dgesvd_ ',(IFWIN#'+'),' n *c *c *i *i *d *i *d *d *i
> *d *i
> >> *d *i *i ') & cd
> >> sgeev=: (lib, ' sgeev_ ',(IFWIN#'+'),' n *c *c *i *f *i *f *f *f *i *f
> *i
> >> *f *i *i ') & cd
> >> dgeev=: (lib, ' dgeev_ ',(IFWIN#'+'),' n *c *c *i *d *i *d *d *d *i *d
> *i
> >> *d *i *i ') & cd
> >> zgeev=: (lib, ' zgeev_ ',(IFWIN#'+'),' n *c *c *i *j *i *j *j *i *j *i
> *j
> >> *i *d *i ') & cd
> >>
> >> 3 : 0''
> >> select. UNAME
> >> case. 'Win' do.
> >> c=. >IFWINCE{'wsock32';'winsock'
> >> ccdm=: 1 : ('(''"',c,,'" '',u)&(15!:0)')
> >> ncdm=: ccdm
> >> scdm=: ccdm
> >> wcdm=: ccdm
> >> LIB=: ''
> >> closesocketJ=: 'closesocket i i' scdm
> >> ioctlsocketJ=: 'ioctlsocket i i i *i' scdm
> >> case. do.
> >> c=. unxlib 'c'
> >> ccdm=: 1 : ('(''"',c,'" '',u)&(15!:0)')
> >> ncdm=: ccdm
> >> scdm=: ccdm
> >> wcdm=: 1 : ']'
> >> LIB=: c
> >> closesocketJ=: 'close i i' scdm
> >> ioctlsocketJ=: 'ioctl i i x *i' scdm
> >> end.
> >> empty''
> >> )
> >>
> >> gethostbyaddrJ=: 'gethostbyaddr * * i i' ncdm
> >> gethostbynameJ=: 'gethostbyname * *c' ncdm
> >> gethostnameJ=: 'gethostname i *c i' ncdm
> >> inet_addrJ=: 'inet_addr i *c' ncdm
> >> inet_ntoaJ=: 'inet_ntoa i i' ncdmh
> >> ----------------------------------------------------------------------
> >> For information about J forums see http://www.jsoftware.com/forums.htm
> >>
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm