Giter VIP home page Giter VIP logo

Comments (6)

simsong avatar simsong commented on June 25, 2024

from tcpflow.

erik4711 avatar erik4711 commented on June 25, 2024

Here's the tail from strace's output:

set_tid_address(0x7f1399d0eb90)         = 11527
set_robust_list(0x7f1399d0eba0, 24)     = 0
rt_sigaction(SIGRTMIN, {sa_handler=0x7f1398163cb0, sa_mask=[], sa_flags=SA_RESTORER|SA_SIGINFO, sa_restorer=0x7f1398170980}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {sa_handler=0x7f1398163d50, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f1398170980}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
brk(NULL)                               = 0x5569f2474000
brk(0x5569f2495000)                     = 0x5569f2495000
futex(0x7f1398cb909c, FUTEX_WAKE_PRIVATE, 2147483647) = 0
futex(0x7f1398cb90a8, FUTEX_WAKE_PRIVATE, 2147483647) = 0
brk(0x5569f24b6000)                     = 0x5569f24b6000
prlimit64(0, RLIMIT_NOFILE, NULL, {rlim_cur=1024, rlim_max=1024*1024}) = 0
getpid()                                = 11527
brk(0x5569f24d7000)                     = 0x5569f24d7000
brk(0x5569f24f8000)                     = 0x5569f24f8000
brk(0x5569f2519000)                     = 0x5569f2519000
brk(0x5569f253a000)                     = 0x5569f253a000
brk(0x5569f255b000)                     = 0x5569f255b000
brk(0x5569f257c000)                     = 0x5569f257c000
brk(0x5569f259d000)                     = 0x5569f259d000
brk(0x5569f25be000)                     = 0x5569f25be000
brk(0x5569f25df000)                     = 0x5569f25df000
brk(0x5569f2600000)                     = 0x5569f2600000
brk(0x5569f2621000)                     = 0x5569f2621000
brk(0x5569f2642000)                     = 0x5569f2642000
brk(0x5569f2663000)                     = 0x5569f2663000
brk(0x5569f2684000)                     = 0x5569f2684000
brk(0x5569f26a5000)                     = 0x5569f26a5000
brk(0x5569f26c6000)                     = 0x5569f26c6000
brk(0x5569f26e7000)                     = 0x5569f26e7000
brk(0x5569f2708000)                     = 0x5569f2708000
brk(0x5569f2729000)                     = 0x5569f2729000
brk(0x5569f274a000)                     = 0x5569f274a000
brk(0x5569f276b000)                     = 0x5569f276b000
brk(0x5569f278c000)                     = 0x5569f278c000
brk(0x5569f27ad000)                     = 0x5569f27ad000
stat(".", {st_mode=S_IFDIR|0755, st_size=16384, ...}) = 0
access(".", W_OK)                       = -1 EROFS (Read-only file system)
futex(0x7f13985941a0, FUTEX_WAKE_PRIVATE, 2147483647) = 0
write(2, "terminate called after throwing "..., 48terminate called after throwing an instance of ') = 48
write(2, "std::invalid_argument*", 22std::invalid_argument*)  = 22
write(2, "'\n", 2'
)                      = 2
rt_sigprocmask(SIG_UNBLOCK, [ABRT], NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1], [], 8) = 0
getpid()                                = 11527
gettid()                                = 11527
tgkill(11527, 11527, SIGABRT)           = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
--- SIGABRT {si_signo=SIGABRT, si_code=SI_TKILL, si_pid=11527, si_uid=1000} ---
+++ killed by SIGABRT (core dumped) +++

from tcpflow.

simsong avatar simsong commented on June 25, 2024

That's great. If you can compile it with debug symbols, we will get a full stack trace. Without it, it looks like the problem is coming from here:

if ((outdir != NO_OUTDIR) && (access(outdir.c_str(),W_OK)!=0)) {
throw new std::invalid_argument("output directory not writable");
}

Can you try running with -o /tmp/tempdir$$ to see if that resolves your problem?

from tcpflow.

erik4711 avatar erik4711 commented on June 25, 2024

Yes changing output dir to a writeable one with -o resolves the problem.
Would it be possible to avoid throwing that exception when -c or -C is used together with -S enable_report=NO, since nothing will be written to disk in these cases? Personally I would probably have removed that if statement altogether since it doesn't add any significant improvement over what would have happened if tcpflow would attempt to actually write data to a write protected directory.

It would also make sense setting -S enable_report to NO by default when -c or -C is used (feature request).

from tcpflow.

simsong avatar simsong commented on June 25, 2024

from tcpflow.

erik4711 avatar erik4711 commented on June 25, 2024

Okay, thanks. I understand.
You're right, I want to disable all file output and only push reassembled TCP to stdout. However, to my knowledge nothing is written to disk if I run this command from a directory with write permissions or if I use -o /somewhereicanwrite. Would it be possible to just replace the
throw new std::invalid_argument("output directory not writable");
with something that just writes a warning message to stderr and then proceeds? That would most likely be sufficient for what I need and not require a huge rewrite.

from tcpflow.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.