Hello,
I was looking at the unixRemapfile() function
and i found something strange on line 5047.
See: https://github.com/mackyle/sqlite/blob/master/src/os_unix.c
That if statement is now:
if( pNew==0 ) {
I think it must be:
if( pNew==MAP_FAILED || pNew==0 ) {
I am probably missing something important here...
If for example osMmap() on line 5029 returns MAP_FAILED then the
entire mapping is free'ed but SQLite falls back to xRead/xWrite.
At it doesn't create a new mapping on line 5048..
Martijn.
Thanks for reviewing the code.
It seems Ok to me. Once we see MAP_FAILED we do not make any further attempts to map the file. As per this:
http://www.sqlite.org/src/artifact/f6e91b8fd82af?ln=5056-5058
Dan.
Hi,
If the extent of an existing mapping failed then pNew
becomes equal to MAP_FAILED (for mremap() or mmap()).
Thats here: http://www.sqlite.org/src/artifact/f6e91b8fd82af?ln=5026-5029
The existing mapping is free'ed on line 5042.
But pNew is equal to MAP_FAILED so we never go into
this if statement: https://www.sqlite.org/src/artifact/f6e91b8fd82af?ln=5046-5049
The comment that you refer to says the above mmap() call failed,
but it is not called.
Because pNew == MAP_FAILED.
_______________________________________________ sqlite-dev mailing list sqlit...@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-dev