Bug #47139 Test "merge" crashes in "embedded" run
Submitted: 4 Sep 2009 13:32 Modified: 14 Oct 2010 13:35
Reporter: Joerg Bruehe Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Embedded Library ( libmysqld ) Severity:S3 (Non-critical)
Version:5.4.2-beta OS:FreeBSD
Assigned to: Alexey Botchkov CPU Architecture:Any

[4 Sep 2009 13:32] Joerg Bruehe
Description:
Happened in the 5.4.2-beta release build,
only on FreeBSD, both 6.3 and 7.0, both x86 (32 bit) and x86_64 (64 bit):

=====
main.merge                               [ retry-fail ]
        Test ended at YYYY-MM-DD HH:MM:SS

CURRENT_TEST: main.merge
mysqltest got signal 11
Backtrace not available.
Writing a core file...

 - saving '/PATH/mysql-test/var/log/main.merge/' to '/PATH/mysql-test/var/log/main.merge/'

Test has failed 2 times, no more retries!
=====

How to repeat:
Just try the test suite with the embedded server.
[11 Nov 2009 3:13] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/90038

2945 Alexey Botchkov	2009-11-10
      Bug #47139      Test "merge" crashes in "embedded" run
        In fact this crashes in normal (not embedded) run also.
        The problem is in the memory mapping. Handling the ha_myisammrg::extra(MMAP)
        the MERGE engine tries to mmap all the tables it unites.
        Though some can be empty and then in the mi_dynmap_file()
        we call the my_mmap(0). Normally this call returns MAP_FAILED,
        but not on FreeBSD. There it returns like a 'normal' value,
        and after the consequitive munmap systems gets unstable and
        crashes on some system call later.
      
      per-file comments:
        storage/myisam/mi_dynrec.c
      Bug #47139      Test "merge" crashes in "embedded" run
          don't try to mmap zero-length area, just return at once.
[11 Nov 2009 6:57] Alexander Barkov
The patch http://lists.mysql.com/commits/90038 looks Ok to push.
[11 Nov 2009 8:58] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/90059

2945 Alexey Botchkov	2009-11-11
      Bug #47139      Test "merge" crashes in "embedded" run
        In fact this crashes in normal (not embedded) run also.
        The problem is in the memory mapping. Handling the ha_myisammrg::extra(MMAP)
        the MERGE engine tries to mmap all the tables it unites.
        Though some can be empty and then in the mi_dynmap_file()
        we call the my_mmap(0). Normally this call returns MAP_FAILED,
        but not on FreeBSD. There it returns like a 'normal' value,
        and after the consequitive munmap systems gets unstable and
        crashes on some system call later.
            
      per-file comments:
        storage/myisam/mi_dynrec.c
      Bug #47139      Test "merge" crashes in "embedded" run
          don't try to mmap zero-length area, just return at once.
[11 Nov 2009 9:02] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/90060

2917 Alexey Botchkov	2009-11-11
      Bug #47139      Test "merge" crashes in "embedded" run
        In fact this crashes in normal (not embedded) run also.
        The problem is in the memory mapping. Handling the ha_myisammrg::extra(MMAP)
        the MERGE engine tries to mmap all the tables it unites.
        Though some can be empty and then in the mi_dynmap_file()
        we call the my_mmap(0). Normally this call returns MAP_FAILED,
        but not on FreeBSD. There it returns like a 'normal' value,
        and after the consequitive munmap systems gets unstable and
        crashes on some system call later.
      
      per-file comments:
        storage/myisam/mi_dynrec.c
      Bug #47139      Test "merge" crashes in "embedded" run
          don't try to mmap zero-length area, just return at once.
[11 Nov 2009 12:58] Alexey Botchkov
mysql-next-mr-alik
[13 Nov 2009 9:19] Bugs System
Pushed into 6.0.14-alpha (revid:alik@ibmvm-20091112005514-6ykwpvff6w3hnz28) (version source revid:alik@ibmvm-20091112005023-3ju8y7g1y0u15nqi) (merge vers: 6.0.14-alpha) (pib:13)
[13 Nov 2009 9:19] Bugs System
Pushed into 5.5.0-beta (revid:alik@sun.com-20091112150024-undyu20ovoolelwq) (version source revid:holyfoot@mysql.com-20091110211030-pjdib23gkasbga41) (merge vers: 5.5.0-beta) (pib:13)
[17 Nov 2009 16:45] Paul DuBois
Noted in 5.5.0, 6.0.14 changelogs.

On FreeBSD, memory mapping for MERGE tables could fail if underlying
tables were empty.
[16 Jul 2010 17:33] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/113784

3490 Davi Arnaut	2010-07-16
      Bug#48327: Some crashes specific to FreeBSD ("embedded")
      Bug#47139: Test "merge" crashes in "embedded" run
      
      Backport patch for Bug#47139
[22 Jul 2010 15:35] Paul DuBois
Noted in 5.1.50 changelog.
[23 Jul 2010 12:23] Bugs System
Pushed into mysql-trunk 5.5.6-m3 (revid:alik@sun.com-20100723121820-jryu2fuw3pc53q9w) (version source revid:vasil.dimov@oracle.com-20100531152341-x2d4hma644icamh1) (merge vers: 5.5.5-m3) (pib:18)
[23 Jul 2010 12:30] Bugs System
Pushed into mysql-next-mr (revid:alik@sun.com-20100723121929-90e9zemk3jkr2ocy) (version source revid:vasil.dimov@oracle.com-20100531152341-x2d4hma644icamh1) (pib:18)
[19 Aug 2010 15:42] Bugs System
Pushed into mysql-5.1 5.1.51 (revid:build@mysql.com-20100819151858-muaaor6jojb5ouzj) (version source revid:build@mysql.com-20100819151858-muaaor6jojb5ouzj) (merge vers: 5.1.51) (pib:20)
[14 Oct 2010 8:28] Bugs System
Pushed into mysql-5.1-telco-7.0 5.1.51-ndb-7.0.20 (revid:martin.skold@mysql.com-20101014082627-jrmy9xbfbtrebw3c) (version source revid:martin.skold@mysql.com-20101014082627-jrmy9xbfbtrebw3c) (merge vers: 5.1.51-ndb-7.0.20) (pib:21)
[14 Oct 2010 8:43] Bugs System
Pushed into mysql-5.1-telco-6.3 5.1.51-ndb-6.3.39 (revid:martin.skold@mysql.com-20101014083757-5qo48b86d69zjvzj) (version source revid:martin.skold@mysql.com-20101014083757-5qo48b86d69zjvzj) (merge vers: 5.1.51-ndb-6.3.39) (pib:21)
[14 Oct 2010 8:57] Bugs System
Pushed into mysql-5.1-telco-6.2 5.1.51-ndb-6.2.19 (revid:martin.skold@mysql.com-20101014084420-y54ecj85j5we27oa) (version source revid:martin.skold@mysql.com-20101014084420-y54ecj85j5we27oa) (merge vers: 5.1.51-ndb-6.2.19) (pib:21)
[14 Oct 2010 13:35] Jon Stephens
Already documented in the 5.1.50 changelog; no additional changelog entries required. Set back to Closed state.