FS#65093 - [rocksdb] crashes with SIGILL, Illegal instruction, binary needs to be built portable

Attached to Project: Community Packages
Opened by Axel Gembe (ichundes) - Thursday, 09 January 2020, 10:55 GMT
Last edited by Anatol Pomozov (anatolik) - Thursday, 06 February 2020, 01:29 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Anatol Pomozov (anatolik)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

Description: The rocksdb package is not built portable, causing it to SIGILL on older processors that lack more modern instructions. -DPORTABLE=ON should be added to the cmake command line.


Additional info:
* Version 6.5.2-1
* Intel(R) Core(TM) i7-2720QM
* flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm epb pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid xsaveopt dtherm ida arat pln pts md_clear flush_l1d

Steps to reproduce:
Load the library into a process:

```
[ago@apollo fulcrum-git]$ gdb Fulcrum
GNU gdb (GDB) 8.3.1
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from Fulcrum...
(No debugging symbols found in Fulcrum)
(gdb) run
Starting program: /usr/bin/Fulcrum
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
/usr/lib/../share/gcc-9.2.0/python/libstdcxx/v6/xmethods.py:731: SyntaxWarning: list indices must be integers or slices, not str; perhaps you missed a comma?
refcounts = ['_M_refcount']['_M_pi']

Program received signal SIGILL, Illegal instruction.
0x00007ffff7a19e45 in rocksdb::LRUCache::LRUCache(unsigned long, int, bool, double, std::shared_ptr<rocksdb::MemoryAllocator>, bool) ()
from /usr/lib/librocksdb.so.6
(gdb) bt
#0 0x00007ffff7a19e45 in rocksdb::LRUCache::LRUCache(unsigned long, int, bool, double, std::shared_ptr<rocksdb::MemoryAllocator>, bool) ()
from /usr/lib/librocksdb.so.6
#1 0x00007ffff7a1a05b in rocksdb::NewLRUCache(unsigned long, int, bool, double, std::shared_ptr<rocksdb::MemoryAllocator>, bool) ()
from /usr/lib/librocksdb.so.6
#2 0x00007ffff7a1a1a2 in rocksdb::NewLRUCache(rocksdb::LRUCacheOptions const&) () from /usr/lib/librocksdb.so.6
#3 0x00007ffff7c45ded in rocksdb::BlockBasedTableFactory::BlockBasedTableFactory(rocksdb::BlockBasedTableOptions const&) () from /usr/lib/librocksdb.so.6
#4 0x00007ffff7c08655 in rocksdb::ColumnFamilyOptions::ColumnFamilyOptions() () from /usr/lib/librocksdb.so.6
#5 0x00007ffff79fdbe9 in ?? () from /usr/lib/librocksdb.so.6
#6 0x00007ffff7fe272a in call_init.part () from /lib64/ld-linux-x86-64.so.2
#7 0x00007ffff7fe2831 in _dl_init () from /lib64/ld-linux-x86-64.so.2
#8 0x00007ffff7fd413a in _dl_start_user () from /lib64/ld-linux-x86-64.so.2
#9 0x0000000000000001 in ?? ()
#10 0x00007fffffffe922 in ?? ()
#11 0x0000000000000000 in ?? ()
(gdb) quit
```

The library works for me using the attached PKGBUILD
This task depends upon

Closed by  Anatol Pomozov (anatolik)
Thursday, 06 February 2020, 01:29 GMT
Reason for closing:  Fixed
Additional comments about closing:  rocksdb-6.5.3-1
Comment by Axel Gembe (ichundes) - Thursday, 09 January 2020, 13:41 GMT
Maybe FORCE_SSE42=on should also be set
Comment by Eli Schwartz (eschwartz) - Sunday, 12 January 2020, 23:49 GMT
https://github.com/facebook/rocksdb/blob/afa2420c2bf0304a4b8796cab219e859146cc031/CMakeLists.txt#L228-L242

This package's upstream build system defines two silly variables that try to alternately either enforce sse4.2, or activate -march=native. This is an obvious problem when building software meant to run on 2 or more computers.
Comment by Anatol Pomozov (anatolik) - Monday, 13 January 2020, 01:43 GMT
rocksdb-6.5.3-1 just pushed to [testing], please verify that it works as expected.
Comment by Axel Gembe (ichundes) - Monday, 13 January 2020, 07:18 GMT
@anatolik the package works for me.

Loading...