Thanks for your suggestion. The problem was entirely my bad code.

Calls in the zip addon worked fine. My problem was due to a pointer size 
mismatch. Changing the function calls to (analogous to the zip addon)

gzopen=: 'gzopen > x *c *c' xcdm
gzread=: 'gzread > i x * i' xcdm

with corresponding changes to the J functions made it work on all 
platforms, both 32 and 64-bit.

Norman




On 5/10/2010 7:58 PM, Eric Iverson wrote:
> I haven't studied your report carefully. Can you reproduce the crash with a
> simple cd call? If it is in the cd call, there shouldn't be any involvement
> of libjnative.so so it is hard to see that as the cause. But in that case it
> is strange that it works in jconsole 64bit and fails in jwdp 64bit. Can you
> call other dlls from linux jwdp 64bit?
>
> On Mon, May 10, 2010 at 8:07 PM, Norman Drinkwater
> <[email protected]>wrote:
>
>> 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
>>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to