From nobody Sun Jun 29 02:27:51 2025 X-Original-To: current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bVCrP1rd6z60m4y for ; Sun, 29 Jun 2025 02:28:05 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4bVCrN5G1Wz4Cjq for ; Sun, 29 Jun 2025 02:28:04 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.18.1/8.18.1) with ESMTP id 55T2RpoL098625; Sun, 29 Jun 2025 05:27:54 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 55T2RpoL098625 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 55T2RpmL098624; Sun, 29 Jun 2025 05:27:51 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 29 Jun 2025 05:27:51 +0300 From: Konstantin Belousov To: "Bjoern A. Zeeb" Cc: current@freebsd.org Subject: Re: Illegal instruction (core dumped) Message-ID: References: <357r6812-o83q-42rr-ps01-322458p6pp65@yvfgf.mnoonqbm.arg> List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Rspamd-Queue-Id: 4bVCrN5G1Wz4Cjq X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] On Sat, Jun 28, 2025 at 11:23:01PM +0000, Bjoern A. Zeeb wrote: > On Sun, 29 Jun 2025, Konstantin Belousov wrote: > > > On Sat, Jun 28, 2025 at 05:32:17PM +0000, Bjoern A. Zeeb wrote: > > > Hi, > > > > > > happened in one of my dev VMs: > > > > > > # more /etc/wpa_supplicant.conf Illegal instruction (core dumped) > > > > > > As I see nothing in UPDATING in the range from HEAD to the commit I > > > rebased --onto b93161a7e38d (downgrade of the kernel) that would > > > explain this I am wondering. > > > > > > > > > Mounted the disk image from the base system and checked the core: > > > > > > Program terminated with signal SIGILL, Illegal instruction. > > > (gdb) where > > > #0 0x00003fabd04ebeed in tgetflag_sp (sp=0x3fa3ad42f3a0 , id=0x3fa3ad42f3a0 "") at /usr/src/contrib/ncurses/ncurses/tinfo/lib_termcap.c:259 > > > #1 0x00003fa3ad404e9e in get_term () at /usr/src/contrib/less/screen.c:1256 > > > #2 0x00003fa3ad4042ef in main (argc=1, argv=0x3fabce1f26b8) at /usr/src/contrib/less/main.c:344 > > > > > > > What is the instruction that faulted? > > Also show the registers values used by the instruction. > > I am a bit rusty with this user spaec stuff ;-) Hope the below helps. > > (gdb) display/i $pc > 1: x/i $pc > => 0x3fabd04ebeed : cmove %rbx,%rcx > So this is kind of impossible. The instruction CMOVE is there from the PentiumPro times. It does not access any resources except registers. It cannot cause the vmexit on its own since it cannot generate exceptions (well perhaps except code fetch page fault). The only possible vmexit on this instruction is due to external events. But then bhyve does not generate #UD. BTW was it intel or amd cpu? > (gdb) info f > Stack level 0, frame at 0x3fabce1f25b0: > rip = 0x3fabd04ebeed in tgetflag_sp (/usr/src/src.pecunia/contrib/ncurses/ncurses/tinfo/lib_termcap.c:259); saved rip = 0x3fa3ad404e9e > called by frame at 0x3fabce1f2600 > source language c. > Arglist at 0x3fabce1f25a0, args: sp=0x3fa3ad42f3a0 , id=0x3fa3ad42f3a0 "" > Locals at 0x3fabce1f25a0, Previous frame's sp is 0x3fabce1f25b0 > Saved registers: > rbx at 0x3fabce1f2590, rbp at 0x3fabce1f25a0, r14 at 0x3fabce1f2598, rip at 0x3fabce1f25a8 > > (gdb) info r > rax 0x3fabd04fec30 70007166856240 > rbx 0x3fabce1f4cb8 70007130115256 > rcx 0xd00b620ed25bfd23 -3455560473278415581 > rdx 0x3fabce1f2aaa 70007130106538 > rsi 0x3fa3ad42f3a0 69972219065248 > rdi 0x3fa3ad42f3a0 69972219065248 > rbp 0x3fabce1f25a0 0x3fabce1f25a0 > rsp 0x3fabce1f25a0 0x3fabce1f25a0 > r8 0x11 17 > r9 0x3 3 > r10 0x10 16 > r11 0x40 64 > r12 0x3fabd145be60 70007182966368 > r13 0x2 2 > r14 0x3fa3ad43bab8 69972219116216 > r15 0x1 1 > rip 0x3fabd04ebeed 0x3fabd04ebeed > eflags 0x10202 [ IF RF ] > cs 0x43 67 > ss 0x3b 59 > ds 0x3b 59 > es 0x3b 59 > fs 0x13 19 > gs 0x1b 27 > fs_base 0x467b85825120 77496334831904 > gs_base 0x0 0 > > > | 0x3fabd04ebed7 test %rdi,%rdi | > | 0x3fabd04ebeda je 0x3fabd04ebef3 | > | 0x3fabd04ebedc mov 0x30(%rdi),%rcx | > | 0x3fabd04ebee0 test %rcx,%rcx | > | 0x3fabd04ebee3 mov 0x10d6e(%rip),%rax # 0x3fabd04fcc58 | > | 0x3fabd04ebeea mov (%rax),%rbx | > | >0x3fabd04ebeed cmove %rbx,%rcx | > | 0x3fabd04ebef1 jmp 0x3fabd04ebf00 | > | 0x3fabd04ebef3 mov 0x10d5e(%rip),%rax # 0x3fabd04fcc58 | > | 0x3fabd04ebefa mov (%rax),%rbx | > | 0x3fabd04ebefd mov %rbx,%rcx | > | 0x3fabd04ebf00 xor %eax,%eax | > | 0x3fabd04ebf02 test %rcx,%rcx | > | 0x3fabd04ebf05 je 0x3fabd04ebfe6 | > | 0x3fabd04ebf0b cmpb $0x0,(%rsi) | > | 0x3fabd04ebf0e je 0x3fabd04ebfe6 | > | 0x3fabd04ebf14 cmpb $0x0,0x1(%rsi) | > | 0x3fabd04ebf18 je 0x3fabd04ebfe6 | > > -- > Bjoern A. Zeeb r15:7