Results 1 to 5 of 5

Thread: shutdown problem

  1. #1
    dthompson is offline Registered User
    Name: Don Thompson
    Organization: Digital Federal Credit Union
    Project: credit card fraud monitoring
    Join Date
    Aug 2005
    Location
    south shore mass
    Posts
    10

    Question shutdown problem

    Hi,
    I always get a Segmentation fault when trying to execute shutdown from the php web page. The c++ client shutdown seems to work fine.
    What am I doing wrong? How do I debug?

    thanks,
    Don

    fragment of code in php web page:
    $p = $ICE->stringToProxy("CUCard:tcp -p 10040:udp -p 10040");
    $gcu = $p->ice_checkedCast("::CU::CUCard");
    .....
    $gcu->shutdown();

    ice definition:
    idempotent void shutdown();

    shutdown routine in server:
    void
    CUCardI::shutdown(const Ice::Current & c) {
    DataLog.add(SYS,SHUT,"Server Shutdown");
    DataLog.close();
    shutdown(c);
    }
    Don Thompson
    Digital Federal Credit Union
    www.dcu.org
    Ice Project: credit union core processing prototype which may expand to open source project.
    Current Environment:
    Debian Linux Sarge,
    mysql 4.1.11-Debian,
    mysql++ v 2.1.0.beta1,
    qt3 v 3.3.4,
    Ice-3.0.1
    IcePHP-3.0.1
    Server: c++ using mysql++ to access mysql db, with Ice interfaces.
    Desktop Client: c++ using qt3, Ice interfaces to Server
    Home Banking Client: Python using IcePy interface to Server
    Currently using PHP Client

  2. #2
    mes's Avatar
    mes
    mes is online now ZeroC Staff
    Name: Mark Spruiell
    Organization: ZeroC, Inc.
    Project: Ice Developer
    Join Date
    Feb 2003
    Location
    California
    Posts
    1,441
    Hi Don,

    You'll need to be more specific. In which program does the segmentation fault occur? Your server, or in the Web server where PHP is running?

    If a core file is being created, it would be very helpful to see the stacktrace from the fault.

    Finally, please provide your versions of Ice, PHP, Web server, compiler, and operating system.

    Take care,
    - Mark

  3. #3
    dthompson is offline Registered User
    Name: Don Thompson
    Organization: Digital Federal Credit Union
    Project: credit card fraud monitoring
    Join Date
    Aug 2005
    Location
    south shore mass
    Posts
    10

    shutdown segfault

    Hi,
    I'm continuing to debug the Segmentation fault. Attached are software versions and a traceback.
    Since I have seen some discussion of seg faults on mysql++, upon calling a distructor, I tried to rule that out by removing the Ice waitForShutdown call, thereby going directly to the database class distructors. They all run clean with a clean exit. Also, I think the traceback clearly shows the error is occuring in shutdown. It seems to not like c = 0, which I believe is the ctx. From php, calls, this parameter does not exist??
    Again, when I call server shutdown from a c++ client, it exits cleanly. Also, oddly to me,
    it seems to call shutdown many times. This trace continues with thousands of lines, all the same to CUCardI::shutdown.
    Any ideas, or how to further debug?

    thanks,
    Don

    Versions: Ice-3.0.1 IcePHP-3.0.1 Apache/2.2.0
    gcc version 3.3.5 (Debian 1:3.3.5-13)
    os Debian Sarge

    gdb trace:
    #10 0x40ddf8bc in std:stream:perator<< () from /usr/lib/libstdc++.so.5
    #11 0x080cfa2e in Clogger::add (this=0x80e8780, facility=0, severity=9,
    message=@0x42ba2590) at ostream:199
    #12 0x0807a829 in CUCardI::shutdown (this=0x8111038, c=@0x0) at stl_alloc.h:652
    #13 0x0807a85b in CUCardI::shutdown (this=0x8111038, c=@0x0) at Server.cpp:136
    #14 0x0807a85b in CUCardI::shutdown (this=0x8111038, c=@0x0) at Server.cpp:136
    #15 0x0807a85b in CUCardI::shutdown (this=0x8111038, c=@0x0) at Server.cpp:136
    #16 0x0807a85b in CUCardI::shutdown (this=0x8111038, c=@0x0) at Server.cpp:136
    ---Type <return> to continue, or q <return> to quit---q
    Quit
    (gdb) frame 11
    #11 0x080cfa2e in Clogger::add (this=0x80e8780, facility=0, severity=9,
    message=@0x42ba2590) at ostream:199
    199 return this->operator<<(static_cast<long>(__n));
    (gdb) print severity
    $1 = 9
    (gdb) frame 12
    #12 0x0807a829 in CUCardI::shutdown (this=0x8111038, c=@0x0) at stl_alloc.h:652
    652 allocator() throw() {}
    (gdb) print c
    $3 = (const Ice::Current &) @0x0: Cannot access memory at address 0x0
    (gdb)
    Don Thompson
    Digital Federal Credit Union
    www.dcu.org
    Ice Project: credit union core processing prototype which may expand to open source project.
    Current Environment:
    Debian Linux Sarge,
    mysql 4.1.11-Debian,
    mysql++ v 2.1.0.beta1,
    qt3 v 3.3.4,
    Ice-3.0.1
    IcePHP-3.0.1
    Server: c++ using mysql++ to access mysql db, with Ice interfaces.
    Desktop Client: c++ using qt3, Ice interfaces to Server
    Home Banking Client: Python using IcePy interface to Server
    Currently using PHP Client

  4. #4
    mes's Avatar
    mes
    mes is online now ZeroC Staff
    Name: Mark Spruiell
    Organization: ZeroC, Inc.
    Project: Ice Developer
    Join Date
    Feb 2003
    Location
    California
    Posts
    1,441
    Don,

    Looking at the code you showed in your first message:
    Quote Originally Posted by dthompson
    shutdown routine in server:
    void
    CUCardI::shutdown(const Ice::Current & c) {
    DataLog.add(SYS,SHUT,"Server Shutdown");
    DataLog.close();
    shutdown(c);
    }
    It appears you are calling shutdown recursively, which would explain the very large stack trace.

    - Mark

  5. #5
    dthompson is offline Registered User
    Name: Don Thompson
    Organization: Digital Federal Credit Union
    Project: credit card fraud monitoring
    Join Date
    Aug 2005
    Location
    south shore mass
    Posts
    10

    Talking done!

    Thanks!
    Sometimes it's hard to see the stupid mistakes...somehow the first of the line got cut.

    Don

    CUCardI::shutdown(const Ice::Current & c) {
    DataLog.add(SYS,SHUT,"Server Shutdown");
    DataLog.close();
    std::cout << "CARD Server Shutting down..." << std::endl;
    c.adapter->getCommunicator()->shutdown();
    }
    Don Thompson
    Digital Federal Credit Union
    www.dcu.org
    Ice Project: credit union core processing prototype which may expand to open source project.
    Current Environment:
    Debian Linux Sarge,
    mysql 4.1.11-Debian,
    mysql++ v 2.1.0.beta1,
    qt3 v 3.3.4,
    Ice-3.0.1
    IcePHP-3.0.1
    Server: c++ using mysql++ to access mysql db, with Ice interfaces.
    Desktop Client: c++ using qt3, Ice interfaces to Server
    Home Banking Client: Python using IcePy interface to Server
    Currently using PHP Client

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Shutdown a service
    By spicy in forum Comments
    Replies: 3
    Last Post: 07-06-2007, 09:50 PM
  2. Threads and Shutdown
    By acbell in forum Help Center
    Replies: 1
    Last Post: 11-30-2006, 05:16 AM
  3. Deadlock on Evictor Shutdown
    By acbell in forum Bug Reports
    Replies: 3
    Last Post: 04-26-2006, 09:25 AM
  4. IcePy and shutdown
    By alexm in forum Help Center
    Replies: 6
    Last Post: 04-20-2006, 10:59 PM
  5. Notification on communicator shutdown
    By stephan in forum Help Center
    Replies: 11
    Last Post: 10-13-2004, 04:38 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •