Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AxRuntime (41.1) crashes on starting Wanderer on Debian Buster #63

Closed
magorium opened this issue Mar 9, 2022 · 14 comments
Closed

AxRuntime (41.1) crashes on starting Wanderer on Debian Buster #63

magorium opened this issue Mar 9, 2022 · 14 comments
Assignees
Labels
priority:default type:bug Something isn't working

Comments

@magorium
Copy link

magorium commented Mar 9, 2022

Starting Wanderer on a debian (stable 10 buster) derivative results in the following output:

<<INFO>>: AxRT 41.1
<<INFO>>: Using absolute paths.
<<INFO>>: AXRT_ROOT environment variable set
<<INFO>>: RUNTIME_ROOT: /home/magorium/bin/AXRT/
<<INFO>>: AXRTSYS     : ROOT:home/magorium/bin/AXRT/
<<INFO>>: USERSYS     : ROOT:home/magorium/.axrt/
Illegal instruction

gdb debug log:

Starting program: /home/magorium/bin/AXRT/System/Wanderer/Wanderer 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
<<INFO>>: AxRT 41.1
<<INFO>>: Using absolute paths.
<<INFO>>: AXRT_ROOT environment variable set
<<INFO>>: RUNTIME_ROOT: /home/magorium/bin/AXRT/
<<INFO>>: AXRTSYS     : ROOT:home/magorium/bin/AXRT/
<<INFO>>: USERSYS     : ROOT:home/magorium/.axrt/
[New Thread 0x7ffff7bc2700 (LWP 18829)]
[New Thread 0x7ffff6b3e700 (LWP 18830)]
[New Thread 0x7ffff633d700 (LWP 18831)]


Thread 2 "Exec bootstrap" received signal SIGILL, Illegal instruction.
[Switching to Thread 0x7ffff7bc2700 (LWP 18829)]
0x00007ffff7fbf2aa in _mm_set_epi8 (__q00=0 '\000', __q01=0 '\000', __q02=0 '\000', __q03=0 '\000', __q04=0 '\000', __q05=0 '\000', 
    __q06=0 '\000', __q07=0 '\000', __q08=0 '\000', __q09=0 '\000', __q10=0 '\000', __q11=0 '\000', __q12=0 '\000', __q13=0 '\000', 
    __q14=0 '\000', __q15=0 '\000') at /usr/lib/gcc/x86_64-linux-gnu/8/include/emmintrin.h:621
621     return __extension__ (__m128i)(__v16qi){

gdb backtrace:

#0  0x00007ffff7fbf2aa in _mm_set_epi8 (__q00=0 '\000', __q01=0 '\000', __q02=0 '\000', __q03=0 '\000', __q04=0 '\000', __q05=0 '\000', 
    __q06=0 '\000', __q07=0 '\000', __q08=0 '\000', __q09=0 '\000', __q10=0 '\000', __q11=0 '\000', __q12=0 '\000', __q13=0 '\000', 
    __q14=0 '\000', __q15=0 '\000') at /usr/lib/gcc/x86_64-linux-gnu/8/include/emmintrin.h:621
#1  _mm_set1_epi8 (__A=0 '\000') at /usr/lib/gcc/x86_64-linux-gnu/8/include/emmintrin.h:656
#2  Utility_66_SetMem_SSE (destination=0x7ffff00263c8, c=0 '\000', length=112) at /media/ramdisk/repo/AROS/arch/all-pc/utility/setmem_sse.c:70
#3  0x00007ffff7fb3b14 in __inline_Utility_SetMem (__arg1=0x7ffff00263c8, __arg2=0 '\000', __arg3=112, __UtilityBase=0x7ffff0025620)
    at /media/ramdisk/repo/alt-runtimelinux-x86_64-d/bin/runtimelinux-x86_64/AROS/Development/include/inline/utility.h:688
#4  0x00007ffff7fb3d99 in basemeta_new (cl=0x7ffff0025a50, o=0x7ffff00263c8, msg=0x7ffff7bc17c0)
    at /media/ramdisk/repo/AROS/rom/oop/./basemetaclass.c:446
#5  0x00007ffff7fb44c8 in basemeta_coercemethod (cl=0x7ffff0025b78, o=0x7ffff0025b78, msg=0x7ffff7bc17c0)
    at /media/ramdisk/repo/AROS/rom/oop/./basemetaclass.c:700
#6  0x00007ffff7fb4399 in basemeta_dosupermethod (cl=0x7ffff0025b78, o=0x7ffff0025b78, msg=0x7ffff7bc17c0)
    at /media/ramdisk/repo/AROS/rom/oop/./basemetaclass.c:665
#7  0x00007ffff7fb26b3 in ifmeta_new (cl=0x7ffff0025b78, o=0x7ffff0025b78, msg=0x7ffff7bc17c0)
    at /media/ramdisk/repo/AROS/rom/oop/./metaclass.c:90
#8  0x00007ffff7fb3702 in Meta_CoerceMethod (cl=0x7ffff0025b78, o=0x7ffff0025b78, msg=0x7ffff7bc17c0)
    at /media/ramdisk/repo/AROS/rom/oop/./metaclass.c:773
#9  0x00007ffff7faf51e in OOP_5_OOP_NewObject (classPtr=0x7ffff0025b78, classID=0x7ffff7fb8124 "mimetaclass", tagList=0x7ffff7bc1860)
    at /media/ramdisk/repo/AROS/rom/oop/./newobject.c:106
#10 0x00007ffff7fb12dd in __inline_OOP_OOP_NewObject (__arg1=0x0, __arg2=0x7ffff7fb8124 "mimetaclass", __arg3=0x7ffff7bc1860, 
    __OOPBase=0x7ffff0025850) at /media/ramdisk/repo/alt-runtimelinux-x86_64-d/bin/runtimelinux-x86_64/gen/rom/oop/oop/include/inline/oop.h:24
#11 0x00007ffff7fb1f39 in init_hiddmetaclass (OOPBase=0x7ffff0025850) at /media/ramdisk/repo/AROS/rom/oop/./hiddmetaclass.c:477
#12 0x00007ffff7faea46 in OOPInit (OOPBase=0x7ffff0025850) at /media/ramdisk/repo/AROS/rom/oop/./oop_init.c:88
#13 0x00007ffff7fb6ac9 in set_call_libfuncs (set=0x7ffff7fbc068, order=1, test_fail=1, libbase=0x7ffff0025850)
    at /media/ramdisk/repo/AROS/compiler/libinit/./libinit.c:77
#14 0x00007ffff7fae220 in OOP_InitLib (OOPBase=0x7ffff0025850, segList=0x0, sysBase=0x7ffff00017b0)
    at /media/ramdisk/repo/alt-runtimelinux-x86_64-d/bin/runtimelinux-x86_64/gen/rom/oop/oop/oop_start.c:242
#15 0x00007ffff73981af in Exec_17_InitResident (resident=0x7ffff7fae4e0 <OOP_ROMTag>, segList=0x0)
    at /media/ramdisk/repo/AROS/rom/exec/./initresident.c:127
#16 0x00007ffff7397c92 in __inline_Exec_InitResident (__arg1=0x7ffff7fae4e0 <OOP_ROMTag>, __arg2=0x0, __SysBase=0x7ffff00017b0)
    at /media/ramdisk/repo/alt-runtimelinux-x86_64-d/bin/runtimelinux-x86_64/AROS/Development/include/inline/exec.h:122
#17 0x00007ffff7397e0b in Exec_12_InitCode (startClass=1, version=0) at /media/ramdisk/repo/AROS/rom/exec/./initcode.c:95
#18 0x00007ffff7e14c3b in __inline_Exec_InitCode (__arg1=1, __arg2=0, __SysBase=0x7ffff00017b0)
    at /media/ramdisk/repo/alt-runtimelinux-x86_64-d/bin/runtimelinux-x86_64/AROS/Development/include/inline/exec.h:38
#19 0x00007ffff7e15707 in InitKickstart (SysBase=0x7ffff00017b0) at /media/ramdisk/repo/AROS/arch/all-runtime/axrt/startup/startup_lib.c:153
#20 0x00007ffff7e157a6 in InitRuntime (ptr=0x0) at /media/ramdisk/repo/AROS/arch/all-runtime/axrt/startup/startup_lib.c:168
#21 0x00007ffff7c17fa3 in start_thread (arg=<optimized out>) at pthread_create.c:486
#22 0x00007ffff7d2a4cf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Suggested workaround as mentioned on aros-exec forum (*) circumvents the crash.

(*) One workaround might be to go to AROS/arch/x86_64-all, delete utility directory there and rebuild.

@deadwood2 deadwood2 self-assigned this Mar 9, 2022
@deadwood2 deadwood2 added priority:high type:bug Something isn't working labels Mar 9, 2022
@deadwood2
Copy link
Owner

Suspected of misaligned stack together with SSE instructions. Output of lscpu

Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
Address sizes:       36 bits physical, 48 bits virtual
CPU(s):              4
On-line CPU(s) list: 0-3
Thread(s) per core:  2
Core(s) per socket:  2
Socket(s):           1
NUMA node(s):        1
Vendor ID:           GenuineIntel
CPU family:          6
Model:               37
Model name:          Intel(R) Core(TM) i3 CPU       M 370  @ 2.40GHz
Stepping:            5
CPU MHz:             1723.249
BogoMIPS:            4818.55
Virtualization:      VT-x
L1d cache:           32K
L1i cache:           32K
L2 cache:            256K
L3 cache:            3072K
NUMA node0 CPU(s):   0-3
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 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 popcnt lahf_lm pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid dtherm arat flush_l1d

@deadwood2
Copy link
Owner

Can you download this package: https://www.axrt.org/download/aros/v11/AROS-20211231-1-linux-x86_64-system.tar.bz2 and tell me if it crashes the same way when starting AROS?

Additional question: can you do "gcc --version" and paste here?

@magorium
Copy link
Author

Package downloaded and started. Seem to crash at the same location with same error. The bootstrap outputs:

[Bootstrap] RAM memory block allocated: 0x40486000 - 0x44486000 (67108864 bytes)
[Bootstrap] Entering kernel at 0x44486000...
[KRN] Protecting host process stack (0x00007ffcd91fc6e0 - 0x00007ffcd92066e0)
[KRN] Trap signal 4, SysBase 0000000041488830, KernelBase 0000000041489a58
    RSP=00007ffcd9206300  RBP=00007ffcd9206380  RIP=0000000044611cb3
    RAX=00000000414e40a8  RBX=00000000414d8670  RCX=00000000414e40b7  RDX=0000000000000070
    RDI=00000000414e40a8  RSI=0000000000000000  RFLAGS=0000000000010212
    R8 =0000000000000000  R9 =00000000414e39d0  R10=0000000000000098  R11=ffffffffffffffda
    R12=00000000414d8670  R13=00000000414e40a8  R14=00000000414e34f0  R15=00000000414e36f0

################################################################################
#                               Software Failure!                              #
#                Task : 0x00000000414C29E0 - Exec Bootstrap Task               #
#                    Error: 0x80000004 - Illegal instruction                   #
################################################################################
PC   : 0x0000000044611CB3
Module utility.library Segment 1 .text (0x0000000044611900) Offset 0x00000000000003B3
Function Utility_66_SetMem (0x0000000044611CA0) Offset 0x0000000000000013
CPU context:
RAX=00000000414E40A8  RBX=00000000414D8670  RCX=00000000414E40B7  RDX=0000000000000070
RSI=0000000000000000  RDI=00000000414E40A8  RSP=00007FFCD9206300  RBP=00007FFCD9206380
R8 =0000000000000000  R9 =00000000414E39D0  R10=0000000000000098  R11=FFFFFFFFFFFFFFDA
R12=00000000414D8670  R13=00000000414E40A8  R14=00000000414E34F0  R15=00000000414E36F0
RIP=0000000044611CB3  RSP=00007FFCD9206300  RFLAGS=0000000000010212
Stack trace:
0x000000004460BCE4 oop.library Segment 1 .text + 0x0000000000001E04
0x000000004460A6AE oop.library Function OOP_5_OOP_NewObject + 0x000000000000004E
0x000000004460BC8D oop.library Function init_hiddmetaclass + 0x00000000000001BD
0x000000004460A34B oop.library Segment 1 .text + 0x000000000000046B
0x000000004460DDFA oop.library Function set_call_libfuncs + 0x000000000000004A
0x000000004460A116 oop.library Function OOP_InitLib + 0x0000000000000176
0x0000000044491B52 kernel Function Exec_17_InitResident + 0x0000000000000162
0x00000000444919A9 kernel Function Exec_12_InitCode + 0x0000000000000109
0x00000000444864B8 kernel Function startup + 0x00000000000004B8
0x00007FFCD9206770 Invalid stack frame address

