[MDEV-14902] Crash while building TokuDB on Fedora 27 Created: 2018-01-09  Updated: 2018-07-16  Resolved: 2018-07-16

Status: Closed
Project: MariaDB Server
Component/s: Compiling, Storage Engine - TokuDB
Affects Version/s: 10.2
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Valerii Kravchuk Assignee: Unassigned
Resolution: Not a Bug Votes: 0
Labels: compile, tokudb
Environment:

[openxs@fc23 server]$ uname -a
Linux fc23 4.14.8-300.fc27.x86_64 #1 SMP Wed Dec 20 19:00:18 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
[openxs@fc23 server]$ gcc --version
gcc (GCC) 7.2.1 20170915 (Red Hat 7.2.1-2)
...
[openxs@fc23 server]$ free
total used free shared buff/cache available
Mem: 8139128 372864 1927988 86692 5838276 7320744
Swap: 0 0 0



 Description   

I get segmentation fault while linking libtokuportability_static_conv.a:

[ 74%] Building CXX object storage/spider/CMakeFiles/spider.dir/hs_client/string_util.cpp.o
[ 74%] Linking CXX shared module ha_spider.so
[ 74%] Built target spider
Scanning dependencies of target test_sql_discovery
[ 74%] Building CXX object storage/test_sql_discovery/CMakeFiles/test_sql_discovery.dir/test_sql_discovery.cc.o
[ 74%] Linking CXX shared module ha_test_sql_discovery.so
[ 74%] Built target test_sql_discovery
[ 74%] Linking CXX static library libtokuportability_static_conv.a
Error running link command: Segmentation fault
make[2]: *** [storage/tokudb/PerconaFT/portability/CMakeFiles/tokuportability_static_conv.dir/build.make:330: storage/tokudb/PerconaFT/portability/libtokuportability_static_conv.a] Error 1
make[1]: *** [CMakeFiles/Makefile2:7743: storage/tokudb/PerconaFT/portability/CMakeFiles/tokuportability_static_conv.dir/all] Error 2
make: *** [Makefile:163: all] Error 2

It happened to me last week and still happens with current code:

[openxs@fc23 server]$ git branch
* 10.3
[openxs@fc23 server]$ git log -1
commit fe79ac5b0e48395e55a4fb78196198b8542cc3d5 (HEAD -> 10.3, origin/HEAD, origin/10.3)
Author: Marko Mäkelä <marko.makela@mariadb.com>
Date:   Tue Jan 9 13:45:39 2018 +0200
 
    MDEV-14837 Duplicate primary keys are allowed after ADD COLUMN / UPDATE
 
    This bug affected tables where the PRIMARY KEY contains variable-length
    columns, and ROW_FORMAT is COMPACT or DYNAMIC.
 
    rec_init_offsets_comp_ordinary(): Do not short-cut the parsing
    of the record header for records that contain explicit values
    for instantly added columns.
 
    rec_copy_prefix_to_buf(): Copy more header for records that
    contain explicit values for instantly added columns.

cmake command line was (from fc -l):

1001     git pull
1002     git submodule update
1003     make clean
1004     ls -l CMake*.txt
1005     rm CMakeCache.txt
1006     cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DWITH_SSL=system -DWITH_ZLIB=bundled -DENABLED_LOCAL_INFILE=1 -DWITH_JEMALLOC=system -DWITH_WSREP=ON -DWITH_INNODB_DISALLOW_WRITES=ON -DPLUGIN_MROONGA=NO -DCMAKE_INSTALL_PREFIX=/home/openxs/dbs/maria10.3
1007     time make -j 4
1008     make

make -j 4 failed with MyRocks, but it may be a topic for other bug report...



 Comments   
Comment by Valerii Kravchuk [ 2018-01-09 ]

I was able to build after disabling tokudb:

