# GiwsException::JniCallMethodException on FreeBSD

**URL:** <https://scilab.discourse.group/t/giwsexception-jnicallmethodexception-on-freebsd/1001>\
**Category:** Development\
**Created:** [July 8, 2025, 8:29pm UTC](https://scilab.discourse.group/t/giwsexception-jnicallmethodexception-on-freebsd/1001 "2025-07-08T20:29:56Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thierry](https://yyz2.discourse-cdn.com/free1/user_avatar/scilab.discourse.group/thierry/32/892_2.png) [@Thierry](https://scilab.discourse.group/u/Thierry)\
**Post date:** [July 8, 2025, 8:29pm UTC](https://scilab.discourse.group/t/giwsexception-jnicallmethodexception-on-freebsd/1001/1 "2025-07-08T20:29:56Z")

</div>

Hello,  
I managed to compile Scilab on FreeBSD, and scilab-cli works OK, but scilab-adv-cli aborts with the following error:

```auto
Terminating due to uncaught exception 0x3e8ea72db700 of type GiwsException::JniCallMethodException
A fatal error has been detected by Scilab.
Please check your user-defined functions (or external module ones) should they appear in the stack trace.

```

The output of getdebuginfo is:

```auto
Scilab branch-2025.1 (Jul 3 2025, 22:32:47)

--> [a, b] = getdebuginfo() 
 
 a = [5x1 string]

  "Total free memory: 21528576"                        
  "Total memory: 33374208"                             
  "SCI: /usr/local/share/scilab/"                      
  "SCIHOME: /home/thierry/.Scilab/scilab-branch-2025.1"
  "TMPDIR: /tmp/SCI_TMP_75663_USFRHR"                  

 b = [6x1 string]

  "Scilab Version: scilab-branch-2025.1"                                                                             
  "Compilation date: Jul 3 2025"                                                                                    
  "Compilation time: 22:32:47"                                                                                       
  "Compileur version: FreeBSD Clang 19.1.7 (https://github.com/llvm/llvm-project.git llvmorg-19.1.7-0-gcd708029e0b2)"
  "XML version: 2.11.9"                                                                                              
  "Compiler Architecture: X64"

```

But there is no StackTrace: how could I enable it?

---

<div class="post-metadata">

**Author:** ![mottelet](https://yyz2.discourse-cdn.com/free1/user_avatar/scilab.discourse.group/mottelet/32/13_2.png) [@mottelet](https://scilab.discourse.group/u/mottelet)\
**Post date:** [July 9, 2025, 6:46am UTC](https://scilab.discourse.group/t/giwsexception-jnicallmethodexception-on-freebsd/1001/2 "2025-07-09T06:46:06Z")

</div>

Hello,

Can you give the output you get when you run the configure script ?

S.

---

<div class="post-metadata">

**Author:** ![Thierry](https://yyz2.discourse-cdn.com/free1/user_avatar/scilab.discourse.group/thierry/32/892_2.png) [@Thierry](https://scilab.discourse.group/u/Thierry)\
**Post date:** [July 9, 2025, 7:21am UTC](https://scilab.discourse.group/t/giwsexception-jnicallmethodexception-on-freebsd/1001/3 "2025-07-09T07:21:21Z")

</div>

“Sorry, new users can not upload attachments.”  
I uploaded it to [https://people.freebsd.org/~thierry/config.log](https://people.freebsd.org/~thierry/config.log) .  
Thanks for taking care.

---

<div class="post-metadata">

**Author:** ![mottelet](https://yyz2.discourse-cdn.com/free1/user_avatar/scilab.discourse.group/mottelet/32/13_2.png) [@mottelet](https://scilab.discourse.group/u/mottelet)\
**Post date:** [July 9, 2025, 7:36am UTC](https://scilab.discourse.group/t/giwsexception-jnicallmethodexception-on-freebsd/1001/4 "2025-07-09T07:36:45Z")

</div>

OK thanks, I just wanted to check that you were using Java17.  
Another point: we stick to clang-16 for the macOS build (I saw that you are using clang-19). Anyway can you launch scilab-adv-cli in `lldb`, in order to see where the exception occurs ?

S.

---

<div class="post-metadata">

**Author:** ![Thierry](https://yyz2.discourse-cdn.com/free1/user_avatar/scilab.discourse.group/thierry/32/892_2.png) [@Thierry](https://scilab.discourse.group/u/Thierry)\
**Post date:** [July 9, 2025, 4:00pm UTC](https://scilab.discourse.group/t/giwsexception-jnicallmethodexception-on-freebsd/1001/5 "2025-07-09T16:00:30Z")

</div>

It runs until ./modules/jvm/src/c/JVM\_commons.c:52, at the line  
` return (ptr_JNI_CreateJavaVM)(jvm, penv, args);`  
and then it enters into libjvm.so, for which I have no debug code!

The error occurs just after a return code:

```auto
    frame #0: 0x00000ae49a5a7e75 ld-elf.so.1`_rtld_bind_start at rtld_start.S:158
   155 popfq # Restore rflags
   156 .cfi_adjust_cfa_offset -8
   157 leaq 16(%rsp),%rsp # Discard spare, obj, do not change rflags
-> 158 ret # "Return" to target address
   159 .cfi_endproc
   160 .size _rtld_bind_start, . - _rtld_bind_start
   161

```

```auto
Process 4996 stopped
* thread #1, name = 'scilab-bin', stop reason = signal SIGSEGV: address not mapped to object (fault address: 0x0)
    frame #0: 0x000000088bd4762d
-> 0x88bd4762d: movl (%rsi), %eax
    0x88bd4762f: leaq 0x30(%rbp), %rsi
    0x88bd47633: movl $0x10000, %eax ; imm = 0x10000 
    0x88bd47638: andl 0x4(%rsi), %eax

```

I have no experience with JNI, and no clue about these messages!  
I could rebuild OpenJDK with debug symbols, but I prefer to avoid it…  
Have you already encountered such an error on other platforms?

---

<div class="post-metadata">

**Author:** ![Thierry](https://yyz2.discourse-cdn.com/free1/user_avatar/scilab.discourse.group/thierry/32/892_2.png) [@Thierry](https://scilab.discourse.group/u/Thierry)\
**Post date:** [July 12, 2025, 2:47pm UTC](https://scilab.discourse.group/t/giwsexception-jnicallmethodexception-on-freebsd/1001/6 "2025-07-12T14:47:48Z")

</div>

Ad read in [Scilab works on my system - linux mint 21.2, but it gives a GLException, can I fix this? - #2 by mottelet](https://scilab.discourse.group/t/scilab-works-on-my-system-linux-mint-21-2-but-it-gives-a-glexception-can-i-fix-this/301/2) I tried

```auto
export _JAVA_OPTIONS='-Djogl.disable.opengles'

```

and then

```auto
export LIBGL_ALWAYS_SOFTWARE=true scilab

```

Without success: same error `Terminating due to uncaught exception 0x362a1cac0700 of type GiwsException::JniCallMethodException`

---

<div class="post-metadata">

**Author:** ![Thierry](https://yyz2.discourse-cdn.com/free1/user_avatar/scilab.discourse.group/thierry/32/892_2.png) [@Thierry](https://scilab.discourse.group/u/Thierry)\
**Post date:** [July 14, 2025, 4:57pm UTC](https://scilab.discourse.group/t/giwsexception-jnicallmethodexception-on-freebsd/1001/7 "2025-07-14T16:57:53Z")

</div>

Out of curiosity, I imported giws and tested the option `--enable-build-giws`: same error.

Remark: giws taken from [GitHub - opencollab/giws: A wrapper generator to generate C++ mapping Java classes](https://github.com/opencollab/giws) at version 3.0.0, which identifies itself as 2.0.2, but Scilab’s configure wants 1.3.0.
