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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:44:25+00:00 2026-06-12T17:44:25+00:00

I am using swig 2.0.7 on Hp-ux to wrap our C++ libraries. There are

  • 0

I am using swig 2.0.7 on Hp-ux to wrap our C++ libraries. There are no errors until attempting to run when a crash occurs.

Using:

HP-UX bob B.11.23 U ia64 0835920252 unlimited-user license
aCC: HP C/aC++ B3910B A.06.20 [May 13 2008]
java version "1.7.0.01"
Java(TM) SE Runtime Environment (build 1.7.0.01-jinteg_2012_05_10_04_39-b00)
Java HotSpot(TM) Server VM (build 22.1-b02-jre1.7.0.01-rc2, mixed mode)

the swig command is

swig -c++ -package com.mybuild -java -I../Library -I../../Common mybuild.i 

the swig interface file

/* File : mybuild.i */
%module mybuild

%include "std_string.i"

%{
#include "mybuild.h"
%}

%include "mybuild.h"

On building, I see one warning

warning #2177-D: function
      "SWIG_JavaThrowException" was declared but never referenced
 static void SWIGUNUSED SWIG_JavaThrowException(JNIEnv *jenv, SWIG_JavaExceptionCodes code, const char *msg) {

Trouble occurs when I run, a crash occurs and I get

(0) 0xc0000000054f4f60  _ZN6Thread18trace_native_stackEv + 0x140 [/opt/java7/jre/lib/IA64W/server/libjvm.so]
(1) 0xc0000000055b10c0  _ZN7VMError14report_and_dieEv + 0x6c0 [/opt/java7/jre/lib/IA64W/server/libjvm.so]
(2) 0xc0000000050d85b0  _Z30_handle_uncaught_cxx_exceptionv + 0x50 [/opt/java7/jre/lib/IA64W/server/libjvm.so]
(3) 0xc0000000017390f0  _ZSt9terminatev + 0x50 [/usr/lib/hpux64/libCsup.so.1]
(4) 0xc000000001740090  __cxa_throw + 0x1b0 [/usr/lib/hpux64/libCsup.so.1]
(5) 0xc0000000015e3220  _ZNSs9_C_unlinkEv + 0x220 [/usr/lib/hpux64/libstd_v2.so.1]
(6) 0xc0000000015f08f0  _ZNSt5ctypeIcE12_C_initfacetERKSt6locale + 0x800 [/usr/lib/hpux64/libstd_v2.so.1]
(7) 0xc0000000015f3990  _ZNKSt6locale16_C_install_facetEPN4__rw15__rw_facet_baseERKNS_2idE + 0x1d0 [/usr/lib/hpux64/libstd_v2.so.1]
(8) 0xc0000000015f2ae0  _ZNKSt6locale13_C_make_facetERKNS_2idEbiPFPN4__rw15__rw_facet_baseEiPKcmE + 0x440 [/usr/lib/hpux64/libstd_v2.so.1]
(9) 0xc0000000016d5b60  _ZNSt8ios_base4InitC3Ev + 0x1c80 [/usr/lib/hpux64/libstd_v2.so.1]
(10) 0xc000000005e72f00  __sinit_optionset_cpp_ + 0x70 [/usr/testing/mybuild.so]
(11) 0xc00000000004e1a0  EM_mark_BOS + 0x50 [/usr/lib/hpux64/dld.so]
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (0xe0000000), pid=7231, tid=1
#  Error: An uncaught C++ exception
#
# JRE version: 7.0
# Java VM: Java HotSpot(TM) 64-Bit Server VM (22.1-b02-jre1.7.0.01-rc2 mixed mode hp-ux-ia64 )
# Core dump written. Default location: /usr/testing/core or core.7231 (max size 2097151 kB). To ensure a full core dump, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /usr/testing/hs_err_pid7231.log
#
#  Please report this error to HP customer support.

Using gdb, I received a little more info:

   from /usr/lib/hpux64/libCsup.so.1
#16 0xc000000001740090:0 in __cxa_throw+0x1b0 ()
   from /usr/lib/hpux64/libCsup.so.1
#17 0xc0000000015e3220:0 in std::string::_C_unlink()+0x220 ()
   from /usr/lib/hpux64/libstd_v2.so.1
#18 0xc0000000015f08f0:0 in std::ctype<char>::_C_initfacet(std::locale const&)
   +0x800 () from /usr/lib/hpux64/libstd_v2.so.1
#19 0xc0000000015f3990:0 in std::locale::_C_install_facet(__rw::__rw_facet_base*,std::locale::id const&) const+0x1d0 () from /usr/lib/hpux64/libstd_v2.so.1
#20 0xc0000000015f2ae0:0 in std::locale::_C_make_facet(std::locale::id const&,bool,int,__rw::__rw_facet_base* (*)(int,char const*,unsigned long)) const
---Type <return> to continue, or q <return> to quit---
   +0x440 () from /usr/lib/hpux64/libstd_v2.so.1
#21 0xc0000000016d5b60:0 in std::ios_base::Init::Init()+0x1e40 ()
   from /usr/lib/hpux64/libstd_v2.so.1
#22 0xc000000005e72f00:0 in __sinit_optionset_cpp_ ()
    at /opt/aCC/include_std/iostream:48
#23 0xc00000000004e1a0:0 in EM_mark_BOS+0x50 () from /usr/lib/hpux64/dld.so

My theory is that I need to tweak Swig to stop this crash. Assistance would be appreciated.

Edit Code added
Sorry about that, took me a while to zero in on what may be causing problem. I found that this will cause a crash

#include <iostream>
#include <string>
using namespace std;

static const string rangeFieldString("RangeField");

int main()
{

         cout << "I sure hope this works" << endl;
        return 0;
}

but this will not

#include <iostream>
#include <string>
using namespace std;

static const char* rangeFieldString("RangeField");

int main()
{

         cout << "I sure hope this works" << endl;
        return 0;
}
  • 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-12T17:44:26+00:00Added an answer on June 12, 2026 at 5:44 pm

    I found the solution to this. When building on the system, by adding -mt to CFLAGS and LDFLAGS, the problem was solved

    CFLAGS=-Aa +e +DAportable +z +DD64 -mt
    LDFLAGS=-Aa +e +DAportable -b +z +DD64 -mt
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using SWIG to wrap C++ objects for use in lua, and Im trying
Using SWIG to generate a Python interface to a C++ application, is there any
I am attempting to create python bindings for some C++ code using swig. I
I'm using SWIG to wrap my C++ code into Python. But the conversion of
I am trying to wrap a C++ class using SWIG to create a Java
Our C++ lib works fine with Python2.4 using Swig, returning a C++ char* back
I'm wrapping a C++ library in PHP using SWIG and there have been some
When using Swig to wrap C++ code, it is possible to add methods to
I am using SWIG to wrap my C++ source code, but my code has
I'm using swig to wrap around this C++ project and after having imported all

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.