Exporting symbols in a .exe for external DLLs

Hello, 
I am facing a strange problem.
Basically, I have my application that loads a DLL (I developped).
My DLL exports functions I can call from my application : OK
I would also like to call functions of my application from my DLL : it does not work.
To do that, in my DLL, I call :
HMODULE hModule = GetModuleHandle("application.exe");
FARPROC hFunc = GetProcAddress(hModule, "appFunction"); // (defined by : void __declspec(dllexport)  appFunction(void) in my application
hModule is non-zero but hFunc is NULL. When I use a tool to see exported symbols by application.exe, there is none.
So my question is : Can I export symbols from a .exe with LabWindows 8.5 ?
thanks in advance
Solved!
Go to Solution.

Thank you for your answer,
I had already tried with :
HMODULE hModule = LoadLibrary("application.exe");  
and
HMODULE hModule = LoadLibraryEx("application.exe", NULL, 0);  
it gives the same result.
To be more precise here is the source code of dll.dll :
#include <Windows.h>
#include <stdio.h>
typedef void(*APPLI_PRINTF7)(void);
__declspec(dllexport) void dllFunction(void)
HMODULE hModule = LoadLibrary("application.exe");
FARPROC pFunc = GetProcAddress(hModule, "appli_printf7");
if(pFunc)
((APPLI_PRINTF7)pFunc)();
else
printf("error = %d\n", GetLastError());
return;
 and here is the code of application.exe
#include <Windows.h>
#include <stdio.h>
typedef void(*DLL_FUNC)(void);
__declspec(dllexport) void appli_printf7(void)
printf("7");
return;
int main(void)
HMODULE hModule = LoadLibrary("dll.dll");
FARPROC pFunc = GetProcAddress(hModule, "dllFunction");
((DLL_FUNC)pFunc)();
return 0;
I compiled dll.dll once and for all with LabWindows (8.5), and I compiled exactly the same code for application.exe with LabWindows (8.5) and Visual Studio 2013.
It works with Visual Studio (the dll finds appli_printf7 and 7 is printed on the screen), but doesnt with LabWindows (the dll does not find appli_printf7 and prompt the error 127 (The specified procedure could not be found.)).
I used Dependency Walker (and dllexp to confirm) to find out that appli_printf7 is actually NOT exported with LabWindows, and is exported with Visual Studio.
Therefore, it is normal that the dll can't find the symbol if it is not exported.
My questions are :
- Why is that so ???
- Is there a setting to set in order to make LabWindows export symbols marked by __declspec(dllexport) for .exe projects ?
- Is this a problem fixed with a newer version of LabWindows ?
- My dll is actually a plugin to my application. If I can't load symbols from my application, how can I provide an API for my dll in order to make generic functions available to it ? Is there a workaround for it ?
Edit : I tried with LabWindows 2012, same problem..
Thanks in advance 

Similar Messages

  • Vi reference = function pointer for external DLL?

    So I'm porting this simple program from C to LabVIEW. All it does is getting some signals from an haptics hardware (Sensable Phantom Omni). It should be simple, but it has shown several complications. (been stuck for 2 weeks )
    I successfully imported the hardware's DLL with all of its functions (using LV 8.2, because 8.5 and 8.6 's wizard sucks).
    But there is a function whose argument is a function pointer:
    hUpdateHandle = hdScheduleAsynchronous(updateDeviceCallback, 0, HD_MAX_SCHEDULER_PRIORITY);
     I already have the corresponding VI for updateDeviceCallback (which gets a (void *) that does not really use, and returns an int).
    hdScheduleAsynchronous is part of the hardware's API (I can't mess with it, nor I know what's inside), and as first argument expects a function pointer.
    Can I use the Open VI reference node to get the 'pointer' for my VI and then feed it as an argument for the external DLL? How do I properly cast the VI ref datatype into a function pointer?
    Solved!
    Go to Solution.
    Attachments:
    QueryDevice.c ‏9 KB
    updateDeviceCallback.vi ‏14 KB

    JavierRuiz wrote:
    So I'm porting this simple program from C to LabVIEW. All it does is getting some signals from an haptics hardware (Sensable Phantom Omni). It should be simple, but it has shown several complications. (been stuck for 2 weeks )
    I successfully imported the hardware's DLL with all of its functions (using LV 8.2, because 8.5 and 8.6 's wizard sucks).
    But there is a function whose argument is a function pointer:
    hUpdateHandle = hdScheduleAsynchronous(updateDeviceCallback, 0, HD_MAX_SCHEDULER_PRIORITY);
     I already have the corresponding VI for updateDeviceCallback (which gets a (void *) that does not really use, and returns an int).
    hdScheduleAsynchronous is part of the hardware's API (I can't mess with it, nor I know what's inside), and as first argument expects a function pointer.
    Can I use the Open VI reference node to get the 'pointer' for my VI and then feed it as an argument for the external DLL? How do I properly cast the VI ref datatype into a function pointer?
    LabVIEW has no concept that can translate seemlessly to function pointers and there is certainly no sensible way to make the Call Library Node support something like this.
    There are possibilities to create a DLL from your callback VI and import the function using Windows API calls to pass it as a function pointer to your other function. But this is involved and quite dirty and most importantenly a total nightmare to maintain, since things go completely awry if your DLL is created in a different LabVIEW version than the LabVIEW version you call it with. This may seem like a piece of cake now but whoever will have to upgrade your software to a new LabVIEW version later will love you to the point that they will feel like sending you as the original programmer a nice little present that blows in your face when opened 
    The only feasable way is to write a wrapper DLL in C that translates between something more LabVIEW friendly like a user event and the actual callback function mechanisme.
    Rolf Kalbermatter
    Message Edited by rolfk on 06-09-2009 10:24 AM
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • 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

  • Where can I find a overview of symbols for extern textfields?

    Where can I find a overview of symbols for extern textfields?
    For exmaple " = %22 etc.
    Many thanks!

    Thanks kglad! That's the woord I was looking for. I get a
    problem with ë = %eb He still gives a square symbol :S . Are
    you familiar with the problem?

  • Symbols for wmp.dll on Windows 8.1?

    Hi, I'm trying to load the debugging symbols for wmp.dll on Windows 8.1, but the symchk output shows that they don't exist on the Microsoft symbol server (see below). I've also installed the Windows 8.1 x86 32-bit retail symbols from
    here, but that doesn't contain the wmp.dll symbols either. Is this an oversight from Microsoft's side, or am I doing something wrong or looking in the wrong places?
    Thanks!
    C:\Program Files\Windows Kits\8.1\Debuggers\x86>symchk c:\Windows\System32\wmp.d
    ll -v
    [SYMCHK] Searching for symbols to c:\Windows\System32\wmp.dll in path SRV*C:\WIN
    DOWS\SYMBOLS*http://msdl.microsoft.com/download/symbols
    DBGHELP: Symbol Search Path: SRV*C:\WINDOWS\SYMBOLS*http://msdl.microsoft.com/do
    wnload/symbols
    [SYMCHK] Using search path "SRV*C:\WINDOWS\SYMBOLS*http://msdl.microsoft.com/dow
    nload/symbols"
    DBGHELP: No header for c:\Windows\System32\wmp.dll.  Searching for image on disk
    DBGHELP: c:\Windows\System32\wmp.dll - OK
    SYMSRV:  File: wmp.pdb
    SYMSRV:  Notifies the client application that a proxy has been detected.
    SYMSRV:  Connecting to the Server: http://msdl.microsoft.com/download/symbols.
    SYMSRV:  Successfully connected to the Server.
    SYMSRV:  Sending the information request to the server.
    SYMSRV:  Successfully sent the information request to the server.
    SYMSRV:  Waiting for the server to respond to a request.
    SYMSRV:  Successfully received a response from the server.
    SYMSRV:  Closing the connection to the Server.
    SYMSRV:  Successfully closed the connection to the Server.
    SYMSRV:  Get File Path: /download/symbols/wmp.pdb/F3B83C13024549F7A128285E604D07
    082/wmp.pdb
    SYMSRV:  Notifies the client application that a proxy has been detected.
    SYMSRV:  Connecting to the Server: http://msdl.microsoft.com/download/symbols.
    SYMSRV:  Successfully connected to the Server.
    SYMSRV:  Sending the information request to the server.
    SYMSRV:  Successfully sent the information request to the server.
    SYMSRV:  Waiting for the server to respond to a request.
    SYMSRV:  Successfully received a response from the server.
    SYMSRV:  Closing the connection to the Server.
    SYMSRV:  Successfully closed the connection to the Server.
    SYMSRV:  Notifies the client application that a proxy has been detected.
    SYMSRV:  Connecting to the Server: http://msdl.microsoft.com/download/symbols.
    SYMSRV:  Successfully connected to the Server.
    SYMSRV:  Sending the information request to the server.
    SYMSRV:  Successfully sent the information request to the server.
    SYMSRV:  Waiting for the server to respond to a request.
    SYMSRV:  Successfully received a response from the server.
    SYMSRV:  Closing the connection to the Server.
    SYMSRV:  Successfully closed the connection to the Server.
    SYMSRV:  Get File Path: /download/symbols/wmp.pdb/F3B83C13024549F7A128285E604D07
    082/file.ptr
    SYMSRV:  Notifies the client application that a proxy has been detected.
    SYMSRV:  Connecting to the Server: http://msdl.microsoft.com/download/symbols.
    SYMSRV:  Successfully connected to the Server.
    SYMSRV:  Sending the information request to the server.
    SYMSRV:  Successfully sent the information request to the server.
    SYMSRV:  Waiting for the server to respond to a request.
    SYMSRV:  Successfully received a response from the server.
    SYMSRV:  Closing the connection to the Server.
    SYMSRV:  Successfully closed the connection to the Server.
    SYMSRV:  C:\WINDOWS\SYMBOLS\wmp.pdb\F3B83C13024549F7A128285E604D07082\wmp.pdb no
    t found
    SYMSRV:  http://msdl.microsoft.com/download/symbols/wmp.pdb/F3B83C13024549F7A128
    285E604D07082/wmp.pdb not found
    DBGHELP: wmp - no symbols loaded
    [SYMCHK] MODULE64 Info ----------------------
    [SYMCHK] Struct size: 1680 bytes
    [SYMCHK] Base: 0x10000000
    [SYMCHK] Image size: 13377536 bytes
    [SYMCHK] Date: 0x5450386d
    [SYMCHK] Checksum: 0x00cc1977
    [SYMCHK] NumSyms: 0
    [SYMCHK] SymType: SymNone
    [SYMCHK] ModName: wmp
    [SYMCHK] ImageName: c:\Windows\System32\wmp.dll
    [SYMCHK] LoadedImage: c:\Windows\System32\wmp.dll
    [SYMCHK] PDB: ""
    [SYMCHK] CV: RSDS
    [SYMCHK] CV DWORD: 0x53445352
    [SYMCHK] CV Data:  wmp.pdb
    [SYMCHK] PDB Sig:  0
    [SYMCHK] PDB7 Sig: {F3B83C13-0245-49F7-A128-285E604D0708}
    [SYMCHK] Age: 2
    [SYMCHK] PDB Matched:  TRUE
    [SYMCHK] DBG Matched:  TRUE
    [SYMCHK] Line nubmers: FALSE
    [SYMCHK] Global syms:  FALSE
    [SYMCHK] Type Info:    FALSE
    [SYMCHK] ------------------------------------
    SymbolCheckVersion  0x00000002
    Result              0x00010001
    DbgFilename         wmp.dbg
    DbgTimeDateStamp    0x00000000
    DbgSizeOfImage      0x00000000
    DbgChecksum         0x00000000
    PdbFilename         wmp.pdb
    PdbSignature        {F3B83C13-0245-49F7-A128-285E604D0708}
    PdbDbiAge           0x00000002
    [SYMCHK] [ 0x00000000 - 0x00010001 ] Checked "c:\Windows\System32\wmp.dll"
    SYMCHK: wmp.dll              FAILED  - wmp.pdb mismatched or not found
    SYMCHK: FAILED files = 1
    SYMCHK: PASSED + IGNORED files = 0
    Tim De Baets
    http://www.bm-productions.tk

    Yes, it looks like the matching pdb for your version of wmp.dll is missing on the MS-symbol-server. Could be a glitch on their side.
    Symbols in 'Windows symbol packages' include sometimes 'outdated' symbol files, (PDB-Signatures of pdb and module differ).
    If symbols for certain modules are missing altogether in these packages, MS may not have the intention to publish them for reason of intellectual property. (Personal opinion).
    In any case, to my knowledge, the team in charge of public-symbols - at least for system modules (hmm, wmp is media player ...) - can be contacted via  
    windbgfb [at] microsoft [dot] com
    see
    https://social.msdn.microsoft.com/Forums/lync/en-US/f5408a35-f097-4006-9c95-bf1802d03ead/no-symbols-for-ntdlldll-on-microsofts-symbol-server-kb2882822?forum=windbg
    With kind regards
    Edit: wording
    Just see, for Vista symbols for wmp.dll are available through public-symbol-server, though
    call themselves wmp_notestroot.pdb

  • Debug Symbols for OraOLEDB10.dll - 10.2g

    Where can I obtain the debug symbols (*.PDB) for OraOLEDB10.dll, OraOLEDBrst10.dll, etc.? I'm trying to analyze a memory dump and need the PDBs to analyze the stack correctly.
    Thanks
    Mike

    AFAIK they have never shipped symbols. One good idea is to bulletproof your code with basic things like failure checks after every JNI call, input parameter validation, and running with the "-Xcheck:jni" option. It seems like a lot of people don't do those things, judging by a lot of the code samples posted in this forum. But that sort of defensive programming should really stop 99% of any JVM crashes.
    -slj-

  • LV data types for C++ DLL

    I have created a DLL in VC++ that someone in my organization needs to call from LabView. The declarations for my exported functions are like this example:
    extern "C" __declspec(dllexport)int DLL_Funct(int portnum, char str_data[33], unsigned char csn[4]);
    The function above passes an integer and a null terminated 32 char string and gets back a 4 byte uchar value.
    The LV programmer is having trouble getting my DLL functions to work. I suspect it has to do with different data types or byte alignment or something like that.
    I have zero experience with LV. Can someone please tell me what the equivalent function declaration should be in LV and whatever else I should tell my associate that might help make his code work?
    Thanks.
    Dave
    DRC

    Do you know what the LabVIEW programmer is doing? The "str_data" string parameter should be of Type "string" in the parameters list for the Call Library Function Node setup. The "csn" can be passed as an array of unsigned 8-bit integers.

  • HELP!  RETURN CLOB from External DLL

    Hi
    I am working on an External DLL using OCI. Basically, PL/SQL
    calls an
    External DLL to process the data and then returns LOB back to
    the PL/SQL
    procedure. Inside the DLL, I created a Temporary lob to process
    the data.
    The error is prompted from PL/SQL:
    SQL> exec isdb.test_clob;
    Before original length=10
    ORA-24805: LOB type mismatch
    ORA-06512: at "ISDBSVR.ISDB", line 24
    ORA-06512: at "ISDBSVR.ISDB", line 29
    ORA-06512: at line 1
    So far I know that error is caused by the return from PLS_CLOB
    is not clob.
    "After_original := PLS_CLOB(before_original); {you will see more
    code in the
    below}" However inside the DLL, I have defined OCIClobLocator
    and
    OCI_TEMP_CLOB to carry the CLOB data.
    I have found the following observations:
    1. If I change everything to blob, it works fine. (such as
    OCILobLocator,
    OCI_TEMP_CLOB and all variables in PL/SQL)
    2. If I run the same DLL and PL/SQL in 9i, it works fine (clob
    too)
    I guess it would be a bug for clob, please help to check thanks
    -- CODE - PL/SQL
    CREATE OR REPLACE PACKAGE BODY "ISDBSVR"."ISDB"
    as
    Function PLS_CLOB(var_clob in clob)
    RETURN clob IS
    EXTERNAL LIBRARY bb
    WITH CONTEXT
    NAME "Encrypt_Blob"
    LANGUAGE C
    PARAMETERS
    CONTEXT,
    var_clob,
    var_clob INDICATOR SB4,
    RETURN INDICATOR SB4
    PROCEDURE TEST_CLOB IS
    before_original cLOB;
    After_original cLOB;
    CHAR_TO_CLOB varchar(200);
    bsize int;
    BEGIN
    CHAR_TO_CLOB := 'AAAAAAABBBBBBCCCCCCC';
    dbms_lob.createtemporary( before_original, TRUE );
    DBMS_LOB.write( before_original,10,1,CHAR_TO_CLOB);
    bSize := DBMS_LOB.GetLength(before_original);
    DBMS_OUTPUT.PUT_LINE('Before original length='||bSize);
    After_original := PLS_CLOB(before_original);
    bSize := DBMS_LOB.GetLength(After_original);
    DBMS_OUTPUT.PUT_LINE('After original length='||bSize);
    dbms_lob.freetemporary(before_original);
    END;
    END ISDB;
    /* CODE - DLL */
    EXPORT OCILobLocator * EncryptBlob(OCIExtProcContext
    *with_context,
    OCILobLocator *plaintext2,
    sb4 pt_indicator2,
    sb4 *ret_indicator
    { FILE *fp;
    OCIClobLocator *cipherbb;
    ub4 amount;
    ocictx oci_ctx;
    ocictx *oci_ctxp = &oci_ctx;
    status = OCIExtProcGetEnv(with_context,
    &oci_ctxp->envhp,
    &oci_ctxp->svchp,
    &oci_ctxp->errhp);
    status = OCIDescriptorAlloc(oci_ctxp->envhp,
    (dvoid **) &cipherbb,
    (ub4) OCI_DTYPE_LOB,
    (size_t) 0,
    (dvoid **) 0);
    status = (int) OCILobCreateTemporary(oci_ctxp->svchp,
    oci_ctxp->errhp, cipherbb,
    OCI_DEFAULT,
    OCI_DEFAULT,
    OCI_TEMP_CLOB, OCI_ATTR_NOCACHE,
    OCI_DURATION_SESSION);
    amount = 6;
    status = OCILobCopy(oci_ctxp->svchp,
    oci_ctxp->errhp,
    cipherbb,
    plaintext2,
    amount,
    (ub4) 1,
    (ub4) 1);
    *ret_indicator = OCI_IND_NOTNULL;
    OCIDescriptorFree((dvoid *) cipherbb, (ub4) OCI_DTYPE_LOB);
    return(cipherbb);

    In what database version did you observe the problem?
    Thomas

  • LabView user-event from external dll source

    Hi!
    I'm dealing with the following issue:
    I use a CAN sniffer device, wich sends data over USB to a PC. The main goal is to create a vi that can process the incoming data. I already have a vi wich works with polling mechanism. It calls external DLL functions with the "Call library function node". The main problem is the polling mechanism.
    I would like to recreate this vi so that it would work event-driven. I have an other application, written in C++, that does the same thing, and it gets interrupts from a DLL, when a new data is available in the input buffer.
    The callback mechanism is implemented in the DLL.
    In LabView I would like to do tha same thing. There is the "event case structure", but there is no option for defining such user-events, that i would prefer.
    I have found a similar topic, there the solution is "occurrences". The occurrence is called from a DLL, too. But this solution uses the "waiting for occurrence to set", that is an endless-loop-like thing.
    The other thing I've found is the ActiveX and .NET events. I don't know, probably that is the solution.
    Anyway: is there a possibility to create such events, that can be generated from a simple external DLL and can be handled by "event case structure"? How should I do this?
    Or how NI does this? I mean that NIs DAQ cards must use some similar methods for data processing. Is there some tutorial or support about it?
    Thank you for your answer!

    2716jag wrote:
    Hi Wiebe,         From your answer i have a doubt that What it exactly means "If the dll is used from within LabVIEW". Also i want to know Is there any way to access the functuions defined in the .SYS file in Labview Environment. Regards,Jagan Can you be a litte more specific with your first sentence. I have no good idea what you mean. A .sys driver is usually a kernel device driver. This driver has to be started and run in the kernel subsystem which LabVIEW can not access directly. Such a driver is initialized using the CreateFile() Windows API. The returned handle is then used with other API functions such as ReadFile(), WriteWile(), DeviceIoControl(), and finally CloseHandle().Theoretically you could call all this APIs directly from within LabVIEW using the Call Library Node. In practice you do not want to do this even for fairly simple kernel drivers since the parameters for those APIs do get fairly complex in most cases, and you usually do also want to have some sort of asynchronous operation using events or such to make the driver access user friendly. All these things are most easily handled in a user space DLL written in C that exports a more LabVIEW friendly API that you can then import into LabVIEW using the Call Library Node. Usually most kernel device drivers do come with a accompagning user space DLL already, as this is the only sensible way of accessing such a driver. So you can usually look for the documentation of that user space DLL API and go from there trying to import that into LabVIEW using the Call Library Node. Even then it may not be easy at all if that API uses complicated function parameters and even completely impossible if it uses callbacks or such, requiring you to write a so called wrapper DLL that translates between the native API and a more LabVIEW friendly API.  You don't have to believe me but I can guarantee you that if writing such a user space DLL or wrapper DLL is beyond your capabilities, trying to go directly about accessing the Windows APIs in LabVIEW to access a kernel device driver is going to make you squirm in real pain. And those knowing how to write such a DLL would never even consider spending the time to try to access a kernel device driver directly from LabVIEW. Rolf Kalbermatter

  • What causes memory use of my program increase? (Write to Spreadshee​t? Running in LV environmen​t? External dlls? Waveform graphs?)

    Hi 
      I have attached a plot for the discussion here..
      I am monitoring the memory usage by my VI thru calling a window's dll to keep checking that (Many thanks to Matt). 
      I saw raising slopes and flat (wow! First time I catch this, that's what I am expecting)
      I am thinking where could there be a reason for memory growing up!
    What I did:-
    1. Mostly use queues (all limited # of elements) for parameters delivery between loops and between subVIs
    2. I close Obtained queue ref. every time I finish with it (only leaving a few keeping alive so they won't be killed)
    3. For all arrays I initialized with a fixed size array constant and do all jobs with Replace subset, Index Array and that In-place block.
    Above are measures I intended to use to save memory.
      However for a few points I think there might cause a memory grows, and I wish that someone can share with me your experience or give me an answer...
    1. Write to spread file:-- I keep using this to log data, events into harddisk, in my use I always append new logs/data to the existing file, however I keep doing it all the time throughout the run-time.
    2. Running my program in LV.exe -- I havn't compiled it yet. However when I was taking the plot's data, my PC is left with no one using it.
    3. There is a couple of external dlls running -- however it sounds to me from other's view point, external dll's resource doesn't count into Labview.exe. Since I am monitoring Labview's memory use, that couldn't be a source of the raising I see from this plot, right?
    4. Waveform graphs -- I am not sure whether this can be a problem. Everytime I feed data into a waveform control, I initialized a constant array and then replace elements into it, I don't think my data source is casuing any problem.
      Can someone comment on my above descriptions of my program?
    Raymond

    vgbraymond wrote:
    1. Write to spread file:-- I keep using this to log data, events into harddisk, in my use I always append new logs/data to the existing file, however I keep doing it all the time throughout the run-time.
    Write to spreadsheet file is a high level VI that opens and closes the file with every call. I would recommend to open the file once at the start of the programs, then append using lowlevel functions. Close the file after the program is done.
    Have you done any profiling to see which subVIs shows the bulk of the memory use?
    You might also turn off debugging to see if it makes a difference. Don't open the front panel of subVIs (and avoid functions that force the front panel to be in memory) unless they need to show something important to the user.
    It would really help if we could see some actual code. Can you strip it down to the essentials that still show the problem?
    LabVIEW Champion . Do more with less code and in less time .

  • 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

  • "Couldn't load library 'C:\SAP\NSP\SYS\exe\run\dbsdbslib.dll'"

    Hi!
    As you can see from here :
    http://www.fabiocavallo.it/sap/maxdb.jpg
    MaxDB seems to work fine, but after starting application server i have got an error :
    SAPGUI Logon Error Message:
    http://www.fabiocavallo.it/sap/sapguilog.jpg
    ...here comes dev_w0 :
    trc file: "dev_w0", trc level: 1, release: "700"
    ACTIVE TRACE LEVEL 1
    ACTIVE TRACE COMPONENTS all, MJ
    B
    B Thu May 22 19:58:50 2008
    B create_con (con_name=R/3)
    B Loading DB library 'C:\SAP\NSP\SYS\exe\run\dbsdbslib.dll' ...
    M *** ERROR => DlLoadLib: LoadLibrary(C:\SAP\NSP\SYS\exe\run\dbsdbslib.dll) Error 126 http://dlnt.c 237
    M Error 126 = "Impossibile trovare il modulo specificato."
    B *** ERROR => Couldn't load library 'C:\SAP\NSP\SYS\exe\run\dbsdbslib.dll'
    http://dbcon.c 4726
    M sysno 00
    M sid NSP
    M systemid 560 (PC with Windows NT)
    M relno 7000
    M patchlevel 0
    M patchno 95
    M intno 20050900
    M make: multithreaded, ASCII, optimized
    M pid 3376
    M
    M kernel runs with dp version 224(ext=109) (@(#) DPLIB-INT-VERSION-224)
    M length of sys_adm_ext is 360 bytes
    M ***LOG Q0Q=> tskh_init, WPStart (Workproc 0 3376) http://dpxxdisp.c 1301
    I MtxInit: 30000 0 0
    M DpSysAdmExtCreate: ABAP is active
    M DpSysAdmExtCreate: VMC (JAVA VM in WP) is not active
    M
    M Thu May 22 19:58:51 2008
    M DpShMCreate: sizeof(wp_adm) 6328 (904)
    M DpShMCreate: sizeof(tm_adm) 3605136 (17936)
    M DpShMCreate: sizeof(wp_ca_adm) 1200 (60)
    M DpShMCreate: sizeof(appc_ca_adm) 1200 (60)
    M DpCommTableSize: max/headSize/ftSize/tableSize=500/8/528040/528048
    M DpShMCreate: sizeof(comm_adm) 528048 (1048)
    M DpSlockTableSize: max/headSize/ftSize/fiSize/tableSize=0/0/0/0/0
    M DpShMCreate: sizeof(slock_adm) 0 (96)
    M DpFileTableSize: max/headSize/ftSize/tableSize=0/0/0/0
    M DpShMCreate: sizeof(file_adm) 0 (72)
    M DpShMCreate: sizeof(vmc_adm) 0 (1280)
    M DpShMCreate: sizeof(wall_adm) (22440/34344/56/100)
    M DpShMCreate: sizeof(gw_adm) 48
    M DpShMCreate: SHM_DP_ADM_KEY (addr: 06420040, size: 4205552)
    M DpShMCreate: allocated sys_adm at 06420040
    M DpShMCreate: allocated wp_adm at 06421A28
    M DpShMCreate: allocated tm_adm_list at 064232E0
    M DpShMCreate: allocated tm_adm at 06423310
    M DpShMCreate: allocated wp_ca_adm at 067935A0
    M DpShMCreate: allocated appc_ca_adm at 06793A50
    M DpShMCreate: allocated comm_adm at 06793F00
    M DpShMCreate: system runs without slock table
    M DpShMCreate: system runs without file table
    M DpShMCreate: allocated vmc_adm_list at 06814DB0
    M DpShMCreate: allocated gw_adm at 06814DF0
    M DpShMCreate: system runs without vmc_adm
    M DpShMCreate: allocated ca_info at 06814E20
    M DpShMCreate: allocated wall_adm at 06814E28
    X EmInit: MmSetImplementation( 2 ).
    X MM global diagnostic options set: 0
    X <ES> client 0 initializing ....
    X Using implementation view
    M <EsNT> Memory Reset disabled as NT default
    X ES initialized.
    M ThInit: running on host PCFABIO
    M
    M Thu May 22 19:58:52 2008
    M calling db_connect ...
    B create_con (con_name=R/3)
    B Loading DB library 'C:\SAP\NSP\SYS\exe\run\dbsdbslib.dll' ...
    M *** ERROR => DlLoadLib: LoadLibrary(C:\SAP\NSP\SYS\exe\run\dbsdbslib.dll) Error 126 http://dlnt.c 237
    M Error 126 = "Impossibile trovare il modulo specificato."
    B *** ERROR => Couldn't load library 'C:\SAP\NSP\SYS\exe\run\dbsdbslib.dll'
    http://dbcon.c 4726
    M ***LOG R19=> ThInit, db_connect ( DB-Connect 008192) http://thxxhead.c 1426
    M in_ThErrHandle: 1
    M *** ERROR => ThInit: db_connect (step 1, th_errno 13, action 3, level 1) http://thxxhead.c 10240
    M
    M Info for wp 0
    M
    M stat = WP_RUN
    M waiting_for = NO_WAITING
    M reqtype = DP_RQ_DIAWP
    M act_reqtype = NO_REQTYPE
    M rq_info = 0
    M tid = -1
    M mode = 255
    M len = -1
    M rq_id = 65535
    M rq_source =
    M last_tid = 0
    M last_mode = 0
    M semaphore = 0
    M act_cs_count = 0
    M csTrack = 0
    M csTrackRwExcl = 0
    M csTrackRwShrd = 0
    M control_flag = 0
    M int_checked_resource(RFC) = 0
    M ext_checked_resource(RFC) = 0
    M int_checked_resource(HTTP) = 0
    M ext_checked_resource(HTTP) = 0
    M report = > <
    M action = 0
    M tab_name = > <
    M vm = no VM
    M
    M *****************************************************************************
    M *
    M * LOCATION SAP-Server PCFABIO_NSP_00 on host PCFABIO (wp 0)
    M * ERROR ThInit: db_connect
    M *
    M * TIME Thu May 22 19:58:52 2008
    M * RELEASE 700
    M * COMPONENT Taskhandler
    M * VERSION 1
    M * RC 13
    M * MODULE thxxhead.c
    M * LINE 10439
    M * COUNTER 1
    M *
    M *****************************************************************************
    M
    M PfStatDisconnect: disconnect statistics
    M Entering TH_CALLHOOKS
    M ThCallHooks: call hook >ThrSaveSPAFields< for event BEFORE_DUMP
    M *** ERROR => ThrSaveSPAFields: no valid thr_wpadm http://thxxrun1.c 720
    M *** ERROR => ThCallHooks: event handler ThrSaveSPAFields for event BEFORE_DUMP failed http://thxxtool3.c 260
    M Entering ThSetStatError
    M ThIErrHandle: do not call ThrCoreInfo (no_core_info=0, in_dynp_env=0)
    M Entering ThReadDetachMode
    M call ThrShutDown (1)...
    M ***LOG Q02=> wp_halt, WPStop (Workproc 0 3376) http://dpnttool.c 327
    File dbsdbslib.dll' is 'there' (in 'C:\SAP\NSP\SYS\exe\run\), maybe i have to set environment variable in windows for SAP.
    Could you help me, please ?
    I don't know how to set these variables.......
    Many thanks.
    Regards.
    Fabio

    Hello Fabio,
    -> You wrote:
    "File dbsdbslib.dll' is 'there' (in 'C:\SAP\NSP\SYS\exe\run\)"
    => Please check the version of this file.
    < Go to file properties ->Version && update with 'file version', Platform,
       Product Name, Product Version information >
    -> What version of the SAP system did you install?
         "I suppose that i can download this patch from Sap MaketPlace, but i can't register there, because i have no
          Customer or   Installation Number! (i can't Logon in SAP....) "
         From were did you get the SAP software installation or CD?
    -> Could you upgrade the database client software on the application server to the version 7.7.04.08 or higher.
        You pointed "As you can see from here : http://www.fabiocavallo.it/sap/maxdb.jpg u2026 "
       => If the database and application were running on the same server, you installed the database
    Software version 7.6.02.17. Please run 'sdbregview -l' to review the list of all installed packages
    on the server.
    -> "MaxDB seems to work fine, but after starting application server i have got an error"
         Was the system working fine before? What was changed?
         Or you was not able to start the application server after installation. ?
    Thank you and best regards, Natalia Khlopina

  • SSO for External application not part of the portal framework

    Greetings,
    I am desperate!!!
    I am trying to do the following:
    I have a pl/sql application that presents to the user a set of external applications links.When the user activates a link, I would like to make a call the SSO server so it can do external application login.
    I know I can configure the external applications as described in the SSO admin guide.
    Unfortunately the API to query the SSO server for external application mapping is not public.
    ANY IDEAS ON WHERE I CAN GET THIS INFO??
    Every thing I have read says that external applications can be accessed through Portal. This is not my case. I can use any packages or classes available by the SSO server to portal, but MY APPLICATION IS NOT A PORTAL.

    I have similar kind of requirements for Single sign-on to external web applications.
    But in my applications I have to auto-generate random userid & password for different external web applications.
    These uids & password are exported to external applications, which upon recieving creates user in their applications.
    So, actual user will never have access to these credentials(uid &pwd).
    So, how can I cutomize the Portlets to do the first time SSO when user is created & their credentials to external apps are stored to OID.
    Any idea Barry..
    Bye

  • How download  data of me2s   'po order for external  services: in cxcel'

    THIS IS sandipan. I am very new in this field . My requirement is when i am going  to me2s  t.code. then i am giving purchasing group , plant , Service Number as input. then it showing purchase doc . , item , porg , matl... , plant , crcy . It's ok. but after that when i am clicking  purchase order it displays Purchase order for external services : overview screen in a hiarirchical view  and no download option is available here.  I need to export the data of that screen to a excel sheet . how Is it possible ? please help me ...
    Moderator message: please do not open multiple threads for the same or similar issue.
    Edited by: Thomas Zloch on Jan 7, 2012 10:22 PM

    Hi
    T165A is used for 'Services Pricing'.
    Please note that for Services PO, you will have two pricing schema.
    1) At PO-Item Level : RM0000 (or whatever you define in schema determination in Purchasing ->Conditions IMG and assign in your vendor master)
    2) At service line level : Based on settings in T165A.
    If you check in Services level conditions screen and click on Analysis, you will find that ZS0001 is triggered.
    Best regards
    Ramki

  • HT4236 I've run out of room on my hard drive. I bought an external drive and exported all my albums to the external drive then deleted the albums from iPhoto. I want to sync both from my ext drive and new albums in iPhoto. No dice. Help!

    I've run out of room on my hard drive. I bought an external drive and exported all my albums to the external drive then deleted the albums from iPhoto. I want to sync both from my ext drive and new albums in iPhoto. My photos on the devices get wiped out when I sync to iPhoto since I deleted all the albums. But when I sync to my hard drive (where I maintained the album structure) the photos are copied to my iPad but lose all the hierarchy and folder structure. Now I have to scroll through thousands of photos to try to find the one I'm looking for. Before I sync any more devices I want to know the following: 1) can I restore the album structure on my iPad by using the photo cache? 2) is there a way to sync both new iPhoto albums AND pictures in the folders in my hard drive? And 3) how can I keep the photo hierarchy structure from my hard drive intact on my devices?

    TigerMom28 wrote:
    I've run out of room on my hard drive. I bought an external drive and exported all my albums to the external drive then deleted the albums from iPhoto.
    Don't do that.
    Copy /Photos/Photo library/ to the external.
    Hold Option and launch iPhoto.
    Select Choose library and select the Photo library you copied to the external.

Maybe you are looking for

  • Runtime error SQL error 3114 occurred when accessing program CX_ w

    Hi Friends, Iam in a big mess . I have one query based on one my Zinfocube.This query ia attached in the workbook .. Previuolsy all was fine , but now whever iam executing this query it is throwing me the exception Query 0: Runtime error SQL error 31

  • Pbm in File adapter..Post Sp14

    Hi I have a strange pbm with my fileadapter after SP14..Normally without File content conversion, the adapter works fine and is able to send the XML message to Integration engine..But in a Content conversion mode(from a delimited flat file), I dont s

  • Complex request with range filter and boolean search

    Hi I need a build and maintain complex requests to Oracle Endeca Server. These requests could include different types of attributes: string, datetime, int. For string attributes I have created a search interface and use boolean search. For datetime a

  • Exception in CURSOR

    Hi Friends, I want to handle this exception(NO_DATA_FOUND) in cursor but my SELECT statement in cursor not like SELECT INTO. How to handle it? This is my Code-- SET SERVEROUTPUT ON DECLARE      CURSOR C_ARG(I_DNO NUMBER, I_JOB EMP.JOB%TYPE)      IS  

  • Application Parameter does not work on migrating

    We have encountered this various times. When we add an application parameter to an existing application, it does not work on migrating. We have to make a new service (application) and then attach the parameter to it, then it works. What is the reason