Home Help Center

Client disconnect causes server to shutdown

cmeyerscmeyers Member Curt MeyersOrganization: Willow Garage Inc.Project: Autonomous Boat
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

  • cmeyerscmeyers Member Curt MeyersOrganization: Willow Garage Inc.Project: Autonomous Boat
    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?
  • matthewmatthew NL, CanadaMember Matthew NewhookOrganization: ZeroC, Inc.Project: Internet Communications Engine ✭✭✭
    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.
  • cmeyerscmeyers Member Curt MeyersOrganization: Willow Garage Inc.Project: Autonomous Boat
    I put a print statement in the while loop and it prints continuously when I start the server, so yes it is spinning.
  • cmeyerscmeyers Member Curt MeyersOrganization: Willow Garage Inc.Project: Autonomous Boat
    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.
  • cmeyerscmeyers Member Curt MeyersOrganization: Willow Garage Inc.Project: Autonomous Boat
    The call to pthread_cond_wait in Cond.h is not working :confused:

    Any ideas?
  • matthewmatthew NL, CanadaMember Matthew NewhookOrganization: ZeroC, Inc.Project: Internet Communications Engine ✭✭✭
    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.
  • cmeyerscmeyers Member Curt MeyersOrganization: Willow Garage Inc.Project: Autonomous Boat
    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.
  • matthewmatthew NL, CanadaMember Matthew NewhookOrganization: ZeroC, Inc.Project: Internet Communications Engine ✭✭✭
    Glad to hear everything is solved for you!
Sign In or Register to comment.