Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 4344bf642ac217dbb337ef57459af1bfa3b9ac4b
Ticket: 960414ffffffffffffffffffffffffffffffffff
exit causes segmentation violation with Oratcl extension
User & Date: tmh on 2004-05-30 21:42:19
Changes

  1. icomment:
    Logged In: YES 
    user_id=92123
    
    I have found some additional information from oracle..
    
    ---------------
    
    symptom: Dynamically unloading shared library fails 
    symptom: SIGSEGV 11* segmentation violation 
    symptom: Core dump is generated 
    
    cause: A program, either Pro*C or OCI, that dynamically 
    loads and unloads a shared library that includes libclntsh.so 
    will cause a core dump on exit after dynamically unloading the 
    shared library. This will only occur if a connect and 
    disconnect to Oracle is performed. 
    
    This documented in <bug:2012268>:CORE DUMP ON EXIT OF 
    PRO*C PROGRAM USING DLCLOSE(). The dlopen loads the 
    users shared object, and this in turn causes libclntsh.so to be 
    loaded into the program. The Oracle trace code in the client 
    registers an exit handler by calling "atexit()". This registers a 
    function which resides inside libclntsh.so to be called at exit 
    from the process. dlclose() unloads the users library and 
    libclntsh.so. exit() tries to call "epc_exit_handler" which is 
    now unmapped. 
    
    -------
    
    Since Tcl 8.5 now calls dlclose for packages where 8.4  
    apparently does not.  Would it be too late for a feature that 
    allows package writers the option to skip the dlclose ?
    
    Also, Oracle provides a solution (hack) to get around the core 
    dump.  This is apparently a Solaris only issue.
    
    Workaround (Solaris specific): 
    
    Before starting the process which performs dlopen/dlclose of 
    a module linked with Oracle set the environment variable 
    LD_PRELOAD to point to the libclntsh.so file that is being 
    used. For example: 
    
    setenv LD_PRELOAD 
    $ORACLE_HOME/rdbms/lib/libclntsh.so.8.0 
    
    This maps libclntsh permanently and avoids the core dump. 
    This variable must only be set for programs that encounter 
    the core dump and not set generally. 
    
    
    Since this is clearly Oracle's fault, Would someone kindly 
    change the close the status of this bug report.
    
    Thanks
    Todd
    
    
    
    
  2. login: "tmh"
  3. mimetype: "text/plain"
  4. username: "tmh"