Yes, the original post was mine.
I have removed the following code from the fillInUnixFile method (in my
local port) to the following, and with limited testing so far, have not run
into any problems:
pNew = sqlite3_malloc( sizeof(unixFile) );
if( pNew==0 ){
close(h);
enterMutex();
releaseLockInfo(pNew->pLock);
releaseOpenCnt(pNew->pOpen);
leaveMutex();
return SQLITE_NOMEM;
}else{
(snipit starts at line 2196)
Also, I think there might be a bug on line 2193:
pNew->dirfd = -1;
Seems like that should be:
pNew->dirfd = dirfd;
Again, I have made these changes with very limited testing, and it least it
isn't blowing up. :)
Thanks,
Mark
> -----Original Message-----
> From: Simon Davies [mailto:[EMAIL PROTECTED]
> Sent: Thursday, November 29, 2007 10:45 AM
> To: [email protected]; [EMAIL PROTECTED]
> Subject: Re: [sqlite] Doubtful code in os_unix.c
>
>
> See
> http://www.nabble.com/SQLite-3.5.2---Unix---Memory-issue--tf48
> 51124.html
>
> Rgds,
> Simon
>
> On 29/11/2007, Alexandre Balaban <[EMAIL PROTECTED]> wrote:
> > Hello,
> >
> > did someone recently tested the unix code with the locking
> > style enabled ?
> > I ask because I saw dubious code in this file, specifically :
> >
> > if( pNew==0 ){
> > close(h);
> > enterMutex();
> > releaseLockInfo(pNew->pLock);
> > releaseOpenCnt(pNew->pOpen);
> > leaveMutex();
> > return SQLITE_NOMEM;
> > }else{
> >
> > Which will lead to a crash for sure.
> >
> > I'm in process to update my AmigaOS4 port of version 3.3.18 to
> > latest code and I am using the unix source as a reference
> > implementation, am I right or wrong ?
> >
> > best regards,
> >
> > Alexandre BALABAN.
> >
> >
> --------------------------------------------------------------
> ---------------
> > To unsubscribe, send email to [EMAIL PROTECTED]
> >
> --------------------------------------------------------------
> ---------------
> >
> >
>
> --------------------------------------------------------------
> ---------------
> To unsubscribe, send email to [EMAIL PROTECTED]
> --------------------------------------------------------------
> ---------------
>
>
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------