Dear Maintainer,
I tried to reproduce inside a minimal Buster i386 qemu VM
and received also an "Illegal instruction" message.

It looks like it tries to execute an AVX instruction that
my CPU should support, but is not enabled inside the VM.

The usage of AVX might originate from the compiler
flag "-march=native".
This might be added in configure.ac, lines 149 or 163.

The solution could be to just add this configure flag:
-CONF_O=--bindir=/usr/games --disable-silent-rules --enable-speech
+CONF_O=--bindir=/usr/games --disable-silent-rules --enable-speech 
--enable-generic-architecture

Then these flags get used instead:
  -mtune=generic -mfpmath=sse -msse -msse2
Do these also violate the i386 Buster baseline?

Kind regards,
Bernhard


(gdb) bt
#0  0x005eec8f in std::vector<SCP_vector<unsigned int>, 
std::allocator<SCP_vector<unsigned int> > >::operator[] (this=<optimized out>, 
__n=<optimized out>) at /usr/include/c++/7/bits/stl_vector.h:798
#1  factor_table::resize (this=0xce84d8 <ftables>, size=6) at 
io/keycontrol.cpp:159
#2  0x005eed94 in factor_table::factor_table (this=0xce84d8 <ftables>, size=6) 
at io/keycontrol.cpp:112
#3  0x00448a8e in __static_initialization_and_destruction_0 (__priority=65535, 
__initialize_p=1) at io/keycontrol.cpp:171
#4  _GLOBAL__sub_I__ZN12factor_tableC2Ej () at io/keycontrol.cpp:2912
#5  0x00952f8b in __libc_csu_init ()
#6  0xb761dad3 in __libc_start_main (main=0x43c4f0 <main(int, char**)>, argc=1, 
argv=0xbf8b8554, init=0x952f40 <__libc_csu_init>, fini=0x952fa0 
<__libc_csu_fini>, rtld_fini=0xb7ef4520 <_dl_fini>, stack_end=0xbf8b854c) at 
../csu/libc-start.c:264
#7  0x0046c58b in _start ()

(gdb) display/i $pc
1: x/i $pc
=> 0x5eec8f <factor_table::resize(unsigned int)+591>:   vmovd  %ebx,%xmm2
# Buster/stable i386 qemu VM 2019-12-07

# enable non-free

apt update
apt dist-upgrade

apt install systemd-coredump xserver-xorg sddm openbox xterm mc fakeroot gdb 
freespace2 freespace2-dbgsym libstdc++-7-dev
apt build-dep freespace2


reboot




mkdir /home/benutzer/source/freespace2/orig -p
cd    /home/benutzer/source/freespace2/orig
apt source freespace2
cd




export DISPLAY=:0
/usr/games/fs2_open
catchsegv /usr/games/fs2_open


coredumpctl list
coredumpctl gdb [PID]

set width 0
set pagination off
directory /home/benutzer/source/freespace2/orig/freespace2-3.7.4+repack/code
bt
display/i $pc





###########


benutzer@debian:~$ /usr/games/fs2_open
Ungültiger Maschinenbefehl (Speicherabzug geschrieben)

benutzer@debian:~$ catchsegv /usr/games/fs2_open
Illegal instruction (core dumped)

benutzer@debian:~$ /usr/games/fs2_open_DEBUG 
Ungültiger Maschinenbefehl (Speicherabzug geschrieben)

benutzer@debian:~$ catchsegv /usr/games/fs2_open_DEBUG 
Illegal instruction (core dumped)


###########


dmesg:
[  219.663592] traps: fs2_open[883] trap invalid opcode ip:684c8f sp:bf9bce50 
error:0 in fs2_open_3.7.4[4d0000+51a000]
[  226.887618] traps: fs2_open[891] trap invalid opcode ip:5d4c8f sp:bfbbbcc0 
error:0 in fs2_open_3.7.4[420000+51a000]
[  473.081117] traps: fs2_open_DEBUG[1059] trap invalid opcode ip:69bc0f 
sp:bfaecb20 error:0 in fs2_open_3.7.4_DEBUG[4cb000+571000]
[  502.160726] traps: fs2_open_DEBUG[1075] trap invalid opcode ip:5f1c0f 
sp:bfd2c050 error:0 in fs2_open_3.7.4_DEBUG[421000+571000]


