Compiling own app with -X02 makes external dll core dump.

Hello,
I have a C++ app that calls a function w/in an external shared library. The external dll does not have debug symbols and is probably optimized. When my app is compiled with -xO2 or higher, I get a core dump (no mapping at the fault address) deep within the external dll. When I am compiling my app with -xO1 or with debug info, I do not get the core dump within the external dll.
My questions are:
1. Does this mean that there is a bug w/in my code or within the external dll's code?
2. If not error in either, is there any way to overcome this core dump without lowering the level of optimization (and thus slowing down the app)
Here is a stack trace I got by attaching dbx to my app:
t@1 (l@1) signal SEGV (no mapping at the fault address) in num2qword at 0xfd320248
[1] num2qword(0x345cfd8, 0xffffff85, 0x63ad0, 0xfd323ba0, 0xa800, 0xa8d8), at 0xfd320248
[2] evalexpr(0xffbf7f58, 0x345cee8, 0x1, 0x0, 0xfd27e558, 0xfd3230d0), at 0xfd323ba0
[3] eval_expr_full(0x328e388, 0x345d04c, 0x345cfd8, 0xfd27e558, 0x1, 0x0), at 0xfd3249e8
[4] cm_eval_expr(0x328e388, 0x345d04c, 0x5800, 0x5944, 0xb400, 0xb400), at 0xfd1eea68
[5] cm_optredeem_can_redeem(0x328e388, 0x345d1e0, 0x16ddec, 0x5c00, 0x0, 0x345d1e4), at 0xfd21620c
[6] cm_optredeem_condition(0x328e388, 0x345d1e0, 0x0, 0x0, 0x0, 0x135eb29), at 0xfd2162d8
[7] cm_maybe_execute_optredeem(0x328e388, 0x345d1e0, 0x0, 0x0, 0x0, 0x1), at 0xfd216568
[8] cm_pay_1_period(0x328e388, 0xfd3ba364, 0x345d1e0, 0x345d52c, 0xfd383c98, 0x0), at 0xfd21ab5c
[9] cm_payloop(0x328e388, 0x1, 0x0, 0x324df00, 0x0, 0x3), at 0xfd21ae08
[10] icmo_cashflows(0x0, 0x0, 0x168, 0x328b7b0, 0x0, 0x328b7b0), at 0xfd2d1700
[11] CMOInstrument::getICMOCashFlow(0x1627b28, 0xfd48bdb8, 0x570, 0x2b1c, 0x2800, 0x400), at 0xfd442410
[12] NE_CMOAnalytics::value(0x39b71e0, 0x98, 0xfd48bdb8, 0xe, 0xffbfc268, 0x2e93b08), at 0xfd42d560
[13] NumericExpression::value(0x1643800, 0x1667b48, 0x1667b48, 0x2eabde0, 0x2eabde0, 0x0), at 0xc13410
[14] NE_CMOPriceTimesBalance::value(0x2b02078, 0x2ead230, 0x1667b48, 0x2eabea0, 0x2eac06c, 0xfd48ec8c), at 0xfd42da9c
[15] NumericExpression::value(0x1643800, 0x1667b48, 0x1667b48, 0x2eabea0, 0x2eabea0, 0x0), at 0xc13410
[16] ExchangeableModuleBase::evaluateExpression(0x31259c4, 0x15e4400, 0x0, 0x2eabea0, 0x1667b48, 0x2e93b08), at 0x746e54
[17] ExchangeableModuleBase::evaluateExpressions(0x31259c4, 0x2f3d7c8, 0x746ca0, 0x1, 0x164c800, 0x15c8414), at 0x746c68
[18] ExchangeableModuleBase::recalc(0x31259c4, 0x0, 0xffffffc8, 0x164c800, 0x0, 0x746c40), at 0x746c10
[19] ExchangeableModule::recalc(0x31258d4, 0x15e5730, 0x15c81ac, 0x164c800, 0x7fe8c0, 0x0), at 0x4a8ff4
[20] BatchInstrument::commandDispatch(0x15fd850, 0x1ac, 0x1, 0x619b2c, 0xc, 0x2ebbbc0), at 0x619ce0
[21] Callback(0x2eee48c, 0x3, 0x5, 0x1, 0xffbfccf0, 0xffbfcd6c), at 0xe652f0
[22] CallExtRtn(0xffbfe1d0, 0x2, 0x1, 0xffffdffe, 0x1, 0xfcd0fc86), at 0xe727d4
[23] PcodeExecute(0x2eee8ac, 0xef5c18, 0x1, 0x15b9750, 0xef5c18, 0x4), at 0xeab848
[24] ExpStartThread(0x2eee48c, 0x0, 0x0, 0x1, 0x1, 0x0), at 0xe6e1e0
[25] BasicScriptCodeObject::executeThread(0x2ebb070, 0x2eee48c, 0x0, 0x2ebb074, 0x2eeed68, 0x0), at 0xa0fcb0
[26] BasicScriptCodeObject::run(0x2ebb070, 0x0, 0x0, 0x0, 0x0, 0x2ebb070), at 0xa0fe24
[27] BasicScriptManager::loadAndExecInitScriptFile(0x2d7eb08, 0x1, 0xa, 0x0, 0x1, 0x2eef5f0), at 0x587f80
[28] main(0x32db9b8, 0xffff3400, 0x308b998, 0x0, 0x1c1fd20, 0x1c0db58), at 0x438c6c
[10] icmo_cashflows(...) is the call to the external dll. From 9 and up to 1 the source code is not visible to me..
OS/CC Versions:
CC: Sun C++ 5.5 Patch 113817-05 2004/01/13
SunOS: 5.9 Generic_117171-05 sun4u sparc SUNW,Sun-Fire-880
compilation options:
-dalign -xarch=v8plusa -xlibmopt -D__solaris_sparc__ -errtags=yes -errwarn=wnoretvalue,wnoelseretvalue +w2 -erroff=doubunder,reftotemp,notemsource,hidef,hidevf,wbadlinkage_w,noexthrow,noextry,notused -DLIC_MGR -DUSE_SMART_HEAP -DUSE_SH_ALLOC -template=wholeclass -instances=explicit -features=no%except -features=rtti -Drindex=rindex -Dindex=index   -DADD_DYNAMIC_SYMBOLS     -KPIC   -DNDEBUG   -mt   -xO1 ( -xO2 .. -xO5 or -fast give above noted core dump)
Thanks in advanice,
Alex

