> Date: Wed, 16 May 2018 09:24:05 +0200
> From: Theo Buehler <t...@theobuehler.org>
> 
> On Mon, May 14, 2018 at 01:05:07PM +0200, Otto Moerbeek wrote:
> > On Sun, May 13, 2018 at 10:34:13PM +0200, Alexander Bluhm wrote:
> > 
> > > Hi,
> > > 
> > > When executing the posixtestsuite port, the i386 kernel crashes.
> > > It is this one:
> > > 
> > > /usr/local/libexec/posixtestsuite/conformance/interfaces/mmap/31-1.test
> > > 
> > > bluhm
> > 
> > This fixes the panic. The error returned is not expected by the test
> > suite (ENOMEM vs EOVERFLOW), but that's another matter imo.
> > 
> >     -Otto
> 
> ok tb

ok kettenis@ as well

> > Index: uvm_addr.c
> > ===================================================================
> > RCS file: /cvs/src/sys/uvm/uvm_addr.c,v
> > retrieving revision 1.26
> > diff -u -p -r1.26 uvm_addr.c
> > --- uvm_addr.c      17 Apr 2018 15:50:05 -0000      1.26
> > +++ uvm_addr.c      14 May 2018 11:02:57 -0000
> > @@ -1376,7 +1376,8 @@ uaddr_stack_brk_select(struct vm_map *ma
> >  #else
> >     dir =  1;
> >  #endif
> > -   if (end - start >= sz + before_gap + after_gap) {
> > +   if (end - start >= before_gap + after_gap &&
> > +       end - start - before_gap - after_gap >= sz) {
> >             if (uvm_addr_linsearch(map, uaddr, entry_out, addr_out,
> >                 0, sz, align, offset, dir, start, end - sz,
> >                 before_gap, after_gap) == 0)
> > 
> > > 
> > > root@ot1:.../~# te/conformance/interfaces/mmap/31-1.test                  
> > >     <
> > > off: fffff000, lpanic: kernel diagnostic assertion "high + sz > high" 
> > > failed: file "/usr/src/sys/uvm/uvm_addr.c", line 341
> > > Stopped at      db_enter+0x4:   popl    %ebp
> > >     TID    PID    UID     PRFLAGS     PFLAGS  CPU  COMMAND
> > > *268073  10715      0         0x3          0    1K 31-1.test
> > > db_enter() at db_enter+0x4
> > > panic() at panic+0xcc
> > > __assert(d0aa7bd0,d0c3e973,155,d0c3ea65) at __assert+0x19
> > > uvm_addr_linsearch(d55a5448,0,f55ecdd4,f55ecefc,0,fffff000,1000,0,1,cd6ce000,cf
> > > 7cf000,1000,2000) at uvm_addr_linsearch+0x20f
> > > uaddr_stack_brk_select(d55a5448,d571bc54,f55ecdd4,f55ecefc,fffff000,1000,0,3,0)
> > >  at uaddr_stack_brk_select+0x139
> > > uvm_addr_invoke(d55a5448,d571bc54,f55ecdd4,f55ecdd0,f55ecefc,fffff000,1000,0,3,
> > > 0) at uvm_addr_invoke+0x49
> > > uvm_map_findspace(d55a5448,f55ecdd4,f55ecdd0,f55ecefc,fffff000,1000,0,3,0)
> > >  at u
> > > vm_map_findspace+0xc9
> > > uvm_map(d55a5448,f55ecefc,fffff000,d508b8d0,fffff000,0,0) at uvm_map+0x350
> > > uvm_mmapfile(d55a5448,f55ecefc,fffff000,3,7,1,d52965a4,fffff000,0,298ef000)
> > >  at u
> > > vm_mmapfile+0x183
> > > sys_mmap(d5484cd8,f55ecf50,f55ecf48) at sys_mmap+0x640
> > > syscall() at syscall+0x25e
> > > --- syscall (number 1398493569) ---
> > > end of kernel
> > > 0xcf7cc684:
> > > https://www.openbsd.org/ddb.html describes the minimum info required in 
> > > bug
> > > reports.  Insufficient info makes it difficult to find and fix bugs.
> > > ddb{1}> x/s version
> > > version:        OpenBSD 6.3-current (GENERIC.MP) #600: Sat May 12 
> > > 10:21:32 MDT 2
> > > 018\012    
> > > dera...@i386.openbsd.org:/usr/src/sys/arch/i386/compile/GENERIC.MP\0
> > > 12
> > > ddb{1}> trace 
> > > db_enter() at db_enter+0x4
> > > panic() at panic+0xcc
> > > __assert(d0aa7bd0,d0c3e973,155,d0c3ea65) at __assert+0x19
> > > uvm_addr_linsearch(d55a5448,0,f55ecdd4,f55ecefc,0,fffff000,1000,0,1,cd6ce000,cf
> > > 7cf000,1000,2000) at uvm_addr_linsearch+0x20f
> > > uaddr_stack_brk_select(d55a5448,d571bc54,f55ecdd4,f55ecefc,fffff000,1000,0,3,0)
> > >  at uaddr_stack_brk_select+0x139
> > > uvm_addr_invoke(d55a5448,d571bc54,f55ecdd4,f55ecdd0,f55ecefc,fffff000,1000,0,3,
> > > 0) at uvm_addr_invoke+0x49
> > > uvm_map_findspace(d55a5448,f55ecdd4,f55ecdd0,f55ecefc,fffff000,1000,0,3,0)
> > >  at u
> > > vm_map_findspace+0xc9
> > > uvm_map(d55a5448,f55ecefc,fffff000,d508b8d0,fffff000,0,0) at uvm_map+0x350
> > > uvm_mmapfile(d55a5448,f55ecefc,fffff000,3,7,1,d52965a4,fffff000,0,298ef000)
> > >  at u
> > > vm_mmapfile+0x183
> > > sys_mmap(d5484cd8,f55ecf50,f55ecf48) at sys_mmap+0x640
> > > syscall() at syscall+0x25e
> > > --- syscall (number 1398493569) ---
> > > end of kernel
> > > 0xcf7cc684:
> > > ddb{1}> ps
> > >    PID     TID   PPID    UID  S       FLAGS  WAIT          COMMAND
> > > *10715  268073  99201      0  7         0x3                31-1.test
> > >  88582  518825  77338      0  3    0x100083  ttyin         ksh
> > >  77338  466323      1      0  3    0x100080  kqread        tmux
> > >  75876  102140   1175      0  3    0x100083  kqread        tmux
> > >   1175  124590  38749      0  3    0x10008b  pause         ksh
> > >  38749  474856  81963      0  3        0x92  select        sshd
> > >  99201  273058      1      0  3    0x10008b  pause         ksh
> > >  33609  390960      1      0  3    0x100083  ttyin         getty
> > >  77350  137546      1      0  3    0x100083  ttyin         getty
> > >   8930  416025      1      0  3    0x100083  ttyin         getty
> > >  84787  451172      1      0  3    0x100083  ttyin         getty
> > >  28512    2588      1      0  3    0x100083  ttyin         getty
> > >  16195  237415      1      0  3    0x100098  poll          cron
> > >  53204  231786      1     99  3    0x100090  poll          sndiod
> > >  89266  431418      1    110  3    0x100090  poll          sndiod
> > >  72070  285105  22615     95  3    0x100092  kqread        smtpd
> > >  87435   65358  22615    103  3    0x100092  kqread        smtpd
> > >  49475  425645  22615     95  3    0x100092  kqread        smtpd
> > >  52187  409830  22615     95  3    0x100092  kqread        smtpd
> > >  77608  407112  22615     95  3    0x100092  kqread        smtpd
> > >   7272  500885  22615     95  3    0x100092  kqread        smtpd
> > >  22615  268385      1      0  3    0x100080  kqread        smtpd
> > >  81963   34204      1      0  3        0x80  select        sshd
> > >  70679  131909      0      0  3     0x14200  acct          acct
> > >  13990  427341      0      0  3     0x14280  nfsidl        nfsio
> > >  37126  391604      0      0  3     0x14280  nfsidl        nfsio
> > >  50674   97602      0      0  3     0x14280  nfsidl        nfsio
> > >  67161  386556      0      0  3     0x14280  nfsidl        nfsio
> > >  95889  337545      1      0  3    0x100080  poll          ntpd
> > >  67025   75321  46130     83  3    0x100092  poll          ntpd
> > >  46130  225304      1     83  3    0x100092  poll          ntpd
> > >  52906  158025  63070     74  3    0x100092  bpf           pflogd
> > >  63070  235056      1      0  3        0x80  netio         pflogd
> > >  83359   29326  30054     73  3    0x100090  kqread        syslogd
> > >  30054   71190      1      0  3    0x100082  netio         syslogd
> > >   3676  132549      1     77  3    0x100090  poll          dhclient
> > >  35895   91574      1      0  3        0x80  poll          dhclient
> > >   5974  509843  59073    115  3    0x100092  kqread        slaacd
> > >  26756  312288  59073    115  3    0x100092  kqread        slaacd
> > >  59073  506526      1      0  3        0x80  kqread        slaacd
> > >  53920  508940      0      0  3     0x14200  bored         radeon-crtc
> > >  93915  183654      0      0  3     0x14200  bored         ttm_swap
> > >  56066  319851      0      0  3     0x14200  pgzero        zerothread
> > >    329  332710      0      0  3     0x14200  aiodoned      aiodoned
> > >   9590  111062      0      0  3     0x14200  syncer        update
> > >  70756  254117      0      0  3     0x14200  cleaner       cleaner
> > >  96754  259869      0      0  3     0x14200  reaper        reaper
> > >  10343  436008      0      0  3     0x14200  pgdaemon      pagedaemon
> > >  48365  279419      0      0  3     0x14200  bored         crynlk
> > >  19601  383419      0      0  3     0x14200  bored         crypto
> > >  82044  149445      0      0  3     0x14200  usbtsk        usbtask
> > >  47570  436668      0      0  3     0x14200  usbatsk       usbatsk
> > >  90740   91403      0      0  3     0x14200  bored         sensors
> > >  91659  260363      0      0  3  0x40014200  acpi0         acpi0
> > >  47844  346772      0      0  3  0x40014200                idle1
> > >  29247  390058      0      0  3     0x14200  bored         softnet
> > >   2408  161717      0      0  3     0x14200  bored         systqmp
> > >  39922  496564      0      0  3     0x14200  bored         systq
> > >   8283   35126      0      0  3  0x40014200  bored         softclock
> > >  78265   58176      0      0  7  0x40014200                idle0
> > >  16084  227597      0      0  3     0x14200  kmalloc       kmthread
> > >      1  336974      0      0  3        0x82  wait          init
> > >      0       0     -1      0  3     0x10200  scheduler     swapper
> > > ddb{1}> show register
> > > ds                  0x10
> > > es                  0x10
> > > fs                  0x20
> > > gs                     0
> > > edi           0xd0ab09a9        cdce_ca+0x1f5
> > > esi                0x100
> > > ebp           0xf55ecc54
> > > ebx           0xf55ecc7c
> > > edx                  0x2
> > > ecx                    0
> > > eax                  0x1
> > > eip           0xd04e5864        db_enter+0x4
> > > cs                   0x8
> > > eflags             0x202
> > > esp           0xf55ecc54
> > > ss                  0x10
> > > db_enter+0x4:   popl    %ebp
> > 
> 
> 

Reply via email to