###########


root@debian:~# coredumpctl list
TIME                            PID   UID   GID SIG COREFILE  EXE
Sat 2019-12-07 13:34:07 CET     883  1000  1000   4 present   
/usr/games/fs2_open_3.7.4
Sat 2019-12-07 13:34:15 CET     891  1000  1000   4 present   
/usr/games/fs2_open_3.7.4
Sat 2019-12-07 13:38:21 CET    1059  1000  1000   4 present   
/usr/games/fs2_open_3.7.4_DEBUG
Sat 2019-12-07 13:38:50 CET    1075  1000  1000   4 present   
/usr/games/fs2_open_3.7.4_DEBUG


root@debian:~# coredumpctl gdb 1140       
           PID: 1140 (fs2_open)
           UID: 1000 (benutzer)
           GID: 1000 (benutzer)
        Signal: 4 (ILL)
     Timestamp: Sat 2019-12-07 13:53:45 CET (6min ago)
  Command Line: /usr/games/fs2_open
    Executable: /usr/games/fs2_open_3.7.4
 Control Group: /user.slice/user-1000.slice/session-6.scope
          Unit: session-6.scope
         Slice: user-1000.slice
       Session: 6
     Owner UID: 1000 (benutzer)
       Boot ID: 7a7eca3571374b3ca58ef7f657194b9c
    Machine ID: 45f49504b47f4e5690bc479adf67aa5b
      Hostname: debian
       Storage: 
/var/lib/systemd/coredump/core.fs2_open.1000.7a7eca3571374b3ca58ef7f657194b9c.1140.1575723225000000.lz4
       Message: Process 1140 (fs2_open) of user 1000 dumped core.
                
                Stack trace of thread 1140:
                #0  0x00000000005eec8f _ZNSt6vectorI10SCP_vectorIjESaIS1_EEixEj 
(fs2_open_3.7.4)
                #1  0x00000000005eed94 _ZN12factor_tableC2Ej (fs2_open_3.7.4)
                #2  0x0000000000448a8e 
__static_initialization_and_destruction_0 (fs2_open_3.7.4)
                #3  0x0000000000952f8b __libc_csu_init (fs2_open_3.7.4)
                #4  0x00000000b761dad3 __libc_start_main (libc.so.6)
                #5  0x000000000046c58b _start (fs2_open_3.7.4)

GNU gdb (Debian 8.2.1-2+b3) 8.2.1
Copyright (C) 2018 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 "i686-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 /usr/games/fs2_open_3.7.4...Reading symbols from 
/usr/lib/debug/.build-id/38/ec7cda2987888751f9122a8d38d93c67541538.debug...done.
done.