1020     rm CMakeCache.txt
1021     cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DWITH_SSL=system -DWITH_ZLIB=bundled -DENABLED_LOCAL_INFILE=1 -DWITH_JEMALLOC=system -DWITH_WSREP=ON -DWITH_INNODB_DISALLOW_WRITES=ON -DPLUGIN_MROONGA=NO -DWITHOUT_TOKUDB=1 -DCMAKE_INSTALL_PREFIX=/home/openxs/dbs/maria10.3
1022     make
1023     make install && make clean

Comment by Elena Stepanova [ 2018-01-09 ]

It appears that buildbot's Fedora 27 builds 10.3 fine, including TokuDB:
http://buildbot.askmonty.org/buildbot/builders/kvm-rpm-fedora27-amd64/builds/145/steps/compile/logs/stdio

[  9%] Linking CXX static library libtokuportability_static_conv.a
cd /home/buildbot/buildbot/padding_for_CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX/mariadb-10.3.4/storage/tokudb/PerconaFT/portability && /usr/bin/cmake -P CMakeFiles/tokuportability_static_conv.dir/cmake_clean_target.cmake
cd /home/buildbot/buildbot/padding_for_CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX/mariadb-10.3.4/storage/tokudb/PerconaFT/portability && /usr/bin/cmake -E cmake_link_script CMakeFiles/tokuportability_static_conv.dir/link.txt --verbose=1
/usr/bin/gcc-ar qc libtokuportability_static_conv.a  CMakeFiles/tokuportability_static_conv.dir/huge_page_detection.cc.o CMakeFiles/tokuportability_static_conv.dir/file.cc.o CMakeFiles/tokuportability_static_conv.dir/memory.cc.o CMakeFiles/tokuportability_static_conv.dir/os_malloc.cc.o CMakeFiles/tokuportability_static_conv.dir/portability.cc.o CMakeFiles/tokuportability_static_conv.dir/toku_assert.cc.o CMakeFiles/tokuportability_static_conv.dir/toku_crash.cc.o CMakeFiles/tokuportability_static_conv.dir/toku_path.cc.o CMakeFiles/tokuportability_static_conv.dir/toku_pthread.cc.o CMakeFiles/tokuportability_static_conv.dir/toku_time.cc.o
/usr/bin/gcc-ranlib libtokuportability_static_conv.a
make[2]: Leaving directory '/home/buildbot/buildbot/padding_for_CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX/mariadb-10.3.4'
[  9%] Built target tokuportability_static_conv

Although of course it uses different cmake options.

Comment by Elena Stepanova [ 2018-01-10 ]

Builds with the same cmake options, too.

[buildbot@fedora27-amd64 10.3]$ uname -a
Linux fedora27-amd64 4.13.15-300.fc27.x86_64 #1 SMP Tue Nov 21 21:10:22 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
[buildbot@fedora27-amd64 10.3]$ gcc --version
gcc (GCC) 7.2.1 20170915 (Red Hat 7.2.1-2)

You have 4.14.8, it's the only difference that I see right away.

Comment by Elena Stepanova [ 2018-01-13 ]

Installed newest Fedora 27 from official downloads (4.14.13-300.fc27.x86_64), got the same segfault.

[ 78%] Built target spider
Scanning dependencies of target test_sql_discovery
[ 78%] Building CXX object storage/test_sql_discovery/CMakeFiles/test_sql_discovery.dir/test_sql_discovery.cc.o
[ 78%] Linking CXX shared module ha_test_sql_discovery.so
[ 78%] Built target test_sql_discovery
[ 78%] Linking CXX static library libtokuportability_static_conv.a
Error running link command: Segmentation fault
make[2]: *** [storage/tokudb/PerconaFT/portability/CMakeFiles/tokuportability_static_conv.dir/build.make:330: storage/tokudb/PerconaFT/portability/libtokuportability_static_conv.a] Error 1
make[1]: *** [CMakeFiles/Makefile2:7829: storage/tokudb/PerconaFT/portability/CMakeFiles/tokuportability_static_conv.dir/all] Error 2
make: *** [Makefile:163: all] Error 2

I have no idea what we can and/or should do about it, though. serg, any thoughts?

Same happens with 10.2, not just current, but for example 10.2.10. I didn't check other versions, but it doesn't look like it's related to any recent changes on our side.

Comment by Sergei Golubchik [ 2018-07-14 ]

I've just built 10.2 as of 1cc1d0429da14a041a6240c6fce17e0d31cad8e2 on fedora 27, using

cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DWITH_SSL=system -DWITH_ZLIB=bundled -DENABLED_LOCAL_INFILE=1 -DWITH_JEMALLOC=system -DWITH_WSREP=ON -DWITH_INNODB_DISALLOW_WRITES=ON -DPLUGIN_MROONGA=NO -DCMAKE_INSTALL_PREFIX=/home/openxs/dbs/maria10.3

and everything compiled just fine.
It was using gcc (GCC) 7.3.1 20180130 (Red Hat 7.3.1-2).

Comment by Elena Stepanova [ 2018-07-14 ]

serg, if you mean buildbot Fedora27 VM, it's not the latest, that's the point. It has 4.13.15-300.fc27.x86_64, and according to my comments above, there everything worked, but on 4.14.13-300.fc27.x86_64 I got the segfault.

Comment by Sergei Golubchik [ 2018-07-15 ]

Do you have any way for me to repeat/observe this? I've upgraded the VM (sudo dnf upgrade), but didn't get any crash either

Comment by Elena Stepanova [ 2018-07-15 ]

I tried that too, got the current is fedora27-amd64 4.17.5-100.fc27.x86_64, and it didn't crash to me either. It appears that the problem is gone on this version (I tried 10.2 server of the time when the crash was observed, so it's not changes in the code). I could try to find an image of 4.14.13-300, but I don't see much point in it.

valerii, can you confirm that it doesn't crash for you anymore on the recent Fedora 27?

Comment by Valerii Kravchuk [ 2018-07-16 ]

I was able to build current 10.2 successfully today:

...
[100%] Building CXX object extra/mariabackup/CMakeFiles/mariabackup.dir/encryption_plugin.cc.o
[100%] Building CXX object extra/mariabackup/CMakeFiles/mariabackup.dir/__/__/sql/net_serv.cc.o
[100%] Building C object extra/mariabackup/CMakeFiles/mariabackup.dir/__/__/libmysqld/libmysql.c.o
[100%] Linking CXX executable mariabackup
[100%] Built target mariabackup
 
real    24m24.436s
user    60m49.615s
sys     4m31.455s
[openxs@fc23 server]$ fc -l
...
997      sudo dnf update
998      cd git/server/
999      git branch
1000     git checkout 10.2
1001     git pull
1002     git submodule update
1003     rm CMakeCache.txt
1004     cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DWITH_SSL=system -DWITH_ZLIB=bundled -DENABLED_LOCAL_INFILE=1 -DWITH_JEMALLOC=system -DWITH_WSREP=ON -DWITH_INNODB_DISALLOW_WRITES=ON -DPLUGIN_MROONGA=NO -DCMAKE_INSTALL_PREFIX=/home/openxs/dbs/maria10.2
1005     time make -j 4
[openxs@fc23 server]$

Current kernel is a bit older (no reboot happened yet):

[openxs@fc23 server]$ gcc --version
gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
[openxs@fc23 server]$ uname -a
Linux fc23 4.17.3-100.fc27.x86_64 #1 SMP Tue Jun 26 14:19:03 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

But we can probably close this report as not repeatable with recent kernels any more.

Comment by Elena Stepanova [ 2018-07-16 ]

Closing as "not a bug" in the sense that apparently it wasn't a MariaDB code problem, see comments above.

Generated at Thu Feb 08 08:17:10 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.