The bootstrap keeps repeating this over and over again. Therefore i do not have a gdb stacktrace that is helpful (as it traces back to the point where i pressed ctrl-c in order to stop the (error)loop.

gcc version reads:

gcc (Debian 8.3.0-6) 8.3.0

fwiw: in the compile log (from compiling axrt) i am able to locate a lot of messages reading:

Warning: setting incorrect section attributes for .text.romtag

@magorium
Copy link
Author

Accidently closed the issue

@magorium magorium reopened this Mar 10, 2022
@deadwood2
Copy link
Owner

Ok, so the problem is related to AROS core on your CPU, not to your system/compiler. I will investigate further.

@deadwood2 deadwood2 changed the title Title: axrt runtime (41.1) crashes on starting Wanderer on Debian Buster AxRuntime (41.1) crashes on starting Wanderer on Debian Buster Mar 10, 2022
@magorium
Copy link
Author

magorium commented Mar 12, 2022

here is disassembly from running wanderer with axrt

Dump of assembler code for function Utility_66_SetMem_SSE:
   0x00007ffff7fbf09c <+0>:	push   %rbp
   0x00007ffff7fbf09d <+1>:	mov    %rsp,%rbp
   0x00007ffff7fbf0a0 <+4>:	push   %r15
   0x00007ffff7fbf0a2 <+6>:	push   %r14
   0x00007ffff7fbf0a4 <+8>:	push   %r13
   0x00007ffff7fbf0a6 <+10>:	push   %rbx
   0x00007ffff7fbf0a7 <+11>:	sub    $0x140,%rsp
   0x00007ffff7fbf0ae <+18>:	lea    -0x7(%rip),%r14        # 0x7ffff7fbf0ae <Utility_66_SetMem_SSE+18>
   0x00007ffff7fbf0b5 <+25>:	movabs $0x8f52,%r11
   0x00007ffff7fbf0bf <+35>:	add    %r11,%r14
   0x00007ffff7fbf0c2 <+38>:	mov    %rdi,-0x138(%rbp)
   0x00007ffff7fbf0c9 <+45>:	mov    %esi,%eax
   0x00007ffff7fbf0cb <+47>:	mov    %edx,-0x140(%rbp)
   0x00007ffff7fbf0d1 <+53>:	mov    %al,-0x13c(%rbp)
   0x00007ffff7fbf0d7 <+59>:	mov    -0x138(%rbp),%r13
   0x00007ffff7fbf0de <+66>:	movzbl -0x13c(%rbp),%eax
   0x00007ffff7fbf0e5 <+73>:	mov    %al,-0x25(%rbp)
   0x00007ffff7fbf0e8 <+76>:	cmpl   $0xf,-0x140(%rbp)
   0x00007ffff7fbf0ef <+83>:	jle    0x7ffff7fbf440 <Utility_66_SetMem_SSE+932>
   0x00007ffff7fbf0f5 <+89>:	mov    -0x138(%rbp),%rax
   0x00007ffff7fbf0fc <+96>:	add    $0xf,%eax
   0x00007ffff7fbf0ff <+99>:	and    $0xfffffff0,%eax
   0x00007ffff7fbf102 <+102>:	mov    %eax,%edx
   0x00007ffff7fbf104 <+104>:	mov    -0x138(%rbp),%rax
   0x00007ffff7fbf10b <+111>:	sub    %eax,%edx
   0x00007ffff7fbf10d <+113>:	mov    %edx,%eax
   0x00007ffff7fbf10f <+115>:	mov    %eax,-0x2c(%rbp)
   0x00007ffff7fbf112 <+118>:	mov    -0x140(%rbp),%eax
   0x00007ffff7fbf118 <+124>:	sub    -0x2c(%rbp),%eax
   0x00007ffff7fbf11b <+127>:	shr    $0x4,%eax
   0x00007ffff7fbf11e <+130>:	mov    %eax,-0x30(%rbp)
   0x00007ffff7fbf121 <+133>:	mov    -0x140(%rbp),%eax
   0x00007ffff7fbf127 <+139>:	mov    -0x30(%rbp),%edx
   0x00007ffff7fbf12a <+142>:	shl    $0x4,%edx
   0x00007ffff7fbf12d <+145>:	sub    %edx,%eax
   0x00007ffff7fbf12f <+147>:	sub    -0x2c(%rbp),%eax
   0x00007ffff7fbf132 <+150>:	mov    %eax,-0x24(%rbp)
   0x00007ffff7fbf135 <+153>:	movsbl -0x25(%rbp),%eax
   0x00007ffff7fbf139 <+157>:	mov    %al,-0x41(%rbp)
   0x00007ffff7fbf13c <+160>:	movsbl -0x41(%rbp),%edi
   0x00007ffff7fbf140 <+164>:	movsbl -0x41(%rbp),%r8d
   0x00007ffff7fbf145 <+169>:	movsbl -0x41(%rbp),%r9d
   0x00007ffff7fbf14a <+174>:	movsbl -0x41(%rbp),%r10d
   0x00007ffff7fbf14f <+179>:	movsbl -0x41(%rbp),%r11d
   0x00007ffff7fbf154 <+184>:	movsbl -0x41(%rbp),%ebx
   0x00007ffff7fbf158 <+188>:	movsbl -0x41(%rbp),%r15d
   0x00007ffff7fbf15d <+193>:	movsbl -0x41(%rbp),%eax
   0x00007ffff7fbf161 <+197>:	mov    %eax,-0x150(%rbp)
   0x00007ffff7fbf167 <+203>:	movsbl -0x41(%rbp),%esi
   0x00007ffff7fbf16b <+207>:	mov    %esi,-0x154(%rbp)
   0x00007ffff7fbf171 <+213>:	movsbl -0x41(%rbp),%ecx
   0x00007ffff7fbf175 <+217>:	mov    %ecx,-0x158(%rbp)
   0x00007ffff7fbf17b <+223>:	movsbl -0x41(%rbp),%edx
   0x00007ffff7fbf17f <+227>:	mov    %edx,-0x15c(%rbp)
   0x00007ffff7fbf185 <+233>:	movsbl -0x41(%rbp),%eax
   0x00007ffff7fbf189 <+237>:	mov    %eax,-0x160(%rbp)
   0x00007ffff7fbf18f <+243>:	movsbl -0x41(%rbp),%esi
   0x00007ffff7fbf193 <+247>:	movsbl -0x41(%rbp),%ecx
   0x00007ffff7fbf197 <+251>:	movsbl -0x41(%rbp),%edx
   0x00007ffff7fbf19b <+255>:	movsbl -0x41(%rbp),%eax
   0x00007ffff7fbf19f <+259>:	mov    %al,-0x42(%rbp)
   0x00007ffff7fbf1a2 <+262>:	mov    %dl,-0x43(%rbp)
   0x00007ffff7fbf1a5 <+265>:	mov    %cl,-0x44(%rbp)
   0x00007ffff7fbf1a8 <+268>:	mov    %sil,-0x45(%rbp)
   0x00007ffff7fbf1ac <+272>:	movzbl -0x160(%rbp),%eax
   0x00007ffff7fbf1b3 <+279>:	mov    %al,-0x46(%rbp)
   0x00007ffff7fbf1b6 <+282>:	movzbl -0x15c(%rbp),%edx
   0x00007ffff7fbf1bd <+289>:	mov    %dl,-0x47(%rbp)
   0x00007ffff7fbf1c0 <+292>:	movzbl -0x158(%rbp),%ecx
   0x00007ffff7fbf1c7 <+299>:	mov    %cl,-0x48(%rbp)
   0x00007ffff7fbf1ca <+302>:	movzbl -0x154(%rbp),%esi
   0x00007ffff7fbf1d1 <+309>:	mov    %sil,-0x49(%rbp)
   0x00007ffff7fbf1d5 <+313>:	movzbl -0x150(%rbp),%eax
   0x00007ffff7fbf1dc <+320>:	mov    %al,-0x4a(%rbp)
   0x00007ffff7fbf1df <+323>:	mov    %r15b,-0x4b(%rbp)
   0x00007ffff7fbf1e3 <+327>:	mov    %bl,-0x4c(%rbp)
   0x00007ffff7fbf1e6 <+330>:	mov    %r11b,-0x4d(%rbp)
   0x00007ffff7fbf1ea <+334>:	mov    %r10b,-0x4e(%rbp)
   0x00007ffff7fbf1ee <+338>:	mov    %r9b,-0x4f(%rbp)
   0x00007ffff7fbf1f2 <+342>:	mov    %r8b,-0x50(%rbp)
   0x00007ffff7fbf1f6 <+346>:	mov    %dil,-0x51(%rbp)
   0x00007ffff7fbf1fa <+350>:	movzbl -0x4a(%rbp),%edx
   0x00007ffff7fbf1fe <+354>:	movzbl -0x4b(%rbp),%eax
   0x00007ffff7fbf202 <+358>:	shl    $0x8,%rdx
   0x00007ffff7fbf206 <+362>:	or     %rax,%rdx
   0x00007ffff7fbf209 <+365>:	movzbl -0x4c(%rbp),%eax
   0x00007ffff7fbf20d <+369>:	shl    $0x8,%rdx
   0x00007ffff7fbf211 <+373>:	or     %rax,%rdx
   0x00007ffff7fbf214 <+376>:	movzbl -0x4d(%rbp),%eax
   0x00007ffff7fbf218 <+380>:	shl    $0x8,%rdx
   0x00007ffff7fbf21c <+384>:	or     %rax,%rdx
   0x00007ffff7fbf21f <+387>:	movzbl -0x4e(%rbp),%eax
   0x00007ffff7fbf223 <+391>:	shl    $0x8,%rdx
   0x00007ffff7fbf227 <+395>:	or     %rax,%rdx
   0x00007ffff7fbf22a <+398>:	movzbl -0x4f(%rbp),%eax
   0x00007ffff7fbf22e <+402>:	shl    $0x8,%rdx
   0x00007ffff7fbf232 <+406>:	or     %rax,%rdx
   0x00007ffff7fbf235 <+409>:	movzbl -0x50(%rbp),%eax
   0x00007ffff7fbf239 <+413>:	shl    $0x8,%rdx
   0x00007ffff7fbf23d <+417>:	or     %rax,%rdx
   0x00007ffff7fbf240 <+420>:	movzbl -0x51(%rbp),%eax
   0x00007ffff7fbf244 <+424>:	shl    $0x8,%rdx
   0x00007ffff7fbf248 <+428>:	or     %rax,%rdx
   0x00007ffff7fbf24b <+431>:	movzbl -0x42(%rbp),%eax
   0x00007ffff7fbf24f <+435>:	movzbl -0x43(%rbp),%ecx
   0x00007ffff7fbf253 <+439>:	shl    $0x8,%rax
   0x00007ffff7fbf257 <+443>:	or     %rcx,%rax
   0x00007ffff7fbf25a <+446>:	movzbl -0x44(%rbp),%ecx
   0x00007ffff7fbf25e <+450>:	shl    $0x8,%rax
   0x00007ffff7fbf262 <+454>:	or     %rcx,%rax
   0x00007ffff7fbf265 <+457>:	movzbl -0x45(%rbp),%ecx
   0x00007ffff7fbf269 <+461>:	shl    $0x8,%rax
   0x00007ffff7fbf26d <+465>:	or     %rcx,%rax
   0x00007ffff7fbf270 <+468>:	movzbl -0x46(%rbp),%ecx
   0x00007ffff7fbf274 <+472>:	shl    $0x8,%rax
   0x00007ffff7fbf278 <+476>:	or     %rcx,%rax
   0x00007ffff7fbf27b <+479>:	movzbl -0x47(%rbp),%ecx
   0x00007ffff7fbf27f <+483>:	shl    $0x8,%rax
   0x00007ffff7fbf283 <+487>:	or     %rcx,%rax
   0x00007ffff7fbf286 <+490>:	movzbl -0x48(%rbp),%ecx
   0x00007ffff7fbf28a <+494>:	shl    $0x8,%rax
   0x00007ffff7fbf28e <+498>:	or     %rcx,%rax
   0x00007ffff7fbf291 <+501>:	movzbl -0x49(%rbp),%ecx
   0x00007ffff7fbf295 <+505>:	shl    $0x8,%rax
   0x00007ffff7fbf299 <+509>:	or     %rcx,%rax
   0x00007ffff7fbf29c <+512>:	mov    %rdx,-0x150(%rbp)
   0x00007ffff7fbf2a3 <+519>:	mov    %rax,-0x148(%rbp)
=> 0x00007ffff7fbf2aa <+526>:	vmovdqa -0x150(%rbp),%xmm0
   0x00007ffff7fbf2b2 <+534>:	vmovaps %xmm0,-0x40(%rbp)
   0x00007ffff7fbf2b7 <+539>:	movzbl -0x25(%rbp),%eax
   0x00007ffff7fbf2bb <+543>:	movzbl %al,%eax
   0x00007ffff7fbf2be <+546>:	mov    -0x2c(%rbp),%edx
   0x00007ffff7fbf2c1 <+549>:	mov    %eax,%esi
   0x00007ffff7fbf2c3 <+551>:	mov    %r13,%rdi
   0x00007ffff7fbf2c6 <+554>:	movabs $0xffffffffffff7043,%rax
   0x00007ffff7fbf2d0 <+564>:	lea    (%r14,%rax,1),%rax
   0x00007ffff7fbf2d4 <+568>:	callq  *%rax
   0x00007ffff7fbf2d6 <+570>:	mov    -0x2c(%rbp),%eax
   0x00007ffff7fbf2d9 <+573>:	add    %rax,%r13
   0x00007ffff7fbf2dc <+576>:	mov    $0x0,%ebx
   0x00007ffff7fbf2e1 <+581>:	jmpq   0x7ffff7fbf435 <Utility_66_SetMem_SSE+921>
   0x00007ffff7fbf2e6 <+586>:	mov    -0x30(%rbp),%eax
   0x00007ffff7fbf2e9 <+589>:	sub    %ebx,%eax
   0x00007ffff7fbf2eb <+591>:	cmp    $0x3,%eax
   0x00007ffff7fbf2ee <+594>:	jbe    0x7ffff7fbf39f <Utility_66_SetMem_SSE+771>
   0x00007ffff7fbf2f4 <+600>:	mov    %r13,-0xb8(%rbp)
   0x00007ffff7fbf2fb <+607>:	vmovdqa -0x40(%rbp),%xmm0
   0x00007ffff7fbf300 <+612>:	vmovaps %xmm0,-0xd0(%rbp)
   0x00007ffff7fbf308 <+620>:	mov    -0xb8(%rbp),%rax
   0x00007ffff7fbf30f <+627>:	vmovdqa -0xd0(%rbp),%xmm0
   0x00007ffff7fbf317 <+635>:	vmovaps %xmm0,(%rax)
   0x00007ffff7fbf31b <+639>:	mov    %r13,%rax
   0x00007ffff7fbf31e <+642>:	add    $0x10,%rax
   0x00007ffff7fbf322 <+646>:	mov    %rax,-0x98(%rbp)
   0x00007ffff7fbf329 <+653>:	vmovdqa -0x40(%rbp),%xmm0
   0x00007ffff7fbf32e <+658>:	vmovaps %xmm0,-0xb0(%rbp)
   0x00007ffff7fbf336 <+666>:	mov    -0x98(%rbp),%rax
   0x00007ffff7fbf33d <+673>:	vmovdqa -0xb0(%rbp),%xmm0
   0x00007ffff7fbf345 <+681>:	vmovaps %xmm0,(%rax)
   0x00007ffff7fbf349 <+685>:	mov    %r13,%rax
   0x00007ffff7fbf34c <+688>:	add    $0x20,%rax
   0x00007ffff7fbf350 <+692>:	mov    %rax,-0x78(%rbp)
   0x00007ffff7fbf354 <+696>:	vmovdqa -0x40(%rbp),%xmm0
   0x00007ffff7fbf359 <+701>:	vmovaps %xmm0,-0x90(%rbp)
   0x00007ffff7fbf361 <+709>:	mov    -0x78(%rbp),%rax
   0x00007ffff7fbf365 <+713>:	vmovdqa -0x90(%rbp),%xmm0
   0x00007ffff7fbf36d <+721>:	vmovaps %xmm0,(%rax)
   0x00007ffff7fbf371 <+725>:	mov    %r13,%rax
   0x00007ffff7fbf374 <+728>:	add    $0x30,%rax
   0x00007ffff7fbf378 <+732>:	mov    %rax,-0x60(%rbp)
   0x00007ffff7fbf37c <+736>:	vmovdqa -0x40(%rbp),%xmm0
   0x00007ffff7fbf381 <+741>:	vmovaps %xmm0,-0x70(%rbp)
   0x00007ffff7fbf386 <+746>:	mov    -0x60(%rbp),%rax
   0x00007ffff7fbf38a <+750>:	vmovdqa -0x70(%rbp),%xmm0
   0x00007ffff7fbf38f <+755>:	vmovaps %xmm0,(%rax)
   0x00007ffff7fbf393 <+759>:	add    $0x40,%r13
   0x00007ffff7fbf397 <+763>:	add    $0x3,%ebx
   0x00007ffff7fbf39a <+766>:	jmpq   0x7ffff7fbf432 <Utility_66_SetMem_SSE+918>
   0x00007ffff7fbf39f <+771>:	mov    -0x30(%rbp),%eax
   0x00007ffff7fbf3a2 <+774>:	sub    %ebx,%eax
   0x00007ffff7fbf3a4 <+776>:	cmp    $0x1,%eax
   0x00007ffff7fbf3a7 <+779>:	jbe    0x7ffff7fbf407 <Utility_66_SetMem_SSE+875>
   0x00007ffff7fbf3a9 <+781>:	mov    %r13,-0xf8(%rbp)
   0x00007ffff7fbf3b0 <+788>:	vmovdqa -0x40(%rbp),%xmm0
   0x00007ffff7fbf3b5 <+793>:	vmovaps %xmm0,-0x110(%rbp)
   0x00007ffff7fbf3bd <+801>:	mov    -0xf8(%rbp),%rax
   0x00007ffff7fbf3c4 <+808>:	vmovdqa -0x110(%rbp),%xmm0
   0x00007ffff7fbf3cc <+816>:	vmovaps %xmm0,(%rax)
   0x00007ffff7fbf3d0 <+820>:	mov    %r13,%rax
   0x00007ffff7fbf3d3 <+823>:	add    $0x10,%rax
   0x00007ffff7fbf3d7 <+827>:	mov    %rax,-0xd8(%rbp)
   0x00007ffff7fbf3de <+834>:	vmovdqa -0x40(%rbp),%xmm0
   0x00007ffff7fbf3e3 <+839>:	vmovaps %xmm0,-0xf0(%rbp)
   0x00007ffff7fbf3eb <+847>:	mov    -0xd8(%rbp),%rax
   0x00007ffff7fbf3f2 <+854>:	vmovdqa -0xf0(%rbp),%xmm0
   0x00007ffff7fbf3fa <+862>:	vmovaps %xmm0,(%rax)
   0x00007ffff7fbf3fe <+866>:	add    $0x20,%r13
   0x00007ffff7fbf402 <+870>:	add    $0x1,%ebx
   0x00007ffff7fbf405 <+873>:	jmp    0x7ffff7fbf432 <Utility_66_SetMem_SSE+918>
   0x00007ffff7fbf407 <+875>:	mov    %r13,-0x118(%rbp)
   0x00007ffff7fbf40e <+882>:	vmovdqa -0x40(%rbp),%xmm0
   0x00007ffff7fbf413 <+887>:	vmovaps %xmm0,-0x130(%rbp)
   0x00007ffff7fbf41b <+895>:	mov    -0x118(%rbp),%rax
   0x00007ffff7fbf422 <+902>:	vmovdqa -0x130(%rbp),%xmm0
   0x00007ffff7fbf42a <+910>:	vmovaps %xmm0,(%rax)
   0x00007ffff7fbf42e <+914>:	add    $0x10,%r13
   0x00007ffff7fbf432 <+918>:	add    $0x1,%ebx
   0x00007ffff7fbf435 <+921>:	cmp    -0x30(%rbp),%ebx
   0x00007ffff7fbf438 <+924>:	jb     0x7ffff7fbf2e6 <Utility_66_SetMem_SSE+586>
   0x00007ffff7fbf43e <+930>:	jmp    0x7ffff7fbf449 <Utility_66_SetMem_SSE+941>
   0x00007ffff7fbf440 <+932>:	mov    -0x140(%rbp),%eax
   0x00007ffff7fbf446 <+938>:	mov    %eax,-0x24(%rbp)
   0x00007ffff7fbf449 <+941>:	movzbl -0x25(%rbp),%eax
   0x00007ffff7fbf44d <+945>:	movzbl %al,%eax
   0x00007ffff7fbf450 <+948>:	mov    -0x24(%rbp),%edx
   0x00007ffff7fbf453 <+951>:	mov    %eax,%esi
   0x00007ffff7fbf455 <+953>:	mov    %r13,%rdi
   0x00007ffff7fbf458 <+956>:	movabs $0xffffffffffff7043,%rax
   0x00007ffff7fbf462 <+966>:	lea    (%r14,%rax,1),%rax
   0x00007ffff7fbf466 <+970>:	callq  *%rax
   0x00007ffff7fbf468 <+972>:	mov    -0x138(%rbp),%rax
   0x00007ffff7fbf46f <+979>:	add    $0x140,%rsp
   0x00007ffff7fbf476 <+986>:	pop    %rbx
   0x00007ffff7fbf477 <+987>:	pop    %r13
   0x00007ffff7fbf479 <+989>:	pop    %r14
   0x00007ffff7fbf47b <+991>:	pop    %r15
   0x00007ffff7fbf47d <+993>:	pop    %rbp
   0x00007ffff7fbf47e <+994>:	retq 

In the hope it is useful.

@deadwood2
Copy link
Owner

Thank you. Can you do one more thing: one you get the crash, please do

p $rbp

This should show the value of RBP register.

@alb42
Copy link

alb42 commented Mar 13, 2022

just as a sidemark, if you did not notice

the illegal command "vmovdqa" here is an AVX command, which is correct identified as illegal, because his CPU has no AVX extension, the question is why it creates AVX commands even his CPU does not support them?

@deadwood2
Copy link
Owner

Thanks - I did not notice that. That will make it easier to trace the problem.

@deadwood2
Copy link
Owner

@magorium

Please do the following:
a) revert any deletions in source code that I suggested earlier
b) in arch/app-pc/utility/mmakefile.src remove -mavx switch from ISA_FLAGS
c) delete alt-runtimelinux-x86_64-d/bin/runtimelinux-x86_64/gen/rom/utility/utility/arch
d) run make in alt-runtimelinux-x86_64-d/

This should rebuild utility.library with setmem_sse compiled without AVX opcodes. You can check alt-runtimelinux-x86_64-d/bin/runtimelinux-x86_64/gen/rom/utility/utility/arch/setmem_sse.o if they are gone.

If this solves your issue, I will push the change to repository.

@magorium
Copy link
Author

Sorry in advance for my need for extra guidance.

Please do the following:

I needed to start from scratch, so therefor I did things a bit differently.

In case this answer is not helpful in what you wanted/needed to know from me then please correct.

I did the following:

a) mkdir myrepo
b) cd myrepo
c) git clone https://github.com/deadw00d/AROS.git AROS
d) cd AROS
e) git checkout alt-runtime
f) removed -mavx switch from ISA_FLAGS in file ./arch/all-pc/utility/mmakefile.src, pushed/checkout the changes
g) cd ..
h) cp ./AROS/scripts/rebuild.sh .
i) ./rebuild.sh

Before building there wasn't a directory available named: alt-runtimelinux-x86_64-d/bin/runtimelinux-x86_64/gen/rom/utility/utility/arch so I am not sure where that comes into place as suggested by your instructions. I am assuming it needed to be cleaned out before running make. If so then it was clean beforehand.

You can check alt-runtimelinux-x86_64-d/bin/runtimelinux-x86_64/gen/rom/utility/utility/arch/setmem_sse.o if they are gone.

