Bug #42141 Compiler crash in "mf_format.c" when optimizing for 64 bit
Submitted: 15 Jan 2009 21:57 Modified: 2 Dec 2010 9:27
Reporter: Joerg Bruehe Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Server: Compiling Severity:S1 (Critical)
Version:5.0.72sp1 OS:HP/UX (11.11, HP-PA, 64 bit)
Assigned to: Kent Boortz CPU Architecture:Any

[15 Jan 2009 21:57] Joerg Bruehe
Description:
This symptom seems to be new in 5.0.72sp1,
I see corresponding packages for the previous versions.

For all configurations, the compiler crashes on module "mysys/mf_format.c".

I have been able to isolate it to this part:

> diff -C 6 mf_format.c.ORI mf_format.c
*** mf_format.c.ORI     Tue Jan 13 15:42:14 2009
--- mf_format.c Thu Jan 15 22:44:33 2009
***************
*** 94,113 ****
--- 94,123 ----
      (void) strmov(pos,ext);                   /* Don't convert extension */
    }
    /*
      If MY_RETURN_REAL_PATH and MY_RESOLVE_SYMLINK is given, only do
      realpath if the file is a symbolic link
    */
+
+ /* ERROR on HP-UX 11.11 using the native compiler version  aCC: HP ANSI C++ B3910B A.03.65
+    in 64 bit mode with flag +O2:
+    ANY condition below, even the trivial    ( (1 + 2) == 3 )
+    controlling a non-empty "then" or "else" branch,
+    will cause the compiler to crash internally with signal 11.
+ */
    if (flag & MY_RETURN_REAL_PATH)
+   {
      (void) my_realpath(to, to, MYF(flag & MY_RESOLVE_SYMLINKS ?
                                   MY_RESOLVE_LINK: 0));
+   }
    else if (flag & MY_RESOLVE_SYMLINKS)
    {
      strmov(buff,to);
      (void) my_readlink(to, buff, MYF(0));
    }
+
    DBUG_RETURN(to);
  } /* fn_format */

        /*
          strlength(const string str)

This is the compiler call:
        source='mf_format.c' object='mf_format.o' libtool=no \
        DEPDIR=.deps depmode=hp /bin/sh ../depcomp \
        cc -DDEFAULT_BASEDIR=\"/usr/local/mysql\"  -DDATADIR="\"/usr/local/mysql/data\""  -DDEFAULT_CHARSET_HOME="\"/usr/local/mysql\""  -DSHAREDIR="\"/usr/local/mysql/share/mysql\""  -DDEFAULT_HOME_ENV=MYSQL_HOME  -DDEFAULT_GROUP_SUFFIX_ENV=MYSQL_GROUP_SUFFIX  -DDEFAULT_SYSCONFDIR="\"/usr/local/mysql/etc\""  -DHAVE_CONFIG_H -I. -I../include -I../zlib -I../include  -I../include -I.     -DDBUG_OFF -g +O2 +DD64   -DHPUX11  -DSNPRINTF_RETURN_TRUNC -DHAVE_BROKEN_PREAD -DDONT_USE_FINITE -DHAVE_BROKEN_GETPASS -DNO_FCNTL_NONBLOCK -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT -DHAVE_BROKEN_INLINE -c mf_format.c
cc: error 1405: "/tmp/ansic/lbin/ccom" terminated abnormally with signal 11.
*** Error exit code 9

How to repeat:
Try to build it.

Suggested fix:
Check the differences between 5.0.72 (worked), 5.0.72sp1 (fails), and 5.0.74 (worked).
When I created the sources for 5.0.72sp1, I took 4 showstopper bugs from 5.0.74 and backported them onto the 5.0.72 sources, all these merges succeeded without any issues.

Also, I am not aware of any significant build or test issues on any other platform (yet).
[2 Dec 2010 9:27] Kent Boortz
Platform is not supported any more, see

http://www.mysql.com/support/supportedplatforms/database.html