I'm having a problem calling a dll under J602 for 64-bit linux. When
calling libz in a program running under Jwdp, the program exits with the
following error message on the terminal:
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007fdca77d4a70, pid=2506, tid=140585725273872
#
# JRE version: 6.0_20-b02
# Java VM: Java HotSpot(TM) 64-Bit Server VM (16.3-b01 mixed mode
linux-amd64 )
# Problematic frame:
# C [libz.so.1+0x3a70] gzread+0x50
The code (shown below) works fine on OSX, 32-bit and 64-bit Windows
(either jwd or jwdp), and 32-bit linux. It also works fine when run from
the console in 64-bit linux, so I'm guessing the problem lies in
libjnative.so. Has anyone been able to call shared libraries from a jwdp
application under 64-bit linux? Any suggestions on how to make this work?
Thanks.
Norman Drinkwater
---Code (partial listing)----
gzread=: 'gzread > i * * i' xcdm
zread=: 3 : 0
NB. reads compressed (or uncompressed) file y
NB. returns file contents (x=0) or x bytes from file
NB. mapping is read-only
0 zread y
:
fn=. y
if. -.fexist fn do.
empty''
return.
end.
JCHAR map_jmf_ 'infil';fn;'';1
magic=. 2{.infil__
if. (<magic)=<31 139{a. do.
outsz=. {. uint4 _4{.infil__
else. NB. file is not compressed
if. 0<x do. outdat=. x{.,infil__ else. outdat=. ,infil__ end.
unmap_jmf_'infil'
outdat
return.
end.
unmap_jmf_'infil'
pout=. mema outsz
res=. gzopen fn;'rb'
gzfaddr=. {. res
if. 0<x do. len=. x else. len=. outsz end.
gzread (<gzfaddr);(<pout);len
outdat=. memr pout,0,len
gzclose <<gzfaddr
memf pout
outdat
)
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm