Bug #42512 The socket path ca not be longer than 107 characters
Submitted: 1 Feb 2009 10:47 Modified: 4 Feb 2009 17:06
Reporter: Serge Kozlov Email Updates:
Status: Closed Impact on me:
None 
Category:Tools: MTR / mysql-test-run Severity:S7 (Test Cases)
Version:5.1+ OS:Any
Assigned to: Magnus Blåudd CPU Architecture:Any
Tags: pushbuild2, socket path

[1 Feb 2009 10:47] Serge Kozlov
Description:
Path to socket can not be longer than 107 characters:

090201  9:24:47 [ERROR] The socket file path is too long (> 107): /export/home/pb2/build/sb_0-None-1233450986.71/mysql-5.1-bugteam-gcov/mysql-test/var/tmp/mysqld.1.slave.sock
090201  9:24:47 [ERROR] Aborting

Also manual for 5.1/6.0 has no information about that limitation.

How to repeat:
Use --socket option that will point to long path > 107 characters
[3 Feb 2009 7:11] Daniel Fischer
Setting category to MTR. Background:

A Unix domain socket is a socket that is bound to a file on disk. The pathname of that file acts as an identifier for the socket in a similar fashion as an interface address plus a port. Because there is a size limit for these addresses, only path names up to a certain length may be used. Since Unix domain sockets look like ordinary files, they are often confused with ordinary files, but the rules are different and attempting to create a socket in some random place like an ordinary file is a bug.

Suggested fix: Use TMPDIR, TEMP or a sensible preset in this order to find a useable location for a Unix domain socket.

NB: The limit is 108 bytes on Solaris, Linux and Cygwin. On most other systems, it's less.
[4 Feb 2009 10:43] Magnus Blåudd
This is fixed in mtr.pl v2 by creating a test socket in the automatically created tmpdir in $var/tmp, if that check fails a new tmpdir will be created using perl's tempdir function which defaults to TEMPDIR in most cases and thus we will get a shorter path. 

If mtr.pl is invoked with a fixed tmpdir using the --tmpdir switch, the parameter will simply be checked and no tempdir created on the fly.
[4 Feb 2009 17:06] Paul DuBois
Test suite change. No changelog entry needed.