• Stephan Bergmann's avatar
    Guard against globally shared UNO ref accessed from wrong UNO env · 03a27190
    Stephan Bergmann yazdı
    connectivity/source/drivers/jdbc/jdbc.component has
    
      environment="@CPPU_ENV@:affine"
    
    to place the com.sun.star.comp.sdbc.JDBCDriver implementation into an affine UNOenvironment.
    
    The com.sun.star.sdbcx.comp.hsqldb.Driver implementation (in the normal C++ UNO
    environment), in ODriverDelegator::connect
    (connectivity/source/drivers/hsqldb/HDriver.cxx), calls
    StorageContainer::registerStorage to store an XStorage in a global map, then
    calls the JDBCDriver (i.e., thread enters the affine environment), which calls
    via (non-UNO) JNI into hsqldb.jar code, which in turn calls via (non-UNO) JNI
    into Java_com_sun_star_sdbcx_comp_hsqldb_StorageFileAccess_isStreamElement
    (connectivity/source/drivers/hsqldb/StorageFileAccess.cxx), which uses
    StorageContainer::getRegisteredStorage to obtain the XStorage and use it.
    
    But that XStorage is the original C++ object, not a proxy that witnesses the
    mapping between the normal C++ and the affine UNO environment.  (And the thread
    is still in the affine environment, after having passed through the Java stack
    frames via non-UNO JNI.)
    
    That does not necessarily cause any problems immediately (so apparently went
    unnoticed for quite a while), but when the XStorage-implementation in turn wants
    to obtain the SimpleLogRing singleton, it would now trigger the
    
      std::abort();//TODO
    
    in cppuhelper/source/servicemanager.cxx (where the invocation-by-constructor
    case hasn't yet been implemented for differing environments), when that
    singleton is changed to use the constructor feature in
    <https://gerrit.libreoffice.org/#/c/22020/> "tdf#74608: Constructor function for
    SimpleLogRing singleton."
    
    So just do any necessary mapping every time an XStorage stored in the static
    StorageContainer is accessed.
    
    Change-Id: I91a62fd7e1cec29026f70a2c3acdfe051885c0fa
    03a27190
Adı
Son kayıt (commit)
Son güncelleme
..
ado Loading commit data...
calc Loading commit data...
dbase Loading commit data...
file Loading commit data...
flat Loading commit data...
hsqldb Loading commit data...
java Loading commit data...
mysql Loading commit data...
odbc Loading commit data...
resource Loading commit data...
AutoRetrievingBase.hxx Loading commit data...
FDatabaseMetaDataResultSet.hxx Loading commit data...
FDatabaseMetaDataResultSetMetaData.hxx Loading commit data...
OColumn.hxx Loading commit data...
OTypeInfo.hxx Loading commit data...
ParameterSubstitution.hxx Loading commit data...
RowFunctionParser.hxx Loading commit data...
TConnection.hxx Loading commit data...
TDatabaseMetaDataBase.hxx Loading commit data...
TKeyValue.hxx Loading commit data...
TPrivilegesResultSet.hxx Loading commit data...
TResultSetHelper.hxx Loading commit data...
TSkipDeletedSet.hxx Loading commit data...
TSortIndex.hxx Loading commit data...
propertyids.hxx Loading commit data...