unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: 58320@debbugs.gnu.org
Cc: bug-hurd@gnu.org
Subject: bug#58320: Hurd VM fails to boot on AMD EPYC (kvm-amd)
Date: Fri, 07 Oct 2022 10:24:22 +0200	[thread overview]
Message-ID: <8735c0f3d5.fsf@gnu.org> (raw)
In-Reply-To: <20221006224219.mn7zp7lhzxwlyrpx@begin> (Samuel Thibault's message of "Fri, 7 Oct 2022 00:42:19 +0200")

Hi!

Samuel Thibault <samuel.thibault@gnu.org> skribis:

> Ludovic Courtès, le ven. 07 oct. 2022 00:10:15 +0200, a ecrit:

[...]

>> Of course, the thing boots just fine on that machine when using
>> ‘exec.static’.
>
> Uh. At least you have a workaround :)

Yup.  :-)

>> So the issue might be somewhere in ld.so, or triggered by ld.so.
>> Any debugging tricks here?
>
> maybe for a start check with 
>
> show map $map2
>
> what is actually mapped, whether it's just ld.so, or also exec, etc.

On the first trap (page fault) I see:

--8<---------------cut here---------------start------------->8---
db> show all tasks                                                                                              
 ID TASK     NAME [THREADS]                                                                                     
  0 f5f7cf00 gnumach [7]                                                                                        
  1 f5f7ce40 ext2fs [6]                                                                                         
  2 f5f7cd80 exec [1]                                                                                           
db> show map $map2                                                                                              
Map 0xf5f6ff30: name="exec", pmap=0xf5f71fa8,ref=1,nentries=5                                                   
size=290816,resident:290816,wired=0                                                                             
version=14                                                                                                      
 map entry 0xf625ec08: start=0x0, end=0x1000                                                                    
 prot=1/7/copy, object=0xf5f6a7d0, offset=0x0                                                                   
  Object 0xf5f6a7d0: size=0x1000, 1 references                                                                  
  1 resident pages, 0 absent pages, 0 paging ops                                                                
   memory object=0x0 (offset=0x0),control=0x0, name=0xf5938968                                                  
   uninitialized,temporary      internal,copy_strategy=0                                                        
   shadow=0x0 (offset=0x0),copy=0x0                                                                             
 map entry 0xf625ebb0: start=0x1000, end=0x26000                                                                
 prot=5/7/copy, object=0xf5f6ad70, offset=0x0                                                                   
  Object 0xf5f6ad70: size=0x25000, 1 references                                                                 
  37 resident pages, 0 absent pages, 0 paging ops                                                               
   memory object=0x0 (offset=0x0),control=0x0, name=0xf5f82780                                                  
   uninitialized,temporary      internal,copy_strategy=0                                                        
   shadow=0x0 (offset=0x0),copy=0x0                                                                             
 map entry 0xf625eb58: start=0x26000, end=0x34000                                                               
 prot=1/7/copy, object=0xf5f6ad20, offset=0x0                                                                   
  Object 0xf5f6ad20: size=0xe000, 1 references                                                                  
  14 resident pages, 0 absent pages, 0 paging ops                                                               
   memory object=0x0 (offset=0x0),control=0x0, name=0xf5f82730                                                  
   uninitialized,temporary      internal,copy_strategy=0                                                        
   shadow=0x0 (offset=0x0),copy=0x0                                                                             
 map entry 0xf625eb00: start=0x34000, end=0x37000                                                               
 prot=3/7/copy, object=0xf5f6acd0, offset=0x0                                                                   
  Object 0xf5f6acd0: size=0x3000, 1 references                                                                  
  3 resident pages, 0 absent pages, 0 paging ops                                                                
   memory object=0x0 (offset=0x0),control=0x0, name=0xf5f826e0                                                  
   uninitialized,temporary      internal,copy_strategy=0                                                        
   shadow=0x0 (offset=0x0),copy=0x0                                                                             
 map entry 0xf625eaa8: start=0xbfff0000, end=0xc0000000                                                         
 prot=3/7/copy, object=0xf5f6ac80, offset=0x0                                                                   
  Object 0xf5f6ac80: size=0x10000, 1 references                                                                 
  16 resident pages, 0 absent pages, 0 paging ops                                                               
   memory object=0x0 (offset=0x0),control=0x0, name=0xf5f82690                                                  
   uninitialized,temporary      internal,copy_strategy=0                                                        
   shadow=0x0 (offset=0x0),copy=0x0                                                                             
--8<---------------cut here---------------end--------------->8---

The mappings appear to match the PT_LOAD sections of ld.so:

--8<---------------cut here---------------start------------->8---
$ objdump -x  /gnu/store/m8afvcgwmrfhvjpd7b0xllk8vv5isd6j-glibc-cross-i586-pc-gnu-2.33/lib/ld.so.1|head -16

/gnu/store/m8afvcgwmrfhvjpd7b0xllk8vv5isd6j-glibc-cross-i586-pc-gnu-2.33/lib/ld.so.1:     file format elf32-i386
/gnu/store/m8afvcgwmrfhvjpd7b0xllk8vv5isd6j-glibc-cross-i586-pc-gnu-2.33/lib/ld.so.1
architecture: i386, flags 0x00000150:
HAS_SYMS, DYNAMIC, D_PAGED
start address 0x000011b0

Program Header:
    LOAD off    0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**12
         filesz 0x00000dd8 memsz 0x00000dd8 flags r--
    LOAD off    0x00001000 vaddr 0x00001000 paddr 0x00001000 align 2**12
         filesz 0x000244a1 memsz 0x000244a1 flags r-x
    LOAD off    0x00026000 vaddr 0x00026000 paddr 0x00026000 align 2**12
         filesz 0x0000d5e8 memsz 0x0000d5e8 flags r--
    LOAD off    0x00033f60 vaddr 0x00034f60 paddr 0x00034f60 align 2**12
         filesz 0x00001910 memsz 0x00001a6c flags rw-
--8<---------------cut here---------------end--------------->8---

… so ‘exec_load’ is doing its job, it seems.

I also tried to set up a breakpoint on ‘task_terminate’ to see what’s
going on when the exec task vanishes:

--8<---------------cut here---------------start------------->8---
module 0: ext2fs --multiboot-command-line=${kernel-command-line} --host-priv-por                                
t=${host-port} --device-master-port=${device-port} --exec-server-task=${exec-tas                                
k} --store-type=typed --x-xattr-translator-records ${root} $(task-create) $(task                                                               -resume)                                                                                                        
module 1: exec /gnu/store/0na7ic689glydngxyb7pazjixz9b6629-hurd-0.9-1.91a5167/hu                                
rd/exec $(exec-task=task-create)                                                                                
2 multiboot modules                                                                                             
task loaded: ext2fs --multiboot-command-line=root=device:hd0s1 root=3367134b-cf6                                
6-e06b-ee4b-4b933367134b gnu.system=/gnu/store/g7kssjfrxqjpbr6r31idiasgglfph2y5-                                
system gnu.load=/gnu/store/g7kssjfrxqjpbr6r31idiasgglfph2y5-system/boot --host-p                                
riv-port=1 --device-master-port=2 --exec-server-task=3 --store-type=typed --x-xa                                
ttr-translator-records device:hd0s1                                                                             
task loaded: exec /gnu/store/0na7ic689glydngxyb7pazjixz9b6629-hurd-0.9-1.91a5167                                
/hurd/exec                                                                                                      
                                                                                                                
start ext2fs: Hurd server bootstrap: ext2fs[device:hd0s1] execKernel Breakpoint                                 
trap, eip 0xc10305c1                                                                                            
Breakpoint at  task_terminate:  pushl   %ebp                                                                    
db> show all threads                                                                                            
    TASK        THREADS                                                                                         
  0 gnumach (f5f7cf00): 7 threads:                                                                              
              0 (f5f7be18) .W..N. 0xc11dac04                                                                    
              1 (f5f7bcd0) R..O..(idle_thread_continue)                                                         
              2 (f5f7bb88) .W.ON.(reaper_thread_continue) 0xc12015d4                                            
              3 (f5f7ba40) .W.ON.(swapin_thread_continue) 0xc11f8e2c                                            
              4 (f5f7b8f8) .W.ON.(sched_thread_continue) 0                                                      
              5 (f5f7b7b0) .W.ON.(io_done_thread_continue) 0xc1201f74                                           
              6 (f5f7b668) .W.ON.(net_thread_continue) 0xc11db0a8                                               
  1 ext2fs (f5f7ce40): 6 threads:                                                                               
              0 (f5f7b520) .W.O.F(mach_msg_continue) 0                                                          
              1 (f5f7b290) .W.O..(mach_msg_receive_continue) 0                                                  
              2 (f5f7b148) .W.O..(mach_msg_receive_continue) 0                                                  
              3 (f5f7b000) .W.O..(mach_msg_continue) 0                                                          
              4 (f67d4e20) .W.O..(mach_msg_receive_continue) 0                                                  
              5 (f67d4cd8) .W.O..(mach_msg_continue) 0                                                          
  2 exec (f5f7cd80): (f5f7b3d8) R.....                                                                          
db> trace/t 0xf5f7b3d8                                                                                          
task_terminate(f625eb10,0,f5f7cd80,f5f7b3d8,c11da940)                                                           
exception_try_task(1,1,bffefffc,ffffffff,c1202b4c)+0x58                                                         
exception(1,1,bffefffc,c10096da,f5957fbc)+0x7a                                                                  
interrupted_pc(1,1,bffefffc,c102ce99,c1202b40)                                                                  
trap_name(1,f5957f80,f5f73f4c,f5f73f58)                                                                         
vm_fault(f5f6ff30,bffef000,3,0,0,c1008ee4,f5f82550,fb7d9000)+0x74a                                              
user_trap(f5f7a718)+0x2df                                                                                       
>>>>> Page fault (14) at 0x1000 <<<<<                                                                           
>>>>> user space <<<<<                                                                                          
db> show map $map2                                                                                              
Map 0xf5f6ff30: name="exec", pmap=0xf5f71fa8,ref=1,nentries=5                                                   
size=290816,resident:290816,wired=0                                                                             
version=14                                                                                                      
 map entry 0xf625ec08: start=0x0, end=0x1000                                                                    
 prot=1/7/copy, object=0xf5f6a7d0, offset=0x0                                                                   
  Object 0xf5f6a7d0: size=0x1000, 1 references                                                                  
  1 resident pages, 0 absent pages, 0 paging ops                                                                
   memory object=0x0 (offset=0x0),control=0x0, name=0xf5938968                                                  
   uninitialized,temporary      internal,copy_strategy=0                                                        
   shadow=0x0 (offset=0x0),copy=0x0                                                                             
 map entry 0xf625ebb0: start=0x1000, end=0x26000                                                                
 prot=5/7/copy, object=0xf5f6ad70, offset=0x0                                                                   
  Object 0xf5f6ad70: size=0x25000, 1 references                                                                 
  37 resident pages, 0 absent pages, 0 paging ops                                                               
   memory object=0x0 (offset=0x0),control=0x0, name=0xf5f82780                                                  
   uninitialized,temporary      internal,copy_strategy=0                                                        
   shadow=0x0 (offset=0x0),copy=0x0                                                                             
--8<---------------cut here---------------end--------------->8---

It says “page fault at 0x1000” but there is apparently a valid mapping
at that address.

Funny thing: if I set a breakpoint on ‘read_exec’ and continue each time
it’s hit, the ‘exec’ process starts just fine.

Could it be a synchronization issue somewhere?

Thanks,
Ludo’.




  reply	other threads:[~2022-10-07  8:25 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-05 21:01 bug#58320: Hurd VM fails to boot on AMD EPYC (kvm-amd) Ludovic Courtès
2022-10-06 13:14 ` Ludovic Courtès
2022-10-06 13:53   ` Samuel Thibault
2022-10-06 22:10     ` Ludovic Courtès
2022-10-06 22:42       ` Samuel Thibault
2022-10-07  8:24         ` Ludovic Courtès [this message]
2022-10-07 21:16           ` Samuel Thibault
2022-10-08 15:52             ` Ludovic Courtès
2022-10-09 16:09               ` Ludovic Courtès
2022-10-09 19:09                 ` Samuel Thibault
2022-10-10 21:14                 ` Ludovic Courtès
2022-10-17 12:51           ` Ludovic Courtès
2022-10-23 13:58       ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8735c0f3d5.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=58320@debbugs.gnu.org \
    --cc=bug-hurd@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).