Unable to compile for Solaris

Bug #1359386 reported by Scott Golby
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
percona-tools
New
Undecided
Unassigned

Bug Description

Makefile doesn't work on Solaris 10
aka
Does anyone know how to make tpcc-mysql compile on Solaris 10 ? :)

With some hackery to the Makefile such as I was able to get tpcc_load to work, but tpcc_start Seg Faults.
CC=/opt/csw/bin/gcc -m64
LDFLAGS=-m64

So I can load the Warehouse but can't test it. :( I tried a couple of the patches but no luck.

# ./tpcc_start -dtpcc1000 -uroot -pPW -w20 -c8 -r10 -l300
***************************************
*** ###easy### TPC-C Load Generator ***
***************************************
...
RAMP-UP TIME.(10 sec.)
Segmentation Fault (core dumped)

Below is a stack from one of the patched versions (sorry if it's misleading), but as you can see it still crashes even with 1 connection specified.

pstack core.tpcc_start.29972
core 'core.tpcc_start.29972' of 29972: ./tpcc_start -h127.0.0.1 -dtpcc1000 -uroot -pPW -w1 -c1 -r5 -l3
----------------- lwp# 1 / thread# 1 --------------------
 fffffd7ffeac244a ___nanosleep () + a
 00000000004092ca main () + 9aa
 00000000004030cc _start () + 6c
----------------- lwp# 2 / thread# 2 --------------------
 fffffd7ffed8a456 my_stat () + 3e
 fffffd7ffed5d294 my_read_charset_file () + 34
 fffffd7ffed5d836 init_available_charsets () + 22a
 fffffd7ffeaad859 pthread_once () + 79
 fffffd7ffed5de89 my_charset_get_by_name () + 31
 fffffd7ffed5df50 get_charset_by_csname () + 38
 fffffd7ffed22313 mysql_set_character_set_with_default_collation () + 3f
 fffffd7ffed223ec mysql_init_character_set () + 84
 fffffd7ffed23dec mysql_real_connect () + 82c
 0000000000403234 thread_main () + 64
 fffffd7ffeabd9db _thr_setup () + 5b
 fffffd7ffeabdc10 _lwp_start ()

This is the 1st crash when I was attempting to run 8 connections
core 'core.tpcc_start.20180' of 20180: ./tpcc_start -dtpcc1000 -uroot -PW -w20 -c8 -r10 -l300
----------------- lwp# 1 / thread# 1 --------------------
 fffffd7ffeac244a ___nanosleep () + a
 00000000004092ca main () + 9aa
 00000000004030cc _start () + 6c
----------------- lwp# 2 / thread# 2 --------------------
 fffffd7ffeabdc87 __lwp_park () + 17
 fffffd7ffeab66c8 mutex_lock_impl () + e8
 fffffd7ffeab67bb mutex_lock () + b
 fffffd7ffeaad816 pthread_once () + 36
 fffffd7ffed5de89 my_charset_get_by_name () + 31
 fffffd7ffed5df50 get_charset_by_csname () + 38
 fffffd7ffed22313 mysql_set_character_set_with_default_collation () + 3f
 fffffd7ffed223ec mysql_init_character_set () + 84
 fffffd7ffed23dec mysql_real_connect () + 82c
 0000000000403234 thread_main () + 64
 fffffd7ffeabd9db _thr_setup () + 5b
 fffffd7ffeabdc10 _lwp_start ()

Some machine details
# uname -a
SunOS ny-dcmysql06 5.10 Generic_147148-26 i86pc i386 i86pc

# more /etc/release
                    Oracle Solaris 10 8/11 s10x_u10wos_17b X86
  Copyright (c) 1983, 2011, Oracle and/or its affiliates. All rights reserved.
                            Assembled 23 August 2011

pre-Makefile hackery the error is
ld: fatal: file /opt/mysql/mysql/lib/libmysqlclient_r.so: wrong ELF class: ELFCLASS64

Thanks,
Scott

Revision history for this message
sbester (sbester) wrote :

I get this crash on solaris and linux. It is solved by calling mysql_init(NULL) in each thread instead of in the main thread.

Program terminated with signal 11, Segmentation fault.
#0 my_stat at ./mysys/my_lib.c:378
378 my_errno= errno;
(gdb) where
#0 my_stat at ./mysys/my_lib.c:378
#1 in my_read_charset_file at ./mysys/charset.c:422
#2 in init_available_charsets () at ./mysys/charset.c:511
#3 in pthread_once () from /lib64/libpthread.so.0
#4 in my_charset_get_by_name at ./mysys/charset.c:734
#5 in get_charset_by_csname at ./mysys/charset.c:755
#6 in mysql_set_character_set_with_default_collation (mysql=0x246e380) at ./sql-common/client.c:2880
#7 in mysql_init_character_set (mysql=0x246e380) at ./sql-common/client.c:2920
#8 in mysql_real_connect at ./sql-common/client.c:4499
#9 in thread_main (arg=<optimized out>) at main.c:680
#10 in start_thread () from /lib64/libpthread.so.0
#11 in clone () from /lib64/libc.so.6

Revision history for this message
sbester (sbester) wrote :
Revision history for this message
sbester (sbester) wrote :

Ah, with my patch, a call to my_library_init in the main function is still needed.
Actually all the guidelines are here:
https://dev.mysql.com/doc/refman/5.6/en/c-api-threaded-clients.html

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.