After the rebuild script finished, the following files were present inside the directory as mentioned:

setmem.d
setmem.o
setmem_avx.d
setmem_avx.o
setmem_sse.d
setmem_sse.o
utility_archinit.d
utility_archinit.o

Please advice. TIA

@deadwood2
Copy link
Owner

Easiest is just to start Wanderer and see if you again get a crash in SetMem_SSE :)

@magorium
Copy link
Author

@Deadw00D:
I wished everything in life was just as easy ;-p

Wanderer is showing its face now without crashing.

Not much to do/test without a working left mouse-button but, it's still progress.

Thank you.

Issue can be closed, unless you prefer it to be closed after you pushed your changes (and have me checked it out first) ?

@deadwood2
Copy link
Owner

Thanks, I need to make these changes clean, push them and then I will close the bug.

deadwood2 pushed a commit that referenced this issue Mar 15, 2022
Use -mavx only for setmem_avx. Otherwise gcc generates AVX versions
of vmovdqa opcode to handle XMM registers.
deadwood2 pushed a commit to deadwood2/fork-ADT-AROS that referenced this issue Mar 15, 2022
Use -mavx only for setmem_avx. Otherwise gcc generates AVX versions
of vmovdqa opcode to handle XMM registers.
Kalamatee added a commit to aros-development-team/AROS that referenced this issue Mar 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority:default type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants