The following is dead code, i.e. not reachable from public interfaces or covered by tests:

  • trusted/sandbox - ptrace()-based sandbox for Linux

    • This is not used and it seems unlikely that we'd use it, given that Chromium is switching to use the seccomp sandbox from the SUID sandbox. ptrace() is slow, complicated and not designed for security.
  • trusted/service_runtime/fs - Some sort of filesystem. Not used.

  • nacl_cur_thread_key, GetCurThread, GetCurProc in trusted/service_runtime/nacl_globals.c - Removed

    • These might be used in the future for supporting x86-64 on Mac OS X.
  • NaClTsd*() in shared/platform/linux/nacl_threads.c - Removed

    • Ditto. Might be used for x86-64 on Mac.
  • NaClAppDtor() in sel_ldr.c, and the various functions it calls. - Removed

    • This is not completely dead, but it is rarely called. sel_ldr normally just does exit() to shut down the process. NaClAppDtor() is only called if sel_ldr gets an error during startup.
    • There is a TODO to remove this function.
    • See also http://code.google.com/p/nativeclient/issues/detail?id=560
  • The field holding_sr_locks in struct NaClAppThread, and anything that sets it. (Nothing reads it.)

    • The comments in nacl_app_thread.h say this is intended as a way to kill another thread. It mentions using pthread_kill(), but this does not work for killing threads on Linux.
  • Memory objects recorded in the mapping list? Since we don‘t support mremap() or relocating the address space (a hack that was proposed for Windows but is not implemented), I don’t think the memory objects are used.

  • service_runtime/web_worker_stub.c

  • service_runtime/main.c: Some sort of wrapper that uses dlopen()

  • origin field in struct NaClApp - Removed

  • “chroot me” functionality in sel_main.c (NACL_SANDBOX_CHROOT_FD). This is not strictly dead, but there are no users for it. There are no tests for it.

  • ioctl syscall and method. These are both no-ops. I shouldn‘t think we’d ever support an ioctl() syscall, so we should remove the stubs.

  • srpc_get_fd(). This is called, but the result is never used as a file descriptor number. The result is only ever compared with -1, to determine whether the process is running in standalone mode or from the browser plugin. The same result could be achieved with an environment variable. - Removed

  • LogAtServiceRuntime() in the plugin. - Removed

This has all become dead as a result of removing SDL support and video/audio syscalls from sel_ldr: * The “result” field in NaClAppThread: object created but not used. * service_runtime/nacl_bottom_half.c * The “work_queue” field in NaClApp: read from but never written to. * service_runtime/nacl_sync_queue.c * service_runtime/nacl_closure.c * The “restrict_to_main_thread” field in NaClApp - Removed * The “is_privileged” field in NaClAppThread - Removed