Skip to content
Snippets Groups Projects
  1. Dec 13, 2013
  2. Dec 12, 2013
  3. Dec 11, 2013
  4. Dec 10, 2013
    • Nadav Har'El's avatar
      Fix shared-object finalization · 4d24b90a
      Nadav Har'El authored
      
      This patch fixes two bugs in shared-object finalization, i.e., running
      its static destructors before it is unloaded. The bugs were seen when
      osv::run()ing a test program using libboost_unit_test_framework-mt.so,
      which crashed after the test program finished.
      
      The two related bugs were:
      
      1. We need to call the module's destructors (run_fini_funcs()) *before*
         removing it from the module list, otherwise the destructors will not
         be able to call functions from this module! (we got a symbol not
         found error in the destructor).
      
      2. We need to unload the modules needed by this module *before* unloading
         this module, not after like was (implictly) done until now.
         This makes sense because of symmetry (during a module load, the needed
         modules are loaded after this one), but also practically: a needed
         module's destructor (in our case, boost unit test framework) might refer
         to objects in the needing module (in our case, the test program),
         so we cannot call the needed module's destructor after we've already
         unloaded the needing module.
      
      Signed-off-by: default avatarNadav Har'El <nyh@cloudius-systems.com>
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      4d24b90a
    • Juan Antonio Osorio's avatar
    • Pekka Enberg's avatar
      test.py: add '--repeat' option · 3acafce2
      Pekka Enberg authored
      
      Add a '--repeat' option to test.py that repeats the test suite until a
      test fails.  This is useful for detecting test cases that fail some of
      the time.
      
      Reviewed-by: default avatarTomasz Grabiec <tgrabiec@gmail.com>
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      3acafce2
    • Pekka Enberg's avatar
      test.py: Make output pretty and show duration · fbf2a946
      Pekka Enberg authored
      
      Make the test runner output look pretty and show test duration to make
      it visible which tests take the longest time to run.  The output looks
      as follows now:
      
          TEST tst-af-local.so           OK  (3.288 s)
          TEST tst-bdev-write.so         OK  (1.058 s)
          TEST tst-bsd-evh.so            OK  (1.071 s)
          TEST tst-bsd-kthread.so        OK  (1.234 s)
          TEST tst-bsd-taskqueue.so      OK  (1.062 s)
          TEST tst-bsd-tcp1.so           OK  (2.114 s)
          TEST tst-commands.so           OK  (1.141 s)
          TEST tst-condvar.so            OK  (1.776 s)
          TEST tst-dns-resolver.so       OK  (2.560 s)
          TEST tst-epoll.so              OK  (1.952 s)
          TEST tst-except.so             OK  (1.146 s)
          TEST tst-fpu.so                OK  (2.630 s)
          TEST tst-fs-link.so            OK  (1.051 s)
          TEST tst-fs-stress.so          OK  (1.027 s)
          TEST tst-fsx.so                OK  (1.067 s)
          TEST tst-hub.so                OK  (6.256 s)
          TEST tst-huge.so               OK  (2.199 s)
          TEST tst-kill.so               OK  (4.147 s)
          TEST tst-libc-locking.so       OK  (2.110 s)
          TEST tst-loadbalance.so        OK  (1.070 s)
          TEST tst-mmap-file.so          OK  (1.080 s)
          TEST tst-mmap.so               OK  (1.087 s)
          TEST tst-pipe.so               OK  (7.306 s)
          TEST tst-preempt.so            OK  (1.119 s)
          TEST tst-pthread.so            OK  (1.100 s)
          TEST tst-queue-mpsc.so         OK  (3.748 s)
          TEST tst-ramdisk.so            OK  (1.078 s)
          TEST tst-readdir.so            OK  (1.094 s)
          TEST tst-remove.so             OK  (1.030 s)
          TEST tst-rename.so             OK  (1.157 s)
          TEST tst-resolve.so            OK  (1.095 s)
          TEST tst-scheduler.so          OK  (1.087 s)
          TEST tst-sleep.so              OK  (3.083 s)
          TEST tst-solaris-taskq.so      OK  (1.061 s)
          TEST tst-stat.so               OK  (1.106 s)
          TEST tst-strerror_r.so         OK  (1.102 s)
          TEST tst-tcp-sendonly.so       OK  (2.014 s)
          TEST tst-tcp.so                OK  (1.080 s)
          TEST tst-threadcomplete.so     OK  (2.770 s)
          TEST tst-tracepoint.so         OK  (1.109 s)
          TEST tst-truncate.so           OK  (1.083 s)
          TEST tst-utimes.so             OK  (1.079 s)
          TEST tst-vblk.so               OK  (1.310 s)
          TEST tst-vfs.so                OK  (1.118 s)
          TEST tst-yield.so              OK  (1.992 s)
          TEST tst-zfs-mount.so          OK  (1.087 s)
        OK (58 tests run, 82.944 s)
      
      Reviewed-by: default avatarNadav Har'El <nyh@cloudius-systems.com>
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      fbf2a946
    • Pekka Enberg's avatar
      test.py: Switch to blacklist · 637eb584
      Pekka Enberg authored
      
      Switch the whitelist to a blacklist to increase testing coverage.
      
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      637eb584
    • Raphael S. Carvalho's avatar
    • Raphael S. Carvalho's avatar
      vfs: Fix duplicate in-memory vnodes · 9ecda822
      Raphael S. Carvalho authored
      
      Currently, namei() does vget() unconditionally if no dentry is found.
      This is wrong because the path can be a hard link that points to a vnode
      that's already in memory.
      
      To fix the problem:
      
        - Use inode number as part of the hash in vget()
      
        - Use vn_lookup() in vget() to make sure we have one vnode in memory
          per inode number.
      
        - Push the vget() calls down to individual filesystems and make
          VOP_LOOKUP return an vnode
      
      Changes since v2:
        - v1 dropped lock in vn_lookup, thus assert that vnode_lock is held.
      
      Changes since v3:
        - Fix lock ordering issue in dentry_lookup. The lock respective to the parent
      node must be acquired before dentry_lookup and released after the process is
      done. Otherwise, a second thread looking up for the same dentry may take the
      'NULL' path incorrectly.
      
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      Signed-off-by: default avatarRaphael S. Carvalho <raphaelsc@cloudius-systems.com>
      Signed-off-by: default avatarAvi Kivity <avi@cloudius-systems.com>
      9ecda822
    • Avi Kivity's avatar
      tst-threadcomplete: fix race between t2 running and t1 destroying · a95e2f5c
      Avi Kivity authored
      
              sched::thread *t2 = nullptr;
              sched::thread *t1 = new sched::thread([&]{
                  // wait for the t2 object to exist (not necessarily run)
                  sched::thread::wait_until([&] { return t2 != nullptr; });
                  if (quick) {
                      return;
                  }
                  sched::thread::sleep_until(nanotime() + 10_ms);
              }, sched::thread::attr(sched::cpus[0]));
      
              t2 = new sched::thread([&]{
                  t1->wake();
              }, sched::thread::attr(sched::cpus[1]));
      
              t1->start();
              t2->start();
              delete t1
              delete t2;
      
      t1 may start, complete, and be destroyed before t2 gets a chance to run.  In
      this case the call to t1->wake() will access deallocated memory.
      
      Fix by making sure t1 is only destroyed after t2 completes.
      
      Reviewed-by: default avatarGlauber Costa <glommer@cloudius-systems.com>
      Signed-off-by: default avatarAvi Kivity <avi@cloudius-systems.com>
      a95e2f5c
    • Pekka Enberg's avatar
      test.py: Make test runner silent by default · af70c145
      Pekka Enberg authored
      
      Make test.py silent by default and only print out OSv log on error or if
      the '--verbose' command line option is passed.
      
      Reviewed-by: default avatarTomasz Grabiec <tgrabiec@gmail.com>
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      af70c145
    • Nadav Har'El's avatar
      Fix wrong error codes in unlink(), rmdir() and readdir() · 86b5374f
      Nadav Har'El authored
      
      This patch fixes the error codes in four error cases:
      
      1. unlink() of a directory used to return EPERM (as in Posix), and now
         returns EISDIR (as in Linux).
      
      2. rmdir() of a non-empty directory used to return EEXIST (as in Posix)
         and now returns ENOTEMPTY (as in Linux).
      
      3. rmdir() of a regular file (non-directory) used to return EBADF
         and now returns ENOTDIR (as in Linux).
      
      4. readdir() of a regular file (non-directory) used to return EBADF
         and now returns ENOTDIR (as in Linux).
      
      This patch also adds a test, tst-remove.cc, for the various unlink() and
      rmdir() success and failure modes.
      
      Fixes #123.
      
      Signed-off-by: default avatarNadav Har'El <nyh@cloudius-systems.com>
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      86b5374f
Loading