Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 04-05-2004
galbe galbe is offline
Registered User
 
 
Join Date: Oct 2003
Location: Bielefeld/Germany
Posts: 25
problem debugging child processes

Hello

I have a problem, debugging child-processes. This problem does ONLY occur, if the process is linked to libIceUtil and if I'm trying to attach the degugger to the child-process. Otherwise(attaching to parent-process using libIceUtil, attaching to child-process using libpthread, etc.) it's possible to attach to the process without problems.
I'm using gdb 5.2, g++ 3.2.3 on a SuSe Linux with Kernel 2.4.20.

Below is a simple testprogram to replicate the behaviour (hopefully.. ) and the output of the debugger.

Has anyone experienced similar behaviour? Or is this a known problem with a known workaround?

Or maybe I'm doing something wrong.. ?

Thanx in advance for any help or suggestions.

Gerald

Code:
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <iostream>

using namespace std;

int main(int argc, char** argv) {

   pid_t pid;

   if ( (pid = fork()) <0) {
      cerr << "Couldn't start programm." << endl;;
      exit(-1);
   }else if (pid != 0) {
      cerr << "started Process " << pid << "." << endl;
      exit(0);
   }

   sleep(120);

   return 0;
}
Quote:
galbe@britto:~/tmp/test/debug > g++ -g -L/vol/vampire/lib -lIceUtil testprogramm.cpp -o testprogramm
galbe@britto:~/tmp/test/debug > testprogramm
started Process 12641.
galbe@britto:~/tmp/test/debug > gdb testprogramm
GNU gdb 5.2
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-suse-linux"...
(gdb) attach 12641
Attaching to program: /homes/galbe/tmp/test/debug/testprogramm, process 12641
Reading symbols from /vol/vampire/lib/libIce.so.12...done.
Loaded symbols for /vol/vampire/lib/libIce.so.12
Reading symbols from /vol/vampire/lib/libIceUtil.so.12...done.
Loaded symbols for /vol/vampire/lib/libIceUtil.so.12
Reading symbols from /vol/vampire/gcc-3.2.3/lib/libstdc++.so.5...done.
Loaded symbols for /vol/vampire/gcc-3.2.3/lib/libstdc++.so.5
Reading symbols from /lib/libm.so.6...done.
Loaded symbols for /lib/libm.so.6
Reading symbols from /vol/vampire/gcc-3.2.3/lib/libgcc_s.so.1...done.
Loaded symbols for /vol/vampire/gcc-3.2.3/lib/libgcc_s.so.1
Reading symbols from /lib/libc.so.6...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /usr/lib/libbz2.so.0...done.
Loaded symbols for /usr/lib/libbz2.so.0
Reading symbols from /lib/libdl.so.2...done.
Loaded symbols for /lib/libdl.so.2
Reading symbols from /lib/libpthread.so.0...done.
[New Thread 1024 (LWP 12640)]
Error while reading shared library symbols:
Can't attach LWP 12640: No such process
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
0x403e4c41 in __libc_nanosleep () at __libc_nanosleep:-1
-1 __libc_nanosleep: No such file or directory.
in __libc_nanosleep
(gdb)
Reply With Quote
  #2 (permalink)  
Old 04-05-2004
marc's Avatar
marc marc is offline
ZeroC Staff
 
Name: Marc Laukien
Organization: ZeroC, Inc.
Project: The Internet Communications Engine
 
Join Date: Feb 2003
Location: Florida
Posts: 1,781
I just tried this on my RedHat 9.0, and it works fine, both the Linux threads and NPTL. I think this must be a problem with your gdb/gcc installation.
Reply With Quote
  #3 (permalink)  
Old 04-05-2004
galbe galbe is offline
Registered User
 
 
Join Date: Oct 2003
Location: Bielefeld/Germany
Posts: 25
Thank you very much, for your help.
I had hoped it was reproducable.. ., well, I will have a look at gdb/gcc then.

Thanx again

Gerald
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Driving long running processes with Ice stephan Help Center 1 02-10-2006 08:37 PM
Can a proxy be transfered from parent to child process? richardma Help Center 1 12-22-2005 06:58 AM
Debugging Ice server or service kovacm Help Center 4 11-28-2005 05:53 AM
Debugging in Python msw10100 Help Center 6 09-09-2005 08:05 PM
Multiple Proxy access from different processes? brian Help Center 3 12-23-2003 09:41 PM


All times are GMT -4. The time now is 08:53 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.