warning: core file may not match specified executable file.
[New LWP 1140]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".
Core was generated by `/usr/games/fs2_open'.
Program terminated with signal SIGILL, Illegal instruction.
#0  0x005eec8f in std::vector<SCP_vector<unsigned int>, 
std::allocator<SCP_vector<unsigned int> > >::operator[] (this=<optimized out>, 
__n=<optimized out>) at /usr/include/c++/7/bits/stl_vector.h:798

warning: Source file is more recent than executable.
798             return *(this->_M_impl._M_start + __n);
(gdb) set width 0
(gdb) set pagination off
(gdb) directory 
/home/benutzer/source/freespace2/orig/freespace2-3.7.4+repack/code
Source directories searched: 
/home/benutzer/source/freespace2/orig/freespace2-3.7.4+repack/code:$cdir:$cwd

(gdb) bt
#0  0x005eec8f in std::vector<SCP_vector<unsigned int>, 
std::allocator<SCP_vector<unsigned int> > >::operator[] (this=<optimized out>, 
__n=<optimized out>) at /usr/include/c++/7/bits/stl_vector.h:798
#1  factor_table::resize (this=0xce84d8 <ftables>, size=6) at 
io/keycontrol.cpp:159
#2  0x005eed94 in factor_table::factor_table (this=0xce84d8 <ftables>, size=6) 
at io/keycontrol.cpp:112
#3  0x00448a8e in __static_initialization_and_destruction_0 (__priority=65535, 
__initialize_p=1) at io/keycontrol.cpp:171
#4  _GLOBAL__sub_I__ZN12factor_tableC2Ej () at io/keycontrol.cpp:2912
#5  0x00952f8b in __libc_csu_init ()
#6  0xb761dad3 in __libc_start_main (main=0x43c4f0 <main(int, char**)>, argc=1, 
argv=0xbf8b8554, init=0x952f40 <__libc_csu_init>, fini=0x952fa0 
<__libc_csu_fini>, rtld_fini=0xb7ef4520 <_dl_fini>, stack_end=0xbf8b854c) at 
../csu/libc-start.c:264
#7  0x0046c58b in _start ()

(gdb) display/i $pc
1: x/i $pc
=> 0x5eec8f <factor_table::resize(unsigned int)+591>:   vmovd  %ebx,%xmm2

(gdb) print/x $ebx
$1 = 0x1

(gdb) print $xmm2
$2 = {v4_float = {0, 0, 0, 0}, v2_double = {0, 0}, v16_int8 = {0 <repeats 16 
times>}, v8_int16 = {0, 0, 0, 0, 0, 0, 0, 0}, v4_int32 = {0, 0, 0, 0}, v2_int64 
= {0, 0}, uint128 = 0}

(gdb) disassemble /r $pc-23,$pc+20
Dump of assembler code from 0x5eec78 to 0x5eeca3:
   0x005eec78 <factor_table::resize(unsigned int)+568>: 89 eb   mov    %ebp,%ebx
   0x005eec7a <factor_table::resize(unsigned int)+570>: c7 44 24 18 01 00 00 00 
movl   $0x1,0x18(%esp)
   0x005eec82 <factor_table::resize(unsigned int)+578>: 83 c3 01        add    
$0x1,%ebx
   0x005eec85 <factor_table::resize(unsigned int)+581>: 0f 84 97 00 00 00       
je     0x5eed22 <factor_table::resize(unsigned int)+738>
   0x005eec8b <factor_table::resize(unsigned int)+587>: 8d 6c 6d 00     lea    
0x0(%ebp,%ebp,2),%ebp
=> 0x005eec8f <factor_table::resize(unsigned int)+591>: c5 f9 6e d3     vmovd  
%ebx,%xmm2
   0x005eec93 <factor_table::resize(unsigned int)+595>: b9 01 00 00 00  mov    
$0x1,%ecx
   0x005eec98 <factor_table::resize(unsigned int)+600>: c5 f9 d6 54 24 08       
vmovq  %xmm2,0x8(%esp)
   0x005eec9e <factor_table::resize(unsigned int)+606>: c1 e5 02        shl    
$0x2,%ebp
   0x005eeca1 <factor_table::resize(unsigned int)+609>: df 6c 24 08     fildll 
0x8(%esp)
End of assembler dump.

(gdb) list
793            */
794           reference
795           operator[](size_type __n) _GLIBCXX_NOEXCEPT
796           {
797             __glibcxx_requires_subscript(__n);
798             return *(this->_M_impl._M_start + __n);
799           }
800
801           /**
802            *  @brief  Subscript access to the data contained in the %vector.

(gdb) up
#1  factor_table::resize (this=0xce84d8 <ftables>, size=6) at 
io/keycontrol.cpp:159
159                                     _lookup[i].push_back(j);
(gdb) list
154             {
155                     for (size_t j = 1; j <= i + 1; ++j)
156                     {
157                             if (isNaturalNumberFactor(j, i + 1))
158                             {
159                                     _lookup[i].push_back(j);
160                             }
161                     }
162             }
163     }
(gdb)






# https://www.felixcloutier.com/x86/movd:movq




-CONF_O=--bindir=/usr/games --disable-silent-rules --enable-speech
+CONF_O=--bindir=/usr/games --disable-silent-rules --enable-speech 
--enable-generic-architecture

Reply via email to