Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9244933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T09:09:03+00:00 2026-06-18T09:09:03+00:00

I am using Java JNI to integrate Z3 Solver C-Api in the framework that

  • 0

I am using Java JNI to integrate Z3 Solver C-Api in the framework that we are using.
Now, I am getting a segmentation fault with the following message –

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x664c4af0, pid=10878, tid=3060636480
#
# JRE version: 7.0_09-b30
# Java VM: OpenJDK Server VM (23.2-b09 mixed mode linux-x86 )
# Problematic frame:
# C  [libSpdfZ3.so+0x634af0]  small_object_allocator::allocate(unsigned int)+0x40
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /home/rajtendulkar/workspace/Java-WorkSpace/spdf-compiler_with_Yices_and_Z3_StaticLib/hs_err_pid10878.log
#
# If you would like to submit a bug report, please include
# instructions on how to reproduce the bug and visit:
#   https://bugs.launchpad.net/ubuntu/+source/openjdk-7/
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

Inside the log file, it points to one call where context of Z3 is allocated. Basically it is an initialization routine with some memory allocation.

I want to try to understand what is the cause of this segmentation fault.
I would like to mention that my program works normally when run once. However if I run it in a for loop like this –

for (int i=0;i<5;i++)
{
     // create z3 context
     Z3Object obj = new Z3Object();
     ...
     ... 
     .. do some exploration here ..
     ...  
     ...
     ...     
}

I am just thinking if this has to do anything with memory allocation or insufficient memory or something like this?

Any pointers on how to debug this are appreciated.

EDIT :

When I sometimes try to debug the code and step through it slowly, I do not get this problem. Similarly, if I put a 5-second delay at the end of the for loop, I do not get any seg. fault. So can it be related with any concurrency issues?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T09:09:04+00:00Added an answer on June 18, 2026 at 9:09 am

    It seems you are developing custom JNI bindings for Z3. Note that Z3 will come with it’s own bindings in one of the next releases. This is already included in the `unstable’ branch at Codeplex and may serve as inspiration or even as a replacement.

    Note that objects obtained from the z3.dll must be reference-counted correctly, which can be quite tricky depending on the kind of garbage collector that is used. My first suspicion would be that an object gets collected (by Z3) without your program being aware of it (e.g., because reference counts get out of sync), or that your garbage collector is trying to destroy objects in an order that Z3 doesn’t anticipate (e.g., destroying contexts before all associated objects are destroyed).

    The concurrency issues are perhaps not due to your own program, but because the garbage collector is concurrent (if I remember correctly, the later versions of Java actually come with 4 different ones and chose between them depending on the host system, which could be the source of the issue).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a C program that stores some object in java store using JNI.
I have got a project that is using jni to connect java wrapper and
I'm using ant to build a mixture of Java and C++ (JNI) code that
Is there a way to list methods in a Java class using the JNI
I'm using JNI to interface between a Java program and a C++ function. The
I am using JNI to call my C++ function from Java. One of the
I have a Java application which interacts with native code using JNI. The native
I'm currently implementing a .NET wrapper for a Java library by using JNI to
I'm trying to create a Qt main windows from Java using JNI directly and
Would it be possible to implement a custom Thread class in Java (using JNI)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.