1

我正在使用boost processinasync模式从C++应用程序运行 shell 命令。以下代码在LinuxCentOS 7在我的情况下)运行良好,但在Solaris 10. On Solaris 10,返回码是127andstdout并且stderr是空的。

#include <iostream>
#include <thread>
#include <boost/process.hpp>
#include <boost/asio.hpp>

namespace bp = boost::process ;
int main(int argc, char** argv)
{
    std::future<std::string> dataOut;
    std::future<std::string> dataErr;

    std::string command = "ls";
    boost::asio::io_service ios;
    bp::child c(command, bp::std_out > dataOut, bp::std_err > dataErr, ios);
    ios.run();
    c.wait();
    int result = c.exit_code();
    std::string stdOut = dataOut.get();
    std::string stdErr = dataErr.get();
    std::cout << "Exit Code " << result  << std::endl;
    std::cout << "stdOut " << stdOut  << std::endl;
    std::cout << "stdErr " << stdErr  << std::endl;
    return 0;
}

CentOS 7 上的输出

Exit Code 0
stdOut a.out
main.cpp
Process.cpp
Process.h
simple.cpp

stdErr 

Solaris 10 上的输出

Exit Code 127
stdOut 
stdErr 

这是在truss.

23211:  execve("a.out", 0xFFBFF9D4, 0xFFBFF9DC)  argc = 1
23211:   envp:
23211:    MANPATH=/export/home/myname/pkg/man:/export/home/myname/pkg/man:
23211:    TERM=xterm SHELL=/opt/csw/bin/bash
23211:    SSH_CLIENT=202.4.172.216 41055 22 SSH_TTY=/dev/pts/1
23211:    USER=myname MAIL=/var/mail//myname
23211:    PATH=/usr/local/bin:/export/home/myname/pkg/sbin:/export/home/myname/pkg/bin:/opt/csw/bin:/opt/csw/sbin:/usr/sfw/bin:/usr/sfw/sbin:/usr/ccs/bin:/usr/ccs/sbin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin::/opt/csw/java/jdk1.8.0_181/bin:/usr/local/bin:/export/home/myname/pkg/sbin:/export/home/myname/pkg/bin:/usr/bin:/bin:/export/home/myname/.local/bin:/export/home/myname/bin:/opt/solarisstudio12.3/bin:/opt/csw/gnu
23211:    PWD=/export/home/myname/test LANG=en_US.UTF-8 TZ=US/Central
23211:    PS1=\u@\h \[\033[32m\]\w\[\033[33m\]$(parse_git_branch)\[\033[00m\] $ 
23211:    SHLVL=1 HOME=/export/home/myname LOGNAME=myname
23211:    SSH_CONNECTION=202.4.172.216 41055 192.168.253.70 22
23211:    _=/usr/bin/truss OLDPWD=/export/home/myname
23211:  sysinfo(SI_MACHINE, "sun4v", 257)               = 6
23211:  mmap(0x00000000, 32, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON, -1, 0) = 0xFF3E0000
23211:  mmap(0x00000000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0) = 0xFF390000
23211:  mmap(0x00000000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0) = 0xFF380000
23211:  memcntl(0xFF3A0000, 17900, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
23211:  mmap(0x00000000, 8192, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON, -1, 0) = 0xFF370000
23211:  memcntl(0x00010000, 643204, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
23211:  resolvepath("/usr/lib/ld.so.1", "/lib/ld.so.1", 1023) = 12
23211:  getcwd("/export/home/myname/test", 1017)        = 0
23211:  resolvepath("/export/home/myname/test/a.out", "/export/home/myname/test/a.out", 1023) = 30
23211:  stat64("/export/home/myname/test/a.out", 0xFFBFF498) = 0
23211:  open("/var/ld/ld.config", O_RDONLY)             = 3
23211:  fstat64(3, 0xFFBFF008)                          = 0
23211:  mmap(0x00000000, 152, PROT_READ, MAP_SHARED, 3, 0) = 0xFF360000
23211:  close(3)                                        = 0
23211:  stat64("/usr/lib/xyz/libboost_system-mt.so", 0xFFBFEBF8) Err#2 ENOENT
23211:  stat64("/lib/libboost_system-mt.so", 0xFFBFEBF8) Err#2 ENOENT
23211:  stat64("/usr/lib/libboost_system-mt.so", 0xFFBFEBF8) Err#2 ENOENT
23211:  stat64("/usr/local/lib/libboost_system-mt.so", 0xFFBFEBF8) = 0
23211:  resolvepath("/usr/local/lib/libboost_system-mt.so", "/usr/local/lib/libboost_system-mt.so.1.68.0", 1023) = 43
23211:  open("/usr/local/lib/libboost_system-mt.so", O_RDONLY) = 3
23211:  mmap(0x00010000, 21920, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_ALIGN, 3, 0) = 0xFF350000
23211:  mmap(0x00010000, 81920, PROT_NONE, MAP_PRIVATE|MAP_NORESERVE|MAP_ANON|MAP_ALIGN, -1, 0) = 0xFF330000
23211:  mmap(0xFF330000, 14006, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_TEXT, 3, 0) = 0xFF330000
23211:  mmap(0xFF342000, 6496, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_INITDATA, 3, 8192) = 0xFF342000
23211:  munmap(0xFF334000, 57344)                       = 0
23211:  munmap(0xFF350000, 21920)                       = 0
23211:  close(3)                                        = 0
23211:  memcntl(0xFF330000, 7164, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
23211:  stat64("/usr/lib/xyz/libstdc++.so.6", 0xFFBFEBF8) Err#2 ENOENT
23211:  stat64("/lib/libstdc++.so.6", 0xFFBFEBF8)       Err#2 ENOENT
23211:  stat64("/usr/lib/libstdc++.so.6", 0xFFBFEBF8)   Err#2 ENOENT
23211:  stat64("/usr/local/lib/libstdc++.so.6", 0xFFBFEBF8) = 0
23211:  resolvepath("/usr/local/lib/libstdc++.so.6", "/usr/local/lib/libstdc++.so.6.0.22", 1023) = 34
23211:  open("/usr/local/lib/libstdc++.so.6", O_RDONLY) = 3
23211:  mmap(0x00010000, 32768, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_ALIGN, 3, 0) = 0xFF350000
23211:  mmap(0x00010000, 1769472, PROT_NONE, MAP_PRIVATE|MAP_NORESERVE|MAP_ANON|MAP_ALIGN, -1, 0) = 0xFF170000
23211:  mmap(0xFF170000, 1500941, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_TEXT, 3, 0) = 0xFF170000
23211:  mmap(0xFF2EE000, 193000, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_INITDATA, 3, 1499136) = 0xFF2EE000
23211:  mmap(0xFF31E000, 6600, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANON, -1, 0) = 0xFF31E000
23211:  munmap(0xFF2E0000, 57344)                       = 0
23211:  munmap(0xFF350000, 32768)                       = 0
23211:  close(3)                                        = 0
23211:  memcntl(0xFF170000, 552104, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
23211:  stat64("/usr/lib/xyz/libm.so.2", 0xFFBFEBF8) Err#2 ENOENT
23211:  stat64("/lib/libm.so.2", 0xFFBFEBF8)            = 0
23211:  resolvepath("/lib/libm.so.2", "/lib/libm.so.2", 1023) = 14
23211:  open("/lib/libm.so.2", O_RDONLY)                = 3
23211:  mmap(0x00010000, 32768, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_ALIGN, 3, 0) = 0xFF350000
23211:  mmap(0x00010000, 704512, PROT_NONE, MAP_PRIVATE|MAP_NORESERVE|MAP_ANON|MAP_ALIGN, -1, 0) = 0xFF0C0000
23211:  mmap(0xFF0C0000, 617965, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_TEXT, 3, 0) = 0xFF0C0000
23211:  mmap(0xFF166000, 23168, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_INITDATA, 3, 614400) = 0xFF166000
23211:  munmap(0xFF158000, 57344)                       = 0
23211:  munmap(0xFF350000, 32768)                       = 0
23211:  close(3)                                        = 0
23211:  memcntl(0xFF0C0000, 32216, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
23211:  stat64("/usr/lib/xyz/librt.so.1", 0xFFBFEBF8) Err#2 ENOENT
23211:  stat64("/lib/librt.so.1", 0xFFBFEBF8)           = 0
23211:  resolvepath("/lib/librt.so.1", "/lib/librt.so.1", 1023) = 15
23211:  open("/lib/librt.so.1", O_RDONLY)               = 3
23211:  mmap(0x00010000, 32768, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_ALIGN, 3, 0) = 0xFF350000
23211:  mmap(0x00010000, 98304, PROT_NONE, MAP_PRIVATE|MAP_NORESERVE|MAP_ANON|MAP_ALIGN, -1, 0) = 0xFF0A0000
23211:  mmap(0xFF0A0000, 22078, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_TEXT, 3, 0) = 0xFF0A0000
23211:  mmap(0xFF0B6000, 1702, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_INITDATA, 3, 24576) = 0xFF0B6000
23211:  munmap(0xFF0A6000, 65536)                       = 0
23211:  munmap(0xFF350000, 32768)                       = 0
23211:  close(3)                                        = 0
23211:  memcntl(0xFF0A0000, 9364, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
23211:  stat64("/usr/lib/xyz/libgcc_s.so.1", 0xFFBFEBF8) Err#2 ENOENT
23211:  stat64("/lib/libgcc_s.so.1", 0xFFBFEBF8)        Err#2 ENOENT
23211:  stat64("/usr/lib/libgcc_s.so.1", 0xFFBFEBF8)    Err#2 ENOENT
23211:  stat64("/usr/local/lib/libgcc_s.so.1", 0xFFBFEBF8) = 0
23211:  resolvepath("/usr/local/lib/libgcc_s.so.1", "/usr/local/lib/libgcc_s.so.1", 1023) = 28
23211:  open("/usr/local/lib/libgcc_s.so.1", O_RDONLY)  = 3
23211:  mmap(0x00010000, 32768, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_ALIGN, 3, 0) = 0xFF350000
23211:  mmap(0x00010000, 131072, PROT_NONE, MAP_PRIVATE|MAP_NORESERVE|MAP_ANON|MAP_ALIGN, -1, 0) = 0xFF070000
23211:  mmap(0xFF070000, 59984, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_TEXT, 3, 0) = 0xFF070000
23211:  mmap(0xFF08E000, 4696, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_INITDATA, 3, 57344) = 0xFF08E000
23211:  munmap(0xFF080000, 57344)                       = 0
23211:  munmap(0xFF350000, 32768)                       = 0
23211:  close(3)                                        = 0
23211:  memcntl(0xFF070000, 8876, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
23211:  stat64("/usr/lib/xyz/libc.so.1", 0xFFBFEBF8) Err#2 ENOENT
23211:  stat64("/lib/libc.so.1", 0xFFBFEBF8)            = 0
23211:  resolvepath("/lib/libc.so.1", "/lib/libc.so.1", 1023) = 14
23211:  open("/lib/libc.so.1", O_RDONLY)                = 3
23211:  mmap(0x00010000, 32768, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_ALIGN, 3, 0) = 0xFF350000
23211:  mmap(0x00010000, 1368064, PROT_NONE, MAP_PRIVATE|MAP_NORESERVE|MAP_ANON|MAP_ALIGN, -1, 0) = 0xFEF20000
23211:  mmap(0xFEF20000, 1247157, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_TEXT, 3, 0) = 0xFEF20000
23211:  mmap(0xFF062000, 35965, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_INITDATA, 3, 1253376) = 0xFF062000
23211:  mmap(0xFF06C000, 1616, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANON, -1, 0) = 0xFF06C000
23211:  munmap(0xFF052000, 65536)                       = 0
23211:  munmap(0xFF350000, 32768)                       = 0
23211:  close(3)                                        = 0
23211:  mmap(0x00000000, 8192, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON, -1, 0) = 0xFF350000
23211:  memcntl(0xFEF20000, 146148, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
23211:  stat64("/usr/lib/xyz/libpthread.so.1", 0xFFBFEBF8) Err#2 ENOENT
23211:  stat64("/lib/libpthread.so.1", 0xFFBFEBF8)      = 0
23211:  resolvepath("/lib/libpthread.so.1", "/lib/libpthread.so.1", 1023) = 20
23211:  open("/lib/libpthread.so.1", O_RDONLY)          = 3
23211:  mmap(0x00010000, 21472, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_ALIGN, 3, 0) = 0xFEF10000
23211:  munmap(0xFEF14000, 5088)                        = 0
23211:  close(3)                                        = 0
23211:  stat64("/usr/lib/xyz/libaio.so.1", 0xFFBFEBF8) Err#2 ENOENT
23211:  stat64("/lib/libaio.so.1", 0xFFBFEBF8)          = 0
23211:  resolvepath("/lib/libaio.so.1", "/lib/libaio.so.1", 1023) = 16
23211:  open("/lib/libaio.so.1", O_RDONLY)              = 3
23211:  mmap(0x00010000, 32768, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_ALIGN, 3, 0) = 0xFEF00000
23211:  mmap(0x00010000, 106496, PROT_NONE, MAP_PRIVATE|MAP_NORESERVE|MAP_ANON|MAP_ALIGN, -1, 0) = 0xFEEE0000
23211:  mmap(0xFEEE0000, 32736, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_TEXT, 3, 0) = 0xFEEE0000
23211:  mmap(0xFEEF8000, 2002, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_INITDATA, 3, 32768) = 0xFEEF8000
23211:  munmap(0xFEEE8000, 65536)                       = 0
23211:  munmap(0xFEF00000, 32768)                       = 0
23211:  close(3)                                        = 0
23211:  memcntl(0xFEEE0000, 6092, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
23211:  stat64("/usr/lib/xyz/libmd.so.1", 0xFFBFEBF8) Err#2 ENOENT
23211:  stat64("/lib/libmd.so.1", 0xFFBFEBF8)           = 0
23211:  resolvepath("/lib/libmd.so.1", "/lib/libmd.so.1", 1023) = 15
23211:  open("/lib/libmd.so.1", O_RDONLY)               = 3
23211:  mmap(0x00010000, 32768, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_ALIGN, 3, 0) = 0xFEF00000
23211:  mmap(0x00010000, 155648, PROT_NONE, MAP_PRIVATE|MAP_NORESERVE|MAP_ANON|MAP_ALIGN, -1, 0) = 0xFEEB0000
23211:  mmap(0xFEEB0000, 80200, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_TEXT, 3, 0) = 0xFEEB0000
23211:  mmap(0xFEED4000, 716, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_INITDATA, 3, 81920) = 0xFEED4000
23211:  munmap(0xFEEC4000, 65536)                       = 0
23211:  munmap(0xFEF00000, 32768)                       = 0
23211:  close(3)                                        = 0
23211:  memcntl(0xFEEB0000, 1636, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
23211:  mmap(0x00010000, 24576, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON|MAP_ALIGN, -1, 0) = 0xFEF00000
23211:  getcontext(0xFFBFF308)
23211:  getrlimit(RLIMIT_STACK, 0xFFBFF2E8)             = 0
23211:  getpid()                                        = 23211 [23210]
23211:  setustack(0xFEF02AC8)
23211:  sysconfig(_CONFIG_SEM_VALUE_MAX)                = 2147483647
23211:  sysconfig(_CONFIG_STACK_PROT)                   = 7
23211:  stat64("/platform/SUNW,SPARC-Enterprise-T5220/lib/libc_psr.so.1", 0xFFBFE798) = 0
23211:  resolvepath("/platform/SUNW,SPARC-Enterprise-T5220/lib/libc_psr.so.1", "/platform/sun4v/lib/libc_psr.so.1", 1023) = 33
23211:  open("/platform/SUNW,SPARC-Enterprise-T5220/lib/libc_psr.so.1", O_RDONLY) = 3
23211:  mmap(0x00010000, 9244, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_ALIGN, 3, 0) = 0xFEEF0000
23211:  munmap(0xFEEF2000, 1052)                        = 0
23211:  close(3)                                        = 0
23211:  mmap(0x00000000, 8192, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON, -1, 0) = 0xFEED0000
23211:  brk(0x00111620)                                 = 0
23211:  brk(0x00117620)                                 = 0
23211:  schedctl()                                      = 0xFEEA0000
23211:  sigaction(SIGPIPE, 0xFFBFF6B8, 0xFFBFF758)      = 0
23211:  open("/dev/poll", O_RDWR)                       = 3
23211:  pipe()                                          = 4 [5]
23211:  fcntl(4, F_SETFL, FNONBLOCK)                    = 0
23211:  fcntl(5, F_SETFL, FNONBLOCK)                    = 0
23211:  fcntl(4, F_SETFD, 0x00000001)                   = 0
23211:  fcntl(5, F_SETFD, 0x00000001)                   = 0
23211:  write(3, "\0\0\004\0\t\0\0", 8)                 = 8
23211:  pipe()                                          = 6 [7]
23211:  fcntl(6, F_SETFL, FNONBLOCK)                    = 0
23211:  fcntl(7, F_SETFL, FNONBLOCK)                    = 0
23211:  fcntl(6, F_SETFD, 0x00000001)                   = 0
23211:  fcntl(7, F_SETFD, 0x00000001)                   = 0
23211:  brk(0x00117620)                                 = 0
23211:  brk(0x00119620)                                 = 0
23211:  write(5, "\0", 1)                               = 1
23211:  sigfillset(0xFF06B3BC)                          = 0
23211:  sigaction(SIGCLD, 0xFFBFF150, 0x00000000)       = 0
23211:  pipe()                                          = 8 [9]
23211:  fcntl(9, F_SETFD, 0x00000001)                   = 0
23211:  pipe()                                          = 10 [11]
23211:  pipe()                                          = 12 [13]
23211:  fork1()                                         = 23212
23212:  fork1()         (returning as child ...)        = 23211
23211:  lwp_sigmask(SIG_SETMASK, 0x00000000, 0x00000000) = 0xFFBFFEFF [0x0000FFFF]
23212:  getpid()                                        = 23212 [23211]
23211:  close(9)                                        = 0
23212:  lwp_self()                                      = 1
23212:  lwp_sigmask(SIG_SETMASK, 0x00000000, 0x00000000) = 0xFFBFFEFF [0x0000FFFF]
23212:  close(8)                                        = 0
23212:  fcntl(11, F_DUP2FD, 0x00000001)                 = 1
23212:  close(11)                                       = 0
23212:  close(10)                                       = 0
23212:  fcntl(13, F_DUP2FD, 0x00000002)                 = 2
23212:  close(13)                                       = 0
23212:  close(12)                                       = 0
23212:  access("ls", X_OK)                              Err#2 ENOENT
23212:  access("PATH=/usr/local/bin/ls", X_OK)          Err#2 ENOENT
23212:  access("/export/home/myname/pkg/sbin/ls", X_OK) Err#2 ENOENT
23212:  access("/export/home/myname/pkg/bin/ls", X_OK)  Err#2 ENOENT
23212:  access("/opt/csw/bin/ls", X_OK)                 Err#2 ENOENT
23212:  access("/opt/csw/sbin/ls", X_OK)                Err#2 ENOENT
23212:  access("/usr/sfw/bin/ls", X_OK)                 Err#2 ENOENT
23212:  access("/usr/sfw/sbin/ls", X_OK)                Err#2 ENOENT
23212:  access("/usr/ccs/bin/ls", X_OK)                 Err#2 ENOENT
23212:  access("/usr/ccs/sbin/ls", X_OK)                Err#2 ENOENT
23212:  access("/usr/local/bin/ls", X_OK)               Err#2 ENOENT
23212:  access("/usr/local/sbin/ls", X_OK)              Err#2 ENOENT
23212:  access("/usr/bin/ls", X_OK)                     = 0
23211:  read(8, 0xFFBFF4F0, 8)                          = 0
23211:  close(8)                                        = 0
23212:  execve("/usr/bin/ls", 0x00117AD0, 0xFFBFF9DC)  argc = 1
23212:   envp:
23212:    MANPATH=/export/home/myname/pkg/man:/export/home/myname/pkg/man:
23212:    TERM=xterm SHELL=/opt/csw/bin/bash
23212:    SSH_CLIENT=202.4.172.216 41055 22 SSH_TTY=/dev/pts/1
23212:    USER=myname MAIL=/var/mail//myname
23212:    PATH=/usr/local/bin:/export/home/myname/pkg/sbin:/export/home/myname/pkg/bin:/opt/csw/bin:/opt/csw/sbin:/usr/sfw/bin:/usr/sfw/sbin:/usr/ccs/bin:/usr/ccs/sbin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin::/opt/csw/java/jdk1.8.0_181/bin:/usr/local/bin:/export/home/myname/pkg/sbin:/export/home/myname/pkg/bin:/usr/bin:/bin:/export/home/myname/.local/bin:/export/home/myname/bin:/opt/solarisstudio12.3/bin:/opt/csw/gnu
23212:    PWD=/export/home/myname/test LANG=en_US.UTF-8 TZ=US/Central
23212:    PS1=\u@\h \[\033[32m\]\w\[\033[33m\]$(parse_git_branch)\[\033[00m\] $ 
23212:    SHLVL=1 HOME=/export/home/myname LOGNAME=myname
23212:    SSH_CONNECTION=202.4.172.216 41055 192.168.253.70 22
23212:    _=/usr/bin/truss OLDPWD=/export/home/myname
23211:  ioctl(10, FIONBIO, 0xFFBFED90)                  = 0
23211:  readv(10, 0xFFBFECBC, 1)                        = 0
23212:  sysinfo(SI_MACHINE, "sun4v", 257)               = 6
23212:  mmap(0x00000000, 32, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON, -1, 0) = 0xFF3E0000
23211:  write(5, "\0", 1)                               = 1
23212:  mmap(0x00000000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0) = 0xFF390000
23211:  close(11)                                       = 0
23212:  mmap(0x00000000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0) = 0xFF380000
23211:  ioctl(12, FIONBIO, 0xFFBFED18)                  = 0
23211:  readv(12, 0xFFBFEC44, 1)                        = 0
23212:  memcntl(0xFF3A0000, 17900, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
23212:  mmap(0x00000000, 8192, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON, -1, 0) = 0xFF370000
23211:  write(5, "\0", 1)                               = 1
23212:  memcntl(0x00010000, 4032, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
23211:  close(13)                                       = 0
23211:  write(3, "\0\0\006\019\0\0\0\0\0\v".., 24)      = 24
23212:  resolvepath("/usr/lib/ld.so.1", "/lib/ld.so.1", 1023) = 12
23211:  ioctl(3, DP_POLL, 0xFFBFF284)                   = 1
23212:  resolvepath("/usr/bin/ls", "/usr/bin/ls", 1023) = 11
23211:  read(4, "\0\0\0", 1024)                         = 3
23212:  stat64("/usr/bin/ls", 0xFFBFF488)               = 0
23212:  open("/var/ld/ld.config", O_RDONLY)             = 4
23212:  fstat64(4, 0xFFBFEFF8)                          = 0
23211:  close(10)                                       = 0
23212:  mmap(0x00000000, 152, PROT_READ, MAP_SHARED, 4, 0) = 0xFF360000
23211:  write(5, "\0", 1)                               = 1
23212:  close(4)                                        = 0
23211:  close(10)                                       Err#9 EBADF
23212:  stat64("/usr/lib/xyz/libsec.so.1", 0xFFBFEBE8) Err#2 ENOENT
23211:  close(12)                                       = 0
23212:  stat64("/lib/libsec.so.1", 0xFFBFEBE8)          = 0
23211:  write(5, "\0", 1)                               = 1
23211:  close(12)                                       Err#9 EBADF
23212:  resolvepath("/lib/libsec.so.1", "/lib/libsec.so.1", 1023) = 16
23212:  open("/lib/libsec.so.1", O_RDONLY)              = 4
23212:  mmap(0x00010000, 32768, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_ALIGN, 4, 0) = 0xFF350000
23211:  ioctl(1, TCGETA, 0xFFBFF564)                    = 0
23212:  mmap(0x00010000, 90112, PROT_NONE, MAP_PRIVATE|MAP_NORESERVE|MAP_ANON|MAP_ALIGN, -1, 0) = 0xFF330000
23211:  fstat64(1, 0xFFBFF480)                          = 0
23212:  mmap(0xFF330000, 57913, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_TEXT, 4, 0) = 0xFF330000
23212:  mmap(0xFF340000, 13309, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_INITDATA, 4, 65536) = 0xFF340000
23211:  write(1, " E x i t   C o d e   1 2".., 14)      = 14
23212:  mmap(0xFF344000, 5616, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANON, -1, 0) = 0xFF344000
23212:  munmap(0xFF350000, 32768)                       = 0
23211:  write(1, " s t d O u t  \n", 8)                 = 8
23212:  close(4)                                        = 0
23211:  write(1, " s t d E r r  \n", 8)                 = 8
23212:  memcntl(0xFF330000, 14336, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
23211:  write(3, "\0\0\006\b\0\0\0", 8)                 = 8
23212:  stat64("/usr/lib/xyz/libc.so.1", 0xFFBFEBE8) Err#2 ENOENT
23211:  close(6)                                        = 0
23212:  stat64("/lib/libc.so.1", 0xFFBFEBE8)            = 0
23211:  close(7)                                        = 0
23211:  sigaction(SIGCLD, 0xFFBFF398, 0x00000000)       = 0
23212:  resolvepath("/lib/libc.so.1", "/lib/libc.so.1", 1023) = 14
23211:  close(3)                                        = 0
23212:  open("/lib/libc.so.1", O_RDONLY)                = 4
23211:  close(4)                                        = 0
23212:  mmap(0x00010000, 32768, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_ALIGN, 4, 0) = 0xFF350000
23211:  close(5)                                        = 0
23212:  mmap(0x00010000, 1368064, PROT_NONE, MAP_PRIVATE|MAP_NORESERVE|MAP_ANON|MAP_ALIGN, -1, 0) = 0xFF1E0000
23212:  mmap(0xFF1E0000, 1247157, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_TEXT, 4, 0) = 0xFF1E0000
23212:  mmap(0xFF322000, 35965, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_INITDATA, 4, 1253376) = 0xFF322000
23211:  _exit(0)
23212:  mmap(0xFF32C000, 1616, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANON, -1, 0) = 0xFF32C000
23212:  munmap(0xFF312000, 65536)                       = 0
23212:  munmap(0xFF350000, 32768)                       = 0
23212:  close(4)                                        = 0
23212:  memcntl(0xFF1E0000, 146148, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
23212:  stat64("/usr/lib/xyz/libavl.so.1", 0xFFBFEBE8) Err#2 ENOENT
23212:  stat64("/lib/libavl.so.1", 0xFFBFEBE8)          = 0
23212:  resolvepath("/lib/libavl.so.1", "/lib/libavl.so.1", 1023) = 16
23212:  open("/lib/libavl.so.1", O_RDONLY)              = 4
23212:  mmap(0x00010000, 14372, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_ALIGN, 4, 0) = 0xFF350000
23212:  mmap(0x00010000, 81920, PROT_NONE, MAP_PRIVATE|MAP_NORESERVE|MAP_ANON|MAP_ALIGN, -1, 0) = 0xFF1C0000
23212:  mmap(0xFF1C0000, 3316, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_TEXT, 4, 0) = 0xFF1C0000
23212:  mmap(0xFF1D2000, 296, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_INITDATA, 4, 8192) = 0xFF1D2000
23212:  munmap(0xFF1C2000, 65536)                       = 0
23212:  munmap(0xFF350000, 14372)                       = 0
23212:  close(4)                                        = 0
23212:  memcntl(0xFF1C0000, 1128, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
23212:  mmap(0x00010000, 24576, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON|MAP_ALIGN, -1, 0) = 0xFF350000
23212:  getcontext(0xFFBFF2F8)
23212:  getrlimit(RLIMIT_STACK, 0xFFBFF2D8)             = 0
23212:  getpid()                                        = 23212 [1]
23212:  setustack(0xFF352A88)
23212:  brk(0x00027150)                                 = 0
23212:  brk(0x00029150)                                 = 0
23212:  stat64("/platform/SUNW,SPARC-Enterprise-T5220/lib/libc_psr.so.1", 0xFFBFE460) = 0
23212:  resolvepath("/platform/SUNW,SPARC-Enterprise-T5220/lib/libc_psr.so.1", "/platform/sun4v/lib/libc_psr.so.1", 1023) = 33
23212:  open("/platform/SUNW,SPARC-Enterprise-T5220/lib/libc_psr.so.1", O_RDONLY) = 4
23212:  mmap(0x00010000, 9244, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_ALIGN, 4, 0) = 0xFF1B0000
23212:  munmap(0xFF1B2000, 1052)                        = 0
23212:  close(4)                                        = 0
23212:  stat64("/usr/lib/locale/en_US.UTF-8/en_US.UTF-8.so.3", 0xFFBFE740) = 0
23212:  resolvepath("/usr/lib/locale/en_US.UTF-8/en_US.UTF-8.so.3", "/usr/lib/locale/en_US.UTF-8/en_US.UTF-8.so.3", 1023) = 44
23212:  open("/usr/lib/locale/en_US.UTF-8/en_US.UTF-8.so.3", O_RDONLY) = 4
23212:  mmap(0x00010000, 32768, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_ALIGN, 4, 0) = 0xFF1A0000
23212:  mmap(0x00010000, 2301952, PROT_NONE, MAP_PRIVATE|MAP_NORESERVE|MAP_ANON|MAP_ALIGN, -1, 0) = 0xFEF60000
23212:  mmap(0xFEF60000, 2227098, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_TEXT, 4, 0) = 0xFEF60000
23212:  mmap(0xFF18E000, 10090, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_INITDATA, 4, 2220032) = 0xFF18E000
23212:  munmap(0xFF180000, 57344)                       = 0
23212:  munmap(0xFF1A0000, 32768)                       = 0
23212:  close(4)                                        = 0
23212:  mmap(0x00000000, 8192, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON, -1, 0) = 0xFF1A0000
23212:  memcntl(0xFEF60000, 9064, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
23212:  stat64("/usr/lib/locale/en_US.UTF-8/methods_en_US.UTF-8.so.3", 0xFFBFE5F8) = 0
23212:  resolvepath("/usr/lib/locale/en_US.UTF-8/methods_en_US.UTF-8.so.3", "/usr/lib/locale/common/methods_unicode.so.3", 1023) = 43
23212:  open("/usr/lib/locale/en_US.UTF-8/methods_en_US.UTF-8.so.3", O_RDONLY) = 4
23212:  mmap(0x00010000, 32768, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_ALIGN, 4, 0) = 0xFEF50000
23212:  mmap(0x00010000, 131072, PROT_NONE, MAP_PRIVATE|MAP_NORESERVE|MAP_ANON|MAP_ALIGN, -1, 0) = 0xFEF20000
23212:  mmap(0xFEF20000, 58305, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_TEXT, 4, 0) = 0xFEF20000
23212:  mmap(0xFEF3E000, 1436, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_INITDATA, 4, 57344) = 0xFEF3E000
23212:  munmap(0xFEF30000, 57344)                       = 0
23212:  munmap(0xFEF50000, 32768)                       = 0
23212:  close(4)                                        = 0
23212:  memcntl(0xFEF20000, 2824, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
23212:  stat64("/usr/lib/locale/en_US.UTF-8/libc.so.1", 0xFFBFE5F8) Err#2 ENOENT
23212:  time()                                          = 1545021966
23212:  ioctl(1, TCGETA, 0xFFBFF8EC)                    Err#22 EINVAL
23212:  brk(0x00029150)                                 = 0
23212:  brk(0x00033150)                                 = 0
23212:  lstat64(".", 0xFFBFF868)                        = 0
23212:  openat(-3041965, ".", O_RDONLY|O_NDELAY|O_LARGEFILE) = 4
23212:  fcntl(4, F_SETFD, 0x00000001)                   = 0
23212:  fstat64(4, 0xFFBFF748)                          = 0
23212:  getdents64(4, 0xFF354000, 8192)                 = 232
23212:  getdents64(4, 0xFF354000, 8192)                 = 0
23212:  close(4)                                        = 0
23212:  ioctl(1, TCGETA, 0xFFBFD7E4)                    Err#22 EINVAL
23212:  fstat64(1, 0xFFBFD858)                          = 0
23212:  fstat64(1, 0xFFBFD700)                          = 0
23212:  write(1, " a . o u t\n m a i n . c".., 58)      Err#32 EPIPE
23212:      Received signal #13, SIGPIPE [ignored]
23212:  _exit(0)

请帮我弄清楚发生了什么。

4

0 回答 0