mariadb/storage
Nirbhay Choubey c67a91f11a Bug#11756764 48726: MYSQLD KEEPS CRASHING WITH SIGSEGV
WITH MYISAM_USE_MMAP ENABLED

MySQL server can crash due to segmentation fault when
started with myisam_use_mmap.

The reason behind this being, while making a request to
unmap (munmap) the previously mapped memory (mmap), the
size passed was 7 bytes larger than the size requested at
the time of mapping. This can eventually unmap the adjacent
memory mapped block, belonging to some other memory-map pool.
Hence the subsequent call to mmap can map a region which was
still a valid memory mapped area.

Fixed by removing the extra 7-byte margin which was erroneously
added to the size, used for unmappping.


storage/myisam/mi_close.c:
  Bug#11756764 48726: MYSQLD KEEPS CRASHING WITH SIGSEGV
                      WITH MYISAM_USE_MMAP ENABLED
  
  Added a condition to call _mi_unmap_file() in case
  of compressed records. mi_munmap_file() is called
  otherwise.
storage/myisam/mi_packrec.c:
  Bug#11756764 48726: MYSQLD KEEPS CRASHING WITH SIGSEGV
                      WITH MYISAM_USE_MMAP ENABLED
  
  mi_dynmap_file() function, after successfully executing
  mmap, stores the total size in info->s->mapped_length
  variable. Now, if mi_dynmap_file() is invoked with a size
  with an extra 7-byte margin (MEMMAP_EXTRA_MARGIN),
  the margin will eventually also get stored in mapped_length.
  So, un-mapping function can simply use the value stored in
  mapped_length in order to unmap the previously mapped
  region.
2011-11-29 17:59:35 +05:30
..
archive BUG#11751793 - 42784: ARCHIVE TABLES CAUSE 100% CPU USAGE 2011-11-23 18:33:29 +05:30
blackhole Updated/added copyright headers 2011-06-30 17:37:13 +02:00
csv Updated/added copyright headers 2011-06-30 17:37:13 +02:00
example Updated/added copyright headers 2011-06-30 17:37:13 +02:00
federated Bug #11750417 40942: UNABLE TO INSTALL FEDERATED PLUGIN 2011-09-05 14:38:20 +02:00
heap BUG#11759349 - 51655: CREATE TABLE IN MEMORY ENGINE DOESN'T STORE 2011-09-27 17:38:51 +05:30
innobase Merge from mysql-5.1.60-release 2011-11-17 00:26:16 +01:00
innodb_plugin Bug#13390506 - VALGRIND FAILURE AFTER THE FIX FOR 13371000 2011-11-18 10:59:10 -05:00
myisam Bug#11756764 48726: MYSQLD KEEPS CRASHING WITH SIGSEGV 2011-11-29 17:59:35 +05:30
myisammrg Updated/added copyright headers 2011-07-03 17:47:37 +02:00
ndb Merge from mysql-5.1.58-release 2011-07-06 00:56:51 +02:00
Makefile.am Updated/added copyright headers 2011-06-30 17:37:13 +02:00
mysql_storage_engine.cmake Updated/added copyright headers 2011-06-30 17:37:13 +02:00