Bug #67133 mysql fails on OSX Symbol not found: _strnlen
Submitted: 8 Oct 2012 12:34 Modified: 28 Jul 2013 17:07
Reporter: T H Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S2 (Serious)
Version:5.6.7 RC OS:MacOS (10.6.8)
Assigned to: CPU Architecture:Any

[8 Oct 2012 12:34] T H
Description:
When running mysql client I get this error:

$ mysql
dyld: lazy symbol binding failed: Symbol not found: _strnlen
  Referenced from: /usr/local/mysql/bin/mysql
  Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: _strnlen
  Referenced from: /usr/local/mysql/bin/mysql
  Expected in: /usr/lib/libSystem.B.dylib

Version 5.5.28 worked (but I can't use it because it doesn't support full text search on InnoDB). Both versions I installed are 64-bit. The only difference is the MySQL version.

Very frustrating. The server runs fine by the way, but of course I have no way to access it.

How to repeat:
Install MySQL 5.6.7 on OSX 10.6.8.
[8 Oct 2012 13:58] MySQL Verification Team
Hi,

I have tried 5.6.7-rc, both server and client and they both work just fine. Both executables are 64-bit, as is proven here:

 file ./razno/work/repo/mysql-5.6.7-rc/client/mysql
./razno/work/repo/mysql-5.6.7-rc/client/mysql: Mach-O 64-bit executable x86_64

Try building entire tree from scratch, by untarring source tree again, with this command (in mysql root directory):

./BUILD/compile-pentium-debug-max-no-ndb  

Also, make sure you have got correct versions of CMake, CXX etc , as per our documentation.
[8 Oct 2012 14:03] T H
Weird. Which version of OSX are you using? Can we try some more basic debugging first, e.g. does your libSystem contain _strnlen? I think you can do it with this command: otool -IV /usr/lib/libSystem.B.dylib | grep _strnlen

If it's there I'd guess the problem is caused by building the newer binaries against OSX 10.7 or 10.8.
[8 Oct 2012 15:29] MySQL Verification Team
My OS X is Snow Leopard.

And, no, there is no _strnlen in my OS' libraries either .... I ran that command .... Here is the output from the same command, but with '... | grep strn':

otool -IV /usr/lib/libSystem.B.dylib | grep strnlen
[sinisa@local ~]$ otool -IV /usr/lib/libSystem.B.dylib | grep strn   
0x000000000014150e  4701 ___strncat_chk
0x0000000000142738  6910 _mig_strncpy
0x0000000000142e04  7750 _strncasecmp
0x0000000000142e0a  7751 _strncasecmp_l
0x0000000000142e10  7752 _strncat
0x0000000000142e16  7753 _strncmp
0x0000000000142e1c  7754 _strncpy
0x0000000000142e22  7755 _strnstr
0x00000000001c2c98  4701 ___strncat_chk
0x00000000001c44d0  6910 _mig_strncpy
0x00000000001c4de0  7750 _strncasecmp
0x00000000001c4de8  7751 _strncasecmp_l
[8 Oct 2012 15:44] T H
Hmm very strange. And you're definitely using mysql-5.6.7-rc-osx10.7-x.... wait a minute! 10.7!! Why did it even let me install? Stupid thing.

Well, this bug should be renamed "Installer doesn't warn you that your OS is too old for it to run properly."
[8 Oct 2012 18:55] MySQL Verification Team
What you are asking for is possible (theoretically) with .dmg files, but not with .tar.gz files ...

What did you use ???
[9 Nov 2012 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[18 Mar 2013 14:54] Shawn Bakhtiar
I can verify that it is possible to download the 10.7 > images to 10.6 and install it without warning.

Downloaded mysql-5.6.10-osx10.7-x86_64.dmg
ran though the install with no warnings.
When I tried to start from System Preferences panel it wouldn't.

opened up a terminal and executed:
/usr/local/mysql/bin/mysqladmin --help 

and got:

dyld: lazy symbol binding failed: Symbol not found: _strnlen

This may be a moot point, since I'm being forced by the evil apple to upgrade anyway :(
[29 Mar 2013 2:11] Waleed Basheer
Any update on this bug? Here are the errors that I'm getting:

yld: lazy symbol binding failed: Symbol not found: _strnlen
  Referenced from: /usr/local/mysql/bin/mysqladmin
  Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: _strnlen
  Referenced from: /usr/local/mysql/bin/mysqladmin
  Expected in: /usr/lib/libSystem.B.dylib

Trace/BPT trap
[13 Apr 2013 17:59] davinder bains
FACING THE SAME ISSUE:::::

dyld: lazy symbol binding failed: Symbol not found: _strnlen
  Referenced from: /usr/local/mysql-5.6.10-osx10.7-x86_64/bin/my_print_defaults
  Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: _strnlen
  Referenced from: /usr/local/mysql-5.6.10-osx10.7-x86_64/bin/my_print_defaults
  Expected in: /usr/lib/libSystem.B.dylib

dyld: lazy symbol binding failed: Symbol not found: _strnlen
  Referenced from: /usr/local/mysql-5.6.10-osx10.7-x86_64/bin/my_print_defaults
  Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: _strnlen
  Referenced from: /usr/local/mysql-5.6.10-osx10.7-x86_64/bin/my_print_defaults
  Expected in: /usr/lib/libSystem.B.dylib
[16 Apr 2013 15:46] MySQL Verification Team
Please try 5.6.10. I can't repeat:

12:44:02][pochita:]~ miguel$ mysqladmin --help
mysqladmin  Ver 8.42 Distrib 5.6.10, for osx10.7 on x86_64
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
[16 Apr 2013 16:04] davinder bains
i am using mysql-5.6.10 only.
what are you referring to ?
[28 Jul 2013 4:45] MySQL Verification Team
I couldn't repeat with 5.6.12 running on OS X 10.8.4 Mountain Lion.
[7 Aug 2013 21:26] Robert Hutzel
Confirmed that running the mysql client binary 5.6.13 32-bit and 5.6.13 64-bit on fully-patched Mac OS X 10.6.8 both fail with this error:

dyld: lazy symbol binding failed: Symbol not found: _strnlen
  Referenced from: /Users/bob/dev/mysql/bin/mysql
  Expected in: /usr/lib/libSystem.B.dylib

However, mysql 5.5.33 64-bit runs fine on the same OS.