Thread: connecttoserer() leading to SIGKILL

  1. #16
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,268
    Quote Originally Posted by cerr View Post
    Also i have downloaded and compiled strace onto my target platform but when i start it with ./strace ./prs I just get a bunch of information before it throws me back to the shell saying
    getppid() = 20506
    fork() = 20508
    _exit(0) = ?
    I assume this is cause my app is "forking"... how can i get the information from a forked process?
    Looking at the strace documentation, it appears you need to pass a -f option.
    bit∙hub [bit-huhb] n. A source and destination for information.

  2. #17
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Unless you're calling fork() deliberately, I'm not sure why you'd be seeing a fork. My crazy guess is that gethostbyname() calls it.

    (It's not as crazy as you might think... Once I was given the job of writing a new implementation of gethostbyname() that removed the runtime dependency on the dynamic C runtime (don't ask, it was something we needed to do) -- the way I implemented it was to fork and call "nslookup". Maybe these days the glibc people have done something similar?)
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. compare function ignoring leading white space
    By mc72 in forum C Programming
    Replies: 5
    Last Post: 11-23-2008, 01:33 PM
  2. Fix sprintf removing leading 0's
    By k2712 in forum C Programming
    Replies: 2
    Last Post: 09-10-2007, 10:58 AM
  3. leading zero's..... ( reading int )
    By sh4k3 in forum C Programming
    Replies: 4
    Last Post: 06-12-2007, 09:03 AM
  4. Removing Leading & Trailing Whitespace
    By EvilGuru in forum C Programming
    Replies: 11
    Last Post: 12-01-2005, 02:59 PM
  5. Leading Underscores
    By laserlight in forum C++ Programming
    Replies: 19
    Last Post: 09-04-2005, 02:16 AM