Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

OCCI 19.3.0: createConnection crashes with OCCIUTF16

HupsiJul 9 2019

Hi, we would like to upgrade from occi 18 to occi 19.3.0.0.0 because we want to be independent of old MS libraries (MSVCR120.DLL).

But there is the following error while connecting the database:

"Program: C:\Windows\SYSTEM32\MSVCP140D.dll

File: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xstring

Line: 1695 Expression: string subscript out of range

For information ..."

We get the error with this testprogram:

#include "occi.h"

#include <iostream>

using namespace oracle::occi;

using namespace std;

int main(int argc, wchar_t * argv[])

{

    try {

        // OK

        //auto env = Environment::createEnvironment(Environment::Mode(Environment::OBJECT | Environment::THREADED_MUTEXED));

        //auto conn = env->createConnection("SCOTT", "tiger", "ORATEST");

        // ERROR

        auto env = Environment::createEnvironment("OCCIUTF16", "OCCIUTF16", Environment::Mode(Environment::OBJECT | Environment::THREADED_MUTEXED));

        UString user((utext*)L"SCOTT");

        UString pwd((utext*)L"tiger");

        UString host((utext*)L"ORATEST");

        auto conn = env->createConnection(user, pwd, host);

    }

    catch (SQLException & ex) {

        cout << ex.what();

    }

    return 0;

}

When we remove "OCCIUTF16", "OCCIUTF16" in createEnvironment the connection succeeds.

We also recognized, that oci.dll was not loaded in this simple programm using occi 19. With occi 18 oci.dll was loaded.

Environment:

ORACLE SERVER 12.1.0.2

Microsoft Visual C++ 2017 Compiler Version 15.9.13

Basic Light Package Information

===============================

Wed May 29 22:35:38 MDT 2019

Client Shared Library 64-bit - 19.3.0.0.0

Any ideas?

Thanks in advance!

Greetings,

Wolfgang

Comments

Martin-3221748

I have exactly the same issue with Oracle Instant Client 19.18 on Windows.

Visual Studio 2022 17.2.6

The same test program as listed above.

If compiled in debug mode, we hit:

Debug Assertion Failed!

Program: C:\Windows\SYSTEM32\MSVCP140D.dll
File: C:\PROGRA~2\MIB055~1\2017\PROFES~1\VC\Tools\MSVC\14.13.26128\include\xstring
Line: 3155

Expression: string subscript out of range

In Release Mode, the connect call goes through and in the dummy program it seems the connection is correctly established.

1 - 1

Post Details

Added on Jul 9 2019
1 comment
1,571 views