[MDEV-8285] compile fails under Mac OS X 10.6.8 due to use of strnlen Created: 2015-06-08  Updated: 2015-06-14  Resolved: 2015-06-14

Status: Closed
Project: MariaDB Server
Component/s: Compiling
Affects Version/s: 10.0.19-galera, 10.1.4
Fix Version/s: 10.0.20

Type: Bug Priority: Major
Reporter: Bjarne D Mathiesen Assignee: Sergei Golubchik
Resolution: Fixed Votes: 0
Labels: None
Environment:

I've got 2 older Mac Mini systems I'm using as headless servers:

#=> system_profiler SPHardwareDataType SPSoftwareDataType
Hardware:
Hardware Overview:
Model Name : Mac mini Mac mini
Model Identifier: Macmini2,1 Macmini1,1
Processor Name : Intel Core 2 Duo Intel Core Duo
Processor Speed : 1,83 GHz 1,83 GHz
Number Of Processors : 1 1
Total Number Of Cores : 2 2
L2 Cache : 2 MB 2 MB
Memory : 2 GB 2 GB
Bus Speed : 667 MHz 667 MHz
Boot ROM Version: MM21.009A.B00 MM11.0055.B08
SMC Version (system) : 1.19f2 1.3f4

Software:
System Software Overview:
System Version : Mac OS X 10.6.8 (10K549) Mac OS X 10.6.8 (10K549)
Kernel Version : Darwin 10.8.0 Darwin 10.8.0
Boot Mode : Normal Normal
Secure Virtual Memory : Not Enabled Not Enabled
64-bit Kernel and Extensions: No No


Sprint: 10.0.20

 Description   

We had a discussion on the macports developer mailing list & this is the conclusion:

The mariadb build failures are easy: they're failing because strnlen is not defined. This is correct: strnlen was not part of OS X until 10.7. You should report this problem to the developers of mariadb. They need to either avoid using strnlen, or else provide an implementation of it when the OS does not.



 Comments   
Comment by Elena Stepanova [ 2015-06-08 ]

Is 10.6 even supported still?
I can't find any EOL policy from Apple (and as I understand from some sources, it doesn't seem to have one), but 10.6 is almost 6 years old and is currently n-4, so I have my doubts.

Comment by Bjarne D Mathiesen [ 2015-06-08 ]

10.6 is EOL from Apple ; but it's my impression that many - like me - are still using it on older hardware - in part due to the fact that 10.6 is considered one of the most stable releases of the OS. 10.6 - and older - are still supported by the community through eg macports.

So it's a question of whether MariaDB wants to address this problem - or - just says 'wontfix'

Comment by Elena Stepanova [ 2015-06-09 ]

I would vote against supporting an alternative (or non-optimal, if that's what getting rid of strnlen would mean) implementation just for an EOL-ed version of OS X; but maybe there is a solution from which even modern versions could benefit – assigning to serg for consideration and final decision.

Comment by Sergei Golubchik [ 2015-06-09 ]

We already have a configure-time check that detects system stnlen and our internal strnlen implementation in strings/strnlen.c that is used if the system one is not available.

I don't know why it fails in this particular case, may be something in 10.6.8 or macports fools the configure-time check?

Comment by Bjarne D Mathiesen [ 2015-06-09 ]

you can find the compile logs here : [#http://www.mathiesen.info/macports/]

Comment by Ryan Carsten Schmidt [ 2015-06-09 ]

The configure check works fine. It correctly determines that the OS does not provide strnlen and compiles your implementation. The problem is that sometime between version 10.1.0 and 10.1.4, an invocation of strnlen was added to storage/connect/xobject.cpp, but the corresponding #include to include your implementation if needed was not also added. Not sure whether it should be #include "strings_def.h" or #include "m_string.h".

Comment by Sergei Golubchik [ 2015-06-09 ]

Ah, great, thanks ryandesign. I think that should be enough for me to fix it.

Generated at Thu Feb 08 07:26:00 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.