Archived

This forum has been archived. Please start a new discussion on GitHub.

Client disconnect causes server to shutdown

I have built an application using Ice-E.

I have the code built and running on a desktop machine running linux with an Intel processor and it works fine.

I have cross compiled Ice-E to run on an ARM processor that is running linux.

When I run the server side on the ARM processor the server shuts down when a client disconnects. This exact same code runs on my Intel box. Do you have any suggestions?

I currently do not have a way to run a debugger on the ARM system.

Comments

  • Further information:

    I placed a print statement in the function ObjectAdapterFactory::waitForShutdown()

    and found that the code
    while(_instance)
    {
    wait();
    }

    is looping continuously but on my Intel box it doesn't even enter this while loop.

    Any ideas what this means?
  • matthew
    matthew NL, Canada
    If the code never waits in that loop then it means that something called shutdown prior to the code entering this function. When you say looping continuously do you mean spinning? The code should not spin, as it is using a monitor (and therefore a condition variable) to wait. This should not consume CPU while waiting to be signaled.
  • I put a print statement in the while loop and it prints continuously when I start the server, so yes it is spinning.
  • It seems that "_instance" should not be valid yet when the server starts and has called waitForShutdown() before any connections are made.

    I feel that there is a memory problem, maybe my cross compiled version of IceE is picking up the wrong header files when it is built.
  • The call to pthread_cond_wait in Cond.h is not working :confused:

    Any ideas?
  • matthew
    matthew NL, Canada
    It seems that your cross-compilation environment is not setup correctly. If basic things like pthread_cond_wait do not work, then you have a serious problem.
  • Solved the problem. Seems that the compiler was picking up the wrong header files when I was cross compiling. The pthread header is full of ifdef statements and possibly was the cause of the problem.

    The lesson is to not use the "-B" option with gcc but instead use the "-isystem" option to specify the location of the header files when cross compiling.
  • matthew
    matthew NL, Canada
    Glad to hear everything is solved for you!