On 2015-12-09 at 18:06 "'Davide Libenzi' via Akaros"
<[email protected]> wrote:
> So, what is a case that trips?
> Can you give me a way to reproduce? From your email is not clear.

If you:

- checkout origin/nasty-bug
- make userclean
- make tests
- make fill-kfs
- make
- run akaros

/ $ ash ifconfig
/ $ ash epoll_server

should hang, CTRL-G should work (can ps, etc)

CTRL-B

should hang and when you look at the registers in qemu, you should see
the same ones i had in my original email.

note that the check here:

        if (frame[0] == fp) {
//          printk("fp %p, frame[0] %p, frame %p, *fp %p\n", fp, frame[0],
//                 frame, *(uintptr_t*)fp);                                     
  
            while (1) ;                     

        }

will also trip on a successful BT, since copy_from_user PF'd and the
copy didn't happen.  if that happens, you should see:

Core 0 is in __handler_kernel_page_fault() at kern/arch/x86/trap.c:289

(among other things).

I gotta run for now - will bang my face into my keyboard some more
tomorrow.  =)

Barret



> 
> 
> On Wed, Dec 9, 2015 at 6:02 PM, Barret Rhoden <[email protected]>
> wrote:
> 
> > On 2015-12-10 at 00:53 ron minnich <[email protected]> wrote:
> > > yeah I talked to barrett about this one and it seems D is not set.
> > > Would have been nice!
> >
> > yep, tried that one.  =(
> >
> > i figure it's something crazy like that though.
> >
> > i tried taking the code out of its current location and do something
> > similar, but couldn't trigger it:
> >
> > e.g.
> >
> > void xme(void)
> > {
> >     void *uaddr;
> >     uintptr_t frame[2];
> >     uintptr_t test[2];
> >     int err;
> >
> >     assert(current);
> >     uaddr = mmap(current, 0, PGSIZE, PROT_READ | PROT_WRITE,
> > MAP_ANON, -1, 0);
> >     assert(uaddr);
> >
> >     frame[0] = 0x0102030405060708;
> >     frame[1] = 0xa0b0c0d0e0f01122;
> >
> >     memcpy(uaddr, frame, 2 * sizeof(uintptr_t));
> >     memcpy(test, uaddr, 2 * sizeof(uintptr_t));
> >
> >     assert(memcmp(frame, test, 2 * sizeof(uintptr_t)) == 0);
> >
> >     memset(test, 0, 2 * sizeof(uintptr_t));
> >
> >     asm volatile("nop;nop;nop;");
> >     err = copy_from_user(test, uaddr, 2 * sizeof(uintptr_t));
> >     asm volatile("nop;nop;nop;");
> >
> >     assert(!err);
> >     assert(memcmp(frame, test, 2 * sizeof(uintptr_t)) == 0);
> >
> > }
> >
> > and kfunc xme, or also run it from CTRL-Q (k/a/x/init.c).  but those
> > didn't trip.
> >
> > then i figured i'd try forgetting the uaddr, and just clobber some
> > user memory with the same uaddr as in the failing case
> > (0x00007f7fffbfef50).  that didn't make a difference either.  the
> > alignment on both src and dst is 0x10, so that seems fine too.
> >
> >
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Akaros" group.
> > To unsubscribe from this group and stop receiving emails from it,
> > send an email to [email protected].
> > To post to this group, send email to [email protected].
> > For more options, visit https://groups.google.com/d/optout.
> >
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Akaros" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to