system("mkdir -p /tmp/20051128") never returns - Help

This is a discussion on system("mkdir -p /tmp/20051128") never returns - Help ; Hi, I inherited from someone a multithreaded application that issues about 20 or so system() calls. All similar to: system("mkdir -p /tmp/20051124"); (Please hold your flames over the usage of system() in multi-threaded application :-) ) after some time of ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: system("mkdir -p /tmp/20051128") never returns

  1. system("mkdir -p /tmp/20051128") never returns

    Hi,

    I inherited from someone a multithreaded application that issues about 20 or
    so system() calls. All similar to:

    system("mkdir -p /tmp/20051124");
    (Please hold your flames over the usage of system() in multi-threaded
    application :-) )
    after some time of execution it issues the
    system("mkdir -p /tmp/20051128")
    which never returns. Could someone recommend a possible theory why it could
    happen and suggest a strategy of debugging it?

    Note, I have absolutely no problems typing "mkdir -p /tmp/20051128" in a
    separate shell window and executing it.

    HELP!!!!

    Thanx,
    Ed Gokhman



  2. Re: system("mkdir -p /tmp/20051128") never returns

    On Fri, 25 Nov 2005 19:29:57 -0500, egokhman wrote this:

    > Hi,
    >
    > I inherited from someone a multithreaded application that issues about 20
    > or so system() calls. All similar to:
    >
    > system("mkdir -p /tmp/20051124");
    > (Please hold your flames over the usage of system() in multi-threaded
    > application :-) )
    > after some time of execution it issues the system("mkdir -p
    > /tmp/20051128")
    > which never returns. Could someone recommend a possible theory why it
    > could happen and suggest a strategy of debugging it?
    >
    > Note, I have absolutely no problems typing "mkdir -p /tmp/20051128" in a
    > separate shell window and executing it.
    >
    > HELP!!!!
    >
    > Thanx,
    > Ed Gokhman


    Don't know. Is this C/C++, i = system() ? Or Bash try exec() instead?
    In either case maybe the command is failing or the return was lost in the
    multi-threaded env. Maybe you could move the temp dir allocation to the
    start of the application with error messages if the allocation fails.

  3. Re: system("mkdir -p /tmp/20051128") never returns

    "egokhman" writes:
    >Hi,
    >
    >I inherited from someone a multithreaded application that issues about 20 or
    >so system() calls. All similar to:
    >
    >system("mkdir -p /tmp/20051124");
    >(Please hold your flames over the usage of system() in multi-threaded
    >application :-) )
    >after some time of execution it issues the
    >system("mkdir -p /tmp/20051128")
    >which never returns. Could someone recommend a possible theory why it could
    >happen and suggest a strategy of debugging it?


    Don't use system in a multithreaded application and system(3) won't
    hang. Internally system(3) is neither thread-safe, nor re-entrant.

    scott


  4. Re: system("mkdir -p /tmp/20051128") never returns


    Have you tried using strace, it should help you find where the problem
    lies? Strace debugs system calls and signals.


    --
    harryedwards

+ Reply to Thread