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 8846117
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T11:53:59+00:00 2026-06-14T11:53:59+00:00

Following code is pretty boiler plate code that runs fine as is, but when

  • 0

Following code is pretty boiler plate code that runs fine as is, but when run in gdb crashes. As such I won’t care about that, but this is reduced version of my bigger program which also crashes with or without gdb. Any help on what I’m doing wrong here would be tremendously appreciated.

It crashes in in the very last call to JVM “jobject hbase_configuration = env->CallStaticObjectMethod(cls, create_mid);”

I have tried calling HBaseConfiguration.Create many times through JNI through different things, and in all cases it crashes. The stack trace on gdb does not seem very helpful, I Can’t get any symbols out of it, despite having compiled with -g.

#include <string>
#include <glog/logging.h>
#include <jni.h>
// (edit - this was hidden in the original post).

int main(int argc, char* argv[]) {
  JavaVM *jvm;
  JNIEnv *env;
  JavaVMInitArgs vm_args;
  JavaVMOption options[5];

  vm_args.nOptions = 5;
  vm_args.version = JNI_VERSION_1_6;
  vm_args.options = options;
  vm_args.ignoreUnrecognized = 1;


  JNI_GetDefaultJavaVMInitArgs(&vm_args);

  options[0].optionString = "-Djava.class.path=hbase-1.0-SNAPSHOT.jar:activation-1.1.jar:asm-3.1.jar:avro-1.7.1.cloudera.2.jar:commons-beanutils-1.7.0.jar:commons-beanutils-core-1.8.0.jar:commons-cli-1.2.jar:commons-codec-1.4.jar:commons-collections-3.2.1.jar:commons-configuration-1.6.jar:commons-daemon-1.0.3.jar:commons-digester-1.8.jar:commons-el-1.0.jar:commons-httpclient-3.1.jar:commons-io-2.1.jar:commons-lang-2.5.jar:commons-logging-1.1.1.jar:commons-math-2.1.jar:commons-net-3.1.jar:ftplet-api-1.0.0.jar:ftpserver-core-1.0.0.jar:ftpserver-deprecated-1.0.0-M2.jar:guava-11.0.2.jar:hadoop-annotations-2.0.0-cdh4.1.1.jar:hadoop-auth-2.0.0-cdh4.1.1.jar:hadoop-common-2.0.2-alpha.jar:hadoop-common-2.0.2-alpha-tests.jar:hadoop-hdfs-2.0.0-cdh4.1.1.jar:hadoop-test-2.0.0-mr1-cdh4.1.1.jar:hbase-0.92.1-cdh4.1.0.jar:hbase-0.92.1-cdh4.1.0-sources.jar:hbase-0.92.1-cdh4.1.0-tests.jar:high-scale-lib-1.1.1.jar:hsqldb-1.8.0.10.jar:jaxb-api-2.1.jar:jaxb-impl-2.2.3-1.jar:jersey-core-1.8.jar:jersey-json-1.8.jar:jersey-server-1.8.jar:jets3t-0.6.1.jar:jline-0.9.94.jar:jsch-0.1.42.jar:jsp-api-2.1.jar:jsr305-1.3.9.jar:junit-4.10.jar:kfs-0.3.jar:log4j-1.2.17.jar:metrics-core-2.1.2.jar:paranamer-2.3.jar:protobuf-java-2.4.1.jar:servlet-api-2.5.jar:tools.jar";
  options[1].optionString = "-verbose:jni";
  options[2].optionString = "-Xcheck:jni:pedantic,verbose";
  options[3].optionString = "-Xdebug";
  options[4].optionString = "-Xrunjdwp:transport=dt_socket,address=4242,server=y,suspend=n";
  vm_args.nOptions = 5;
  vm_args.version = JNI_VERSION_1_6;
  vm_args.options = options;
  vm_args.ignoreUnrecognized = 1;


  // Load and initialize a Java VM, return a JNI interface 
  // pointer in env.
  long result = JNI_CreateJavaVM(&jvm, (void **)&env, &vm_args);
  if (result == JNI_ERR) {
    LOG(ERROR) << "Failed to create a JVM";
    return false;
  }

   jclass cls = env->FindClass("org/apache/hadoop/hbase/HBaseConfiguration");
  if (cls == NULL) {
    LOG(ERROR) << " Could not find class org/apache/hadoop/hbase/HBaseConfiguration";
    return false;
  }

  jmethodID create_mid = env->GetStaticMethodID(
      cls, "create", "()Lorg/apache/hadoop/conf/Configuration;");
  if (create_mid == NULL) {
    LOG(ERROR) << "Could not find static method create in HBaseConfiguration";
    return false;
  }

  LOG(INFO) << "Creating conf";
  jobject hbase_configuration = env->CallStaticObjectMethod(cls, create_mid);

  LOG(INFO) << "Created conf";
  return 0;
}

Stack trace looks like:

#0  0x00007ffff134a722 in ?? ()
#1  0x00007ffff12e8410 in ?? ()
#2  0x0000000700000000 in ?? ()
#3  0x00007fffffffd150 in ?? ()
#4  0x00007fffffffd108 in ?? ()
#5  0x000000000060e800 in ?? ()
#6  0x000000077fbcaa30 in ?? ()
#7  0x000000000000001b in ?? ()
#8  0x0000000000000000 in ?? ()
  • 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-14T11:54:00+00:00Added an answer on June 14, 2026 at 11:54 am

    This was indeed what technomage had suggested in the comments. The gdb crash was a red herring because of jvm throwing SIGSEGV which was meant to be handled by jvm.

    Once I tell gdb “handle SIGSEGV nostop”, it works just fine and I was able to debug my larger program.

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

Sidebar

Related Questions

I have the following code that runs a stored procedure repeatedly. It works pretty
I have the following code in C# and .net 3.5 that is working fine
I have the following code in my view, but it's pretty hard to read.
I'm pretty new to MVC, but I have the following code: <td> @Html.DisplayFor(modelItem =>
I'm trying to run the following code, but I'm getting a Type mismatch compile
The following code produces pretty much what I want, but the scrollable pane on
I run the following code and I get back a pretty involved object back.
This is pretty farfetched, but is the following code safe (i.e. guaranteed not to
I have the following code that should, when run, update a table of victims
Following code is a pretty simple and complete JQuery Dialog. Everything works. Problem is

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.