[DB-SIG] Re: DB-SIG digest, Vol 1 #218 - 1 msg

Philip Payne pnpayne@swissonline.ch
Sun, 13 Feb 2000 09:38:02 +0100


>     ---------------------------------------------------------------
> 
> Subject: [DB-SIG] DCOracle & Oracle 8.1.5 (Linux)
> Date: Sat, 12 Feb 2000 11:15:55 +0000
> From: Mike Wilson <mrw@plexus.demon.co.uk>
> Organization: Plexus Systems Ltd
> To: db-sig@python.org
> 
> It was hard work, but I managed to build DCOracle for Oracle
> 8.1.5. Problem is, it regularly goes "Segmentation fault" on
> pretty simple scripts like:
> 
> import DCOracle
> 
> dbc = DCOracle.Connect ("scott/tiger@orcl")
> cursor = dbc.cursor ()
> 
> cursor.execute ("select * from emp order by ename")
> 
> row = cursor.fetchone ()
> 
> while row:
>     print row [0]
>     row = cursor.fetchone ()
> 
> The script prints all the rows, so it looks like it's crashing
> inside Oracle or DCOracle during cleanup. Has anyone had
> similar problems?  Any idea what the solution is?
> 
> ----------------------------------------------
> Mike Wilson             Plexus Systems Ltd, Reading Berkshire, UK
> mrw@plexus.demon.co.uk             http://www.plexus.demon.co.uk/

Mike,

Try changing your make file to compile DCOracle without optimization:
   cc -O0 ...
(that's oh zero). 

I was having the same behaviour on Linux until I finally remembered that
OCI programs always used to have to be compiled with optimization
disabled and made this change. Since then - no problems. (It's many
years since I wrote an OCI program, and Oracle don't explicitly mention
disabling optimization in their recent documentation, so I'd be
interested to know if people had the same problem on other platforms.)

Regards,
Philip Payne