From the symptoms you describe, it is possible that the shared library contains a bug, but it is more likely that the problem is in your code, passing bad data to the shared library.
The problem might be a compiler bug, but I think an error in your code is more likely.
For example, your code as written might have undefined behavior that works by accident when compiling without optimizing, but fails when the compiler improves the runtime code.
Some examples:
1. A classic MT programming error is failing to declare a variable volatile when it is shared by more than one thread. In each thread, the compiler assumes it can remember the value of the variable and not reload it between references.
2. "x = ++x + b;" Modifying a variable twice in an expression withtout sequence points has undefined behavior -- compiler optimization can affect the result.
3." foo(x, x+=3);" the order of evaluation of function arguments is unspecified, so the actual values passed to foo could depend on optimization.
With C++ 5.5, you get some warnings from system headers that you can't do anything about, which I suspect is why you have disabled some warnings. Unfortunately, you might be disabling warnings that you need to see. That is, some of the disabled warnings could point to invalid code that results in the program crash.
I suggest using w instead of w2 (to avoid uninteresting warnings), and fix your code to eliminate the warnings you get.
In the current compiler, C++ 5.7 in Sun Studio 10, we have made some adjustments to warnings to make w and w2 more useful. You should consider upgrading.You can get a 60-day free trial version here:
http://www.sun.com/software/products/studio/index.xml
Also get the current patches for it here:
http://developers.sun.com/prodtech/cc/downloads/patches/index.html

Similar Messages

  • Make sense of Core Dumped

    When a C/Pro*C program makes a core file after core dumped, what is the significance of this file. How can I make sense of the reason the core dump occurred. That is, understand the error because of which the core dump occurred.
    Regards
    Krishnan

    type "adb core" and adb will give you some output
    indicating which program died and with which kind
    of error (e.g. Segmentation violation, illegal instruction
    etc.) .
    Leave adb by Ctrl-D and restart with adb <programname>
    Now, Type "$c" at the adb prompt in order to get a
    stack trace, or other commands displaying addresses,
    register contents etc.
    HTH
    regards, E. Sanio

  • RMAN backup finish with ORA-07445: exception encountered: core dump

    Hi Group,
    Repeatly we have problems with RMAN, showing this message, we need to know if this message is related to Oracle Database or is the backup software.
    Thanks a lot
    /pcpdci/oracle/product/920/admin/PCPDCI_bd/udump/pcpdci_ora_31187.trc
    Oracle9i Enterprise Edition Release 9.2.0.8.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.8.0 - Production
    ORACLE_HOME = /pcpdci/oracle/product/920
    System name:    Linux
    Node name:      bd.copesa.cl
    Release:        2.6.9-78.ELhugemem
    Version:        #1 SMP Wed Jul 9 15:57:33 EDT 2008
    Machine:        i686
    Instance name: PCPDCI
    Redo thread mounted by this instance: 1
    Oracle process number: 948
    Unix process pid: 31187, image: [email protected] (TNS V1-V3)
    *** 2011-04-11 00:58:44.241
    *** SESSION ID:(1519.515) 2011-04-11 00:58:44.240
    SKGFQ OSD: Error in function sbtwrite2 on line 1031
    SKGFQ OSD: Look for SBT Trace messages in file /pcpdci/oracle/product/920/admin/PCPDCI_bd/udump/sbtio.log
    Exception signal: 11 (SIGSEGV), code: 1 (Address not mapped to object), addr: 0x126, PC: [0xf6abe90b, __GI_strlen()+11]
    Registers:
    %eax: 0x00000126 %ebx: 0xf6b7dff4 %ecx: 0x00000002
    %edx: 0x00000000 %edi: 0x00000000 %esi: 0x00000126
    %esp: 0xfeff6154 %ebp: 0xfeff6794 %eip: 0xf6abe90b
    %efl: 0x00010202
      __GI_strlen()+0 (0xf6abe900) mov 0x4(%esp),%ecx
      __GI_strlen()+4 (0xf6abe904) mov %ecx,%eax
      __GI_strlen()+6 (0xf6abe906) and $3,%ecx
      __GI_strlen()+9 (0xf6abe909) je 0xf6abe933
    __GI_strlen()+11 (0xf6abe90b) cmpb %ch,(%eax)  __GI_strlen()+13 (0xf6abe90d) jz 0xf6abe9aa
      __GI_strlen()+19 (0xf6abe913) inc %eax
      __GI_strlen()+20 (0xf6abe914) xor $3,%ecx
      __GI_strlen()+23 (0xf6abe917) je 0xf6abe933
    *** 2011-04-11 00:58:44.570
    ksedmp: internal or fatal error
    ORA-07445: exception encountered: core dump [__GI_strlen()+11] [SIGSEGV] [Address not mapped to object] [0x126] [] []
    ----- Call Stack Trace -----
    calling              call     entry                argument values in hex
    location             type     point                (? means dubious value)
    ksedmp()+274         call     ksedst()             1 ? 0 ? 0 ? 1 ? 33396562 ?
    ===========================================================
    Tracing started for:
       Application Client :   TDPO Linux86
                  Version :   5.4.1.0
    ===========================================================
    SBT-13207 07/12/2010 16:32:29 send2.cpp(412): sbtwrite2(): Exit - DSMSENDDATA() failed. dsmHandle = 1
    ===========================================================
    Tracing started for:
       Application Client :   TDPO Linux86
                  Version :   5.4.1.0
    ===========================================================
    SBT-14436 07/12/2010 16:52:58 send2.cpp(412): sbtwrite2(): Exit - DSMSENDDATA() failed. dsmHandle = 1
    ===========================================================
    Tracing started for:
       Application Client :   TDPO Linux86
                  Version :   5.4.1.0
    ===========================================================
    SBT-15110 07/12/2010 17:01:58 send2.cpp(412): sbtwrite2(): Exit - DSMSENDDATA() failed. dsmHandle = 1
    ===========================================================
    Tracing started for:
       Application Client :   TDPO Linux86
                  Version :   5.4.1.0

    Reply from nagulan is correct. Our turned out to be an error with TSM. The disk pool had filled up and it was writing this to tape before allowing the backup to continue. The backup didn't handle the "pause" event well and failed out. We only get this with V9 RMAN, not V10 or V11 RMAN backups. This has to be addressed by the backup vendor for V9 as the Oracle RMAN software doesn't seem to handle it well. Maybe configuring a really large timeout for responses MAY fix this, depending on what the code returned from the backup software vendor is and why RMAN isn't happy with it.
    In the end it is an issue between V9 RMAN and the backup software we run TSM. Maybe version incompatibility or maybe just V9 is not that robust.

  • Compiling my app with the free SDK

    I need to provide my code, as a Flex Project, to someone without Flex Builder.  They would then need to make simple edits to CSS as well as swap some images, then compile the swf.
    How is this process done with the free Flex 3.3 SDK?
    Thanks.

    If you're on Windows you can compile a Flex project using MXMLC via the Command Prompt.
    1. Change to your bin directory of the SDK:
    cd C:/builds/flex3/bin/
    2. Run MXMLC on your main application file:
    mxmlc "C:/flex/mainApplication.mxml"
    If you have any additional compiler arguments you will want to add them there as well.
    Is this what you are looking for?

  • Compiling Flex Apps With ANT Problem

    Hi guys,
    I thought i'd have a go at using ANT to compile my applications into a single war file that I could then use to deploy. So far so good, until I got to the last bit. Within the root of my application i have the actionscript source file and underneath that I have an assets folder where all my images and css files live. E.g. app_root/asrc/assets/stylesheets/default.css. Now the ant task i've used to succesfully compile everything else looks like this;
         <target name="mxcompile">
            <mxmlc
                file="${asrc}/Main.mxml"
                output="${dest}/Main.swf"
                actionscript-file-encoding="UTF-8"
                keep-generated-actionscript="true"
                incremental="true"
                context-root="SOSBetaAdmin"
                services="WEB-INF/flex/services-config.xml"
                allow-source-path-overlap="true">
                <load-config filename="${FLEX_HOME}/frameworks/flex-config.xml"/>
                <source-path path-element="${FLEX_HOME}/frameworks"/>
                <source-path path-element="${asrc}/assets/stylesheets"/>
                <!-- List of SWC files or directories that contain SWC files. -->
                <compiler.library-path dir="${FLEX_HOME}/frameworks" append="true">
                    <include name="libs" />
                    <include name="../bundles/{locale}" />
                </compiler.library-path>
                <!-- include dependencies -->
                <compiler.library-path dir="." append="true">
                    <include name="libs" />           
                </compiler.library-path>
            </mxmlc>
        </target>
    However when i run it i get the following error;
    Error: Problem finding external stylesheet: assets/stylesheets/default.css
    Its there, its definately there and whats more Flex builder doesn't have a problem with it. So why does running the compiler as an ANT task cause this issue? Am I missing something?

    I think your problem is that you are missing another source-path tag.  Assuming your assets directory is immediately beneath directory asrc, you'll want to add the following line to your build.xml file:
    <source-path path-element="${asrc}"/>
    Hope that helps.
    Joe

  • OutOfMemoryError when compiling my app with Ant

    I'm having a hard time compiling my application using Flex 3 Ant tasks. When I compile it in Flex Builder, using the default compiler, everything works fine. But when I try to build it from the command line, I always get the following error:
    [mxmlc] Error: Java heap space
    [mxmlc] java.lang.OutOfMemoryError: Java heap space
    I have already tried setting the following in FlexBuilder.ini and ANT_OPTS
    -Xms768m-Xmx1024m-XX:MaxPermSize=256m-XX:PermSize=64m
    Still giving the same error. Please let me know your suggestions.
    -Thanks in Advance.

    The FlexBuilder.ini has nothing to do with running a command line Ant build. Try specifying the jvmargs inside the <mxmlc> task. Example"
    <mxmlc ...>
    <jvmarg line="-Xmx512m"/>
    </mxmlc>
    Jason San Jose
    Software Engineer, Flash Builder

  • Compiling SWT app with gnu/gcj

    has anybody actually compiled a java swt app to machine code using gnu/gcj?.. if so can you please tell me how to?.. i�ve tryed everything thats posted on internet but it still wont work.. thanks

    You would have better luck on a gcj forum/mailling list.

  • Compiling a form with Dblink makes Builder close unexpectedly

    I got Windows XP, Patch 18 installed and anytime I try to compile a form that uses a DBLINK, as soon as I try compiling the form, my form builder closes to desktop (no error, message, nor anything).
    I tried FORMS COMPILER --> Compile ALL and nothing =(
    If I put in Comment the dblink instruction the thing works as it should.
    Any Idea?
    gracias

    Patch 18 sounds like Forms 6i.
    Patch 18 is only certified against E-Business-Suite. Are you working in that environment? Else I think you must go to Patch 17, the last version for nomal development.

  • Invoking external dll into FDK API Client

    Hi,
    do you know if it is possible to invoke an external dll into an FDK 8.0 API Client?
    In my client code I invoke an external dll function,  my client compiles, but when I start FM I receive the error message "Cannot initialize API Client....Check for errors in the APIClient section of...".
    If I comment in my client code the line in wich I invoke the external dll and than recompile, FM and my client work perfectly...
    Thanks,
    Stefano

    Hi Russ,
    with "invoke an external dll" I mean that I have to wite a log file to register my fdk client events and to do this I have to use an external dll wich exposes some functions to write to a common log file. I have imported the external dll in my client project and at the beginning of client code I have included the dll header file:
    #include "LogDll.h"
    Then I've tried to invoke a LogDll function (not within F_ApiInitialize (), but in a custom dialog box event):
    int retval=LogDllFunction();
    The code compiles, but if I start FM, I receive the message error. If I comment the line above, FM and my client start normally.
    Thanks,
    Stefano

  • Wrapper for invoking external DLL-function

    I want to run a Host-Command (e.g. rwrun60 report=xyz.rdf batch=yes) invoked by a trigger that fires when a new record is inserted.
    I wrote a DLL which has an exported function that accepts a commandline (with parameters) and invokes the command via ShellExecute.
    The problem is, that when i invoke the PL/SQL-wrapper, the DLL-function is properly run, but the program i want to run is only visible in the taskmanager(NT) and does nothing.
    So what i need is a correct wrapper for the function:
    DLL-function: OExecSysCmd(cmdLine *char)
    Wrapper:
    PROCEDURE OExecSysCmd(p_SysCmd in char)
    IS EXTERNAL
    NAME "OExecSysCmd"
    LIBRARY demolib;
    Thanks in advance
    Dannys

    Hi Russ,
    with "invoke an external dll" I mean that I have to wite a log file to register my fdk client events and to do this I have to use an external dll wich exposes some functions to write to a common log file. I have imported the external dll in my client project and at the beginning of client code I have included the dll header file:
    #include "LogDll.h"
    Then I've tried to invoke a LogDll function (not within F_ApiInitialize (), but in a custom dialog box event):
    int retval=LogDllFunction();
    The code compiles, but if I start FM, I receive the message error. If I comment the line above, FM and my client start normally.
    Thanks,
    Stefano

  • Hello, I'm from Belgium and I just bought the iPad 2. I watched a lot of movies and I saw that it's possible to make your own movie with the iPad, but which app do you need to make movies. Greetings, Lars

    Hello, I'm from Belgium and I just bought the iPad 2. I watched a lot of movies and I saw that it's possible to make your own movie with the iPad, but which app do you need to make movies. Greetings, Lars

    Hier kun je er meer over lezen; http://www.wikihow.com/Use-the-Cameras-on-Your-iPad-2
    En hier kun je meer informatie vinden over de iPad;  www.iPadforum.tk

  • Can I make phone apps with Dreamweaver 5.5?

    I recently came across a tutorial explaining how to make phone apps using Dreamweaver and Phonegap. Later I read that changes in Phonegap required DW CS6. I'm wondering if it's still possible to use my version, CS 5.5 or is an upgrade absolutely necessary?
    If not, is there another way to leverage the software I already own CS5.5 to make phone apps?

    Actually, you make phone apps with jQuery Mobile in DW.   Once completed, PhoneGap is used to compile your app for iOS, Android, Blackberry, etc...
    You don't need to upgrade unless you want to.  See link below.
    http://help.adobe.com/en_US/dreamweaver/cs/using/WSeffff8bffc80208478c8d43312e240fe0ad-800 0.html
    Nancy O.

  • My Apple id was disabled and had to make a new one for iTunes but it's not letting me erase then re download the app with the new Apple ID

    My Apple id was disabled and had to make a new one for iTunes but it's not letting me erase then re download the app with the new Apple ID   Just got an iPad air 2 so my iCloud and family sharing is with the one that's disabled. Which I don't know how to switch to my new one, so I trying to erase my apps that won't load and just re download them with my new ID that is being used with the iTunes n app store but I can't even find most in purchased plus it's saying that I can't get it cuz that ID is not with family sharing but I donT know why it would not be. Please someone help.

    OOk so I have my new Apple id in my iTunes account but my old Apple ID is the one that is in the iCloud account which is the Apple ID have been using for years and the reason I cannot get it on this abled is because somebody was using my credit card or debit card that was on file for family sharing and it was a stolen iPhone from my account so they had to disable my Apple ID and I could not use my debit card anymore on any Apple ID ever again they said because of it so I can't get it not to be disabled and I can't sign into iTunes with it I already have signed out and signed in with my new Apple ID for iTunes it's just iCloud is not letting me load anything so pretty much what I've been doing is I have to erase every app and then re-dumb going to iTunes and re-download the apps again but the only issue is that I still have a disabled Apple ID as my iCloud settings and my iCloud family sharing in all of that so I'm wondering how or is it possible to change my Apple ID for iCloud specifically because when I go into Icloud and settings and go into my name where my Apple ID is the one that's disabled it doesn't say anything about log out or sign out or anything like that it just says to put the password for it so is there a way to change the Apple ID for my iCloud so that my iTunes in my iCloud is the same Apple ID?

  • How can I make an app with xcode that works like a news app? So that I can post articles on the app. Do I have to use a database or can I connect the app directly with my mac?

    How can I make an iphone app with xcode that worrks like a newspaper? So that I can post articles on the app while it is on appstore. Can I directly connect the app with my mac or do I have to connect it to a database?  Thanks

    Funny, I was thinking you'd want to use the prescribed deployment that Apple went to all the trouble to provide so you wouldn't trot down the garden path with some other implementation, only to find your app rejected with the admonition to use Newsstand after all...
    If you're all hot to ignore all that & DIY, why are you even asking...why not just go for it...

  • I dont have a computer so set up iPad on cousins MacPc. His iTunes also with his password, can I download my own apps without his itunes pswd or do I need to have my own iTunes account? Dont really know what to do, can someone please help me??

    I set up my iPad 2 on my cousins MacPc, I dont have a computer or iTunes. Can I download my own apps and songs now or do i need to do eveything from his iTunes? Do I need my own iTunes account to get apps? Help I dont really know what or how to do it.

    Install iTunes on your Acer and you can back up the iPhone. Or back it up to iCloud. If you do not back it up you can get it unlocked, but you will lose all of your content.
    You can get iTunes from http://www.apple.com/itunes.
    Even after unlocking I'm not sure it will work on Straight Talk, because last time I checked ST used Verizon as its carrier, and an AT&T iPhone 4 is not compatible with Verizon's network. You can probably use it on Net 10 or T-Mobile once it is unlocked.

Maybe you are looking for

  • Can't install Palm Desktop 4.14, 4.2 or 6.2

    Help! I can not install any version of Palm Desktop.  I had a working version of 6.2, but with Palm support, tried to uninstall and reinstall 4.2 (for compatibility reasons).  After several weeks everyone has given up.  I run Windows XP Pro, SP3, am

  • Macbook White keyboard issue (potential software problem, please help!)

    Hi there! Before I go into detail I have a Late 2008 Macbook White (Upgraded to 4GB RAM, 320GB HDD) so I would have had it two years this Christmas (2010) Over the last few months, on odd occasions the bottom row of keys completely stop working (by b

  • Video file in camera but not in computer

    using a lumix lx7 p&s camera.  took several videos.  they playback ok in the camera.  however, when i insert the memory card into my mac the files are not there. all of the filenames for the jpegs are consecutive like p1010661, 62, 63.  the missiing

  • Human task 10.1.3.1.0 - Assigning Participants By expression

    I want to assign multiple assignees by using dynamic user xpath option. By name, if I specify comma separated users, it works fine. But in my case, the user information is not static and I need to derive from the payload I receive. Can some one give

  • General Tab in Control

    Dear Experts, Can anyone please tell the purpose of fields " Testing Technique" & "Operation Frequency" in general tab of Control. Thanks! With regards, Shyam