#2726 openwsman server closing 0 descriptor when client release called for cim_client_frontend=sfcbLocal config


when openwsman server configured with cim_client_frontend=sfcbLocal first command get executed successfully but second command on-words failing.

openwsman server and sfcb are connected through sfcbLocal interface. openwsman calling sfcb release function which is closing log descriptor which not open but initialized with 0

trace back from openwsman-sever which calls sfcb release function

#0  ReleaseCIMCEnv (env=0x7fffe8009e70) at cimc/cimcclient.c:98
#1  0x00007ffff15dbdec in cmciRelease (cc=0x7fffe8007390) at frontend/sfcc/sfcclient.c:57
#2  0x00007ffff17e874a in CimResource_destroy (cimclient=cimclient@entry=0x7fffe8008350)
at /root/rpmbuild/BUILD/openwsman-2.3.6/src/plugins/cim/cim_data_stubs.c:85
#3  0x00007ffff17e8fa4 in CimResource_Custom_EP (op=0x7fffe8003e20, appData=<optimized out>, opaqueData=<optimized out>)
at /root/rpmbuild/BUILD/openwsman-2.3.6/src/plugins/cim/cim_data_stubs.c:399
#4  0x00007ffff79bb7a1 in process_inbound_operation (opaqueData=0x0, msg=0x7fffe8000c00, op=0x7fffe8003e20)
at /root/rpmbuild/BUILD/openwsman-2.3.6/src/lib/wsman-dispatcher.c:725
#5  dispatch_inbound_call (soap=soap@entry=0x555555903e40, msg=msg@entry=0x7fffe8000c00, opaqueData=opaqueData@entry=0x0)
at /root/rpmbuild/BUILD/openwsman-2.3.6/src/lib/wsman-dispatcher.c:812
#6  0x0000555555562f28 in server_callback (arg=0x7fffefd9cbe0) at /root/rpmbuild/BUILD/openwsman-2.3.6/src/server/wsmand-listener.c:247
#7  0x000055555556058e in call_user (c=0x555555953200, arg=arg@entry=0x7fffefd9cbe0, func=<optimized out>)
at /root/rpmbuild/BUILD/openwsman-2.3.6/src/server/shttpd/io_emb.c:44
#8  0x00005555555609da in do_embedded (stream=<optimized out>, buf=0x0, len=0)
at /root/rpmbuild/BUILD/openwsman-2.3.6/src/server/shttpd/io_emb.c:79
#9  0x000055555555b5e8 in write_stream (from=from@entry=0x5555559533d8, to=to@entry=0x555555953368)
at /root/rpmbuild/BUILD/openwsman-2.3.6/src/server/shttpd/shttpd.c:921
#10 0x000055555555cac0 in process_connection (local_ready=0, remote_ready=<optimized out>, c=0x555555953200)
at /root/rpmbuild/BUILD/openwsman-2.3.6/src/server/shttpd/shttpd.c:1080
#11 shttpd_poll (ctx=0x5555559194d0, milliseconds=milliseconds@entry=1000)
at /root/rpmbuild/BUILD/openwsman-2.3.6/src/server/shttpd/shttpd.c:1228
#12 0x0000555555562a5e in thread_function (param=0x555555919000) at /root/rpmbuild/BUILD/openwsman-2.3.6/src/server/wsmand-listener.c:618
#13 0x00007ffff6964df3 in start_thread (arg=0x7fffefd9d700) at pthread_create.c:308
#14 0x00007ffff628739d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113


  • prabhakar pujeri

    following code change will fix this issue
    check pipe creation is successful
    checking if log descriptor other then zero then only close it

    diff --git a/mlog.c b/mlog.c
    index 8fb78b2..5a17336 100644
    --- a/mlog.c
    +++ b/mlog.c
    @@ -98,8 +98,11 @@ void startLogging(int level, int thread) {
    - pipe(logfds);
    + if ( pipe(logfds)!= 0 ){
    + fprintf(stderr,"*** Not able to create pipe\n");
    + abort();
    + }
    int lpid;

    lpid = fork();
    @@ -132,7 +135,9 @@ void startLogging(int level, int thread) {
    void closeLogging() {
    int wstat;
    - close(logfds[1]);
    + if(logfds[1] !=0) {
    + close(logfds[1]);
    + }
    wait(&wstat); // wait to prevent zombie

    Last edit: prabhakar pujeri 2014-02-24
  • Chris Buccella

    Chris Buccella - 2014-02-25
    • assigned_to: Dave Heller
  • Dave Heller

    Dave Heller - 2014-02-26

    This is a duplicate of [bugs:#2347]. See the comments on page 2 of that bug. There was a regression from the original patch and then a fix from Klaus at Novell. The fix is upstream in SFCB 1.4.6 or greater, with the following commit:

    66e4ab2 on Wed Sep 18 15:19:08 2013 -0400 by buccella: [sfcb-tix:#69] Fix logger for long-lived clients, was: "#2347 Don't spawn logger for clients"

    And in SFCB 1.3.18-preview (not in a release yet):

    b6344bc on Wed Sep 18 18:57:14 2013 -0400 by buccella: [sfcb-tix:#69] Fix logger for long-lived clients, was: "#2347 Don't spawn logger for clients"

    Looking at your patch it looks like you are using SFCB 1.3 prior to commit b6344bc. Please upgrade to the lastest upstream 1.3 -- or better still: v1.4! -- and see if it fixes your problem. I am using the latest SFCB 1.4 with the distro versions of openwsman-server and sblim-sfcc on Fedora 20, and it works fine.



    Bugs: #2347
    SFCB: #69

  • prabhakar pujeri

    --- mlog.c~ 2013-08-08 10:41:20.568308975 +0200
    +++ mlog.c 2013-08-08 10:46:48.086016403 +0200
    @@ -90,6 +90,9 @@
    / if we're a client, just open the log and
    don't start a logger.
    if (! thread ) {
    + pipe(logfds);
    + close(logfds[0]); / close read end /
    + log_w_stream = fdopen(logfds[1], "w");

    above fixes the issue but its not included in upstream

  • Dave Heller

    Dave Heller - 2014-02-26

    You are saying, you are still experiencing the problem even with the aforementioned patch?

    Please report what versions of SFCB, SFCC and openwsman you are running.

  • prabhakar pujeri


    we already included patch you mentioned but not working recommend to include this patch https://sourceforge.net/p/sblim/bugs/2726/#89d8

  • Dave Heller

    Dave Heller - 2014-03-05

    As I mentioned, the patch you require is not in SFCB 1.3.16. It is in SFCB 1.3.18-preview, meaning that it is upstream but not yet in an official release. The SFCB 1.3 branch is in maintenance mode so we don't do releases very often (although I admit, it's probably time to do one). In the interim you have the following choices:

    1. Build the latest upstream SFCB 1.3 by pulling from git, like:

      git clone -b master_1.3 git://git.code.sf.net/p/sblim/sfcb
      (cd sfcb; git clone git://git.code.sf.net/p/sblim/mofc)
      (cd sfcb; autoconfiscate.sh && configure --enable-ssl --enable-ipv6 && make && make install && make postinstall)

    2. Get the tarball from the git web view of the latest upstream, click on "download snapshot", build using the same process as above:

    3. (recommended): upgrade to the latest SFCB v1.4! More complete / updated build instructions can be found here:


  • Dave Heller

    Dave Heller - 2014-03-28
    • status: pending-duplicate --> closed-duplicate

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks