Re: [cx-oracle-users] segmentation violations
Brought to you by:
atuining
From: Anthony T. <ant...@gm...> - 2016-10-25 18:06:09
|
On Tue, Oct 25, 2016 at 11:52 AM, Fred Yankowski <fc...@im...> wrote: > Thanks, Anthony. > You're welcome. > > I have tried running with 'threaded' set to True and that does not help. > Didn't think so -- but worth checking. :-) > > Various combinations of argument values to my test script cause SIGSEGV in > different places (or no SIGSEGV at all in some cases), but not correlating > with any given option value. It's as if minor changes in the call stack > cause the oracle client code to go off the rails, unrelated to the exact > arguments passed down to the oracle client API. > Yeah. These are the hardest to track down. It will be due to some memory overwrite somewhere -- but it could be *anything* that is running in your process that causes the problem. If you're familiar with valgrind and similar tools you can see if anything turns up using that. > > My application connects to Oracle only infrequently, polling for data > updates on hourly cron jobs. So the complexity of connection pooling did > not make sense per se. But I'll give it a try to see if it works around > this problem. I'm not familiar with DRCP. > Sure. DRCP stands for "Database Resident Connection Pooling" and is server side pooling. It is fairly simple to use. I have a sample that will be made available in a newer version of cx_Oracle. I'll provide the basic here: In SQL*Plus you need to run these commands: exec dbms_connection_pool.start_pool() # to start the pool exec dbms_connection_pool.stop_pool() # to stop the pool conn = cx_Oracle.Connection("cx_Oracle/dev@localhost/orcl:pooled", cclass = "PYCLASS", purity = cx_Oracle.ATTR_PURITY_SELF) Note the addition of the ":pooled" on the end of the connect string (or this can be included in the TNS entry if you prefer that to the EZ Connect syntax). Then you need to specify the cclass (connection class). This makes use of a different API internally (OCISessionGet() vs OCISessionBegin()) as does the general session pool case so this may or may not work around your issue. > > The oracle database I'm connecting to comes embedded with another product > (PowerSchool) and so we don't administer it directly, only through admin > tools provided by PowerSchool. The diagnostics you mention would be on the > oracle server side, right? > No. The diagnostics would be client based as the segfault is occurring there. One other thing to check -- the NLS database parameters vs the NLS client parameters. You can improve performance and possibly eliminate problems by matching them, if possible. Good luck! > > -- > Fred Yankowski > fc...@im... +1-630-907-5019 > > ------------------------------ > > Hi Fred, > > You seem to be experiencing a sort of memory corruption perhaps due to an > overwrite somewhere. If you were using threads I would have immediately > told you that you need to ensure threaded mode is enabled -- but I don't > see multiple threads in use. You may wish to enable it anyway to see if you > get consistent results, but that shouldn't be a problem. > > I have seen similar, highly intermittent, segfaults inside > OCIServerAttach() myself, but only when using threads -- and they don't > terminate in the same place. > > You could try using a session pool (cx_Oracle.SessionPool) with or without > DRCP to see if that makes things happier. Not sure how many connections you > are generally creating but if you are creating a few this would improve > performance anyway! > > You can try enabling diagnostics for Oracle and seeing if interesting > information shows up. You can also see if you get consistent backtraces. > > All of that said, I don't have this problem! Of course I'm not running the > exact configuration you have. Depending on what you get from backtraces and > diagnostics you can log a support request and see if they can help you. > > Anthony > > > ------------------------------------------------------------ > ------------------ > The Command Line: Reinvented for Modern Developers > Did the resurgence of CLI tooling catch you by surprise? > Reconnect with the command line and become more productive. > Learn the new .NET and ASP.NET CLI. Get your free copy! > http://sdm.link/telerik > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > > |