LP #1329986: Build broken for Solaris with 5.6.17 rel66
Description
Environment
Smart Checklist
Activity

Kathy Williamson April 22, 2020 at 4:14 PM
MySQL 5.6 is scheduled for EOL in Feb 2021. At this time, we do not believe that this issue will be fixed prior to EOL. If you believe this issue is important enough to be be fixed prior to EOL, or that it also affects a later version, please leave a comment and we will consider the new information

lpjirasync January 24, 2018 at 7:20 AM
**Comment from Launchpad by: Valerii Kravchuk on: 16-06-2014 16:12:51
Code of Percona Server 5.5 looks more or less the same:
openxs@ao756:~/bzr/percona-5.5$ grep -ni alloca plugin/HandlerSocket-Plugin-for-MySQL/handlersocket/hstcpsvr_worker.cpp
142: /* FIXME: reallocate memory if too large */
768: string_ref *const flds = DENA_ALLOCA_ALLOCATE(string_ref, fldnum);
769: auto_alloca_free<string_ref> flds_autofree(flds);
888: string_ref *const uflds = DENA_ALLOCA_ALLOCATE(string_ref, num_uvals);
889: auto_alloca_free<string_ref> uflds_autofree(uflds);
openxs@ao756:~/bzr/percona-5.5$ grep -rn DENA_ALLOCA_ALLOCATE *
plugin/HandlerSocket-Plugin-for-MySQL/libhsclient/allocator.hpp:37:#define DENA_ALLOCA_ALLOCATE(typ, len) \
plugin/HandlerSocket-Plugin-for-MySQL/libhsclient/allocator.hpp:41:#define DENA_ALLOCA_ALLOCATE(typ, len) \
...
so I assume 5.5 is also affected.

lpjirasync January 24, 2018 at 7:20 AM
**Comment from Launchpad by: Valerii Kravchuk on: 16-06-2014 16:05:09
This is easy to confirm by code review. This is what we have in plugin/HandlerSocket-Plugin-for-MySQL/libhsclient/allocator.hpp
36 #if 1
37 #define DENA_ALLOCA_ALLOCATE(typ, len) \
38 static_cast<typ *>(alloca((len) * sizeof(typ)))
39 #define DENA_ALLOCA_FREE
40 #else
41 #define DENA_ALLOCA_ALLOCATE(typ, len) \
42 static_cast<typ *>(malloc((len) * sizeof(typ)))
43 #define DENA_ALLOCA_FREE free
44 #endif
and then:
openxs@ao756:~/bzr/percona-5.6$ grep -ni alloca plugin/HandlerSocket-Plugin-for-MySQL/handlersocket/hstcpsvr_worker.cpp
142: /* FIXME: reallocate memory if too large */
764: string_ref *const flds = DENA_ALLOCA_ALLOCATE(string_ref, fldnum);
765: auto_alloca_free<string_ref> flds_autofree(flds);
884: string_ref *const uflds = DENA_ALLOCA_ALLOCATE(string_ref, num_uvals);
885: auto_alloca_free<string_ref> uflds_autofree(uflds);
while it's a known problem on Solaris that alloca() is defined only in a separate alloca.h header, see http://bugs.python.org/issue1506 etc
Details
Details
Assignee
Reporter

Priority
Smart Checklist
Open Smart Checklist
Smart Checklist

**Reported in Launchpad by Peter Bakkum last update 24-03-2016 16:35:07
The build now fails for us on SmartOS machines with rel66. rel65 was ok for us. Machine details:
uname -a: SunOS 5.11 joyent_20140522T214546Z i86pc i386 i86pc Solaris
gcc --version: gcc (GCC) 4.7.3
This is the error we're seeing:
/root/mysqlpkg/percona-server-5.6.17-66.0/plugin/HandlerSocket-Plugin-for-MySQL/handlersocket/hstcpsvr_worker.cpp: In member function 'void dena::hstcpsvr_worker::do_exec_on_index(char*, char*, char*, char*, dena::hstcpsvr_conn&)':
/root/mysqlpkg/percona-server-5.6.17-66.0/plugin/HandlerSocket-Plugin-for-MySQL/handlersocket/hstcpsvr_worker.cpp:764:28: error: 'alloca' was not declared in this scope
make[2]: *** [plugin/HandlerSocket-Plugin-for-MySQL/CMakeFiles/handlersocket.dir/handlersocket/hstcpsvr_worker.cpp.o] Error 1
make[2]: Leaving directory `/root/mysqlpkg/percona-server-5.6.17-66.0/bld'
make[1]: *** [plugin/HandlerSocket-Plugin-for-MySQL/CMakeFiles/handlersocket.dir/all] Error 2
make[1]: Leaving directory `/root/mysqlpkg/percona-server-5.6.17-66.0/bld'
make: *** [all] Error 2
And this change appears to have resolved it for us:
— plugin/HandlerSocket-Plugin-for-MySQL/handlersocket/hstcpsvr_worker.cpp.old 2014-06-13 22:39:51.313290617 +0000
+++ plugin/HandlerSocket-Plugin-for-MySQL/handlersocket/hstcpsvr_worker.cpp 2014-06-13 22:30:29.828364349 +0000
@@ -14,6 +14,7 @@
#include <stdexcept>
#include <signal.h>
#include <list>
+#include <alloca.h>
#if _linux_
#include <sys/epoll.h>
#endif