public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Stas Sergeev <stsp@aknet.ru>
To: linux-kernel@vger.kernel.org
Subject: Bug: debugging with GDB is broken under 2.6.6
Date: Mon, 14 Jun 2004 23:16:20 +0400	[thread overview]
Message-ID: <40CDF984.9030503@aknet.ru> (raw)

[-- Attachment #1: Type: text/plain, Size: 740 bytes --]


Hello.

It seems some bug in 2.6.6 (and up to
2.6.7-rc3-mm2) makes gdb useless - it
is no longer possible to produce even
a simple stack trace for any program.
Attached it the test-case to demonstrate
the bug. Its output under any 2.6.6 kernels
is:
---
(gdb) #0  0xffffe410 in ?? ()
#1  0xbffffa88 in ?? ()
#2  0x00000000 in ?? ()
---
Absolutely broken backtrace.

And under 2.6.5 (the one that comes with
RedHat FC2 at least) and under 2.4 kernels:
---
(gdb) #0  0x00558402 in ?? ()
#1  0x0041ce83 in __waitpid_nocancel () from /lib/tls/libc.so.6
#2  0x08048645 in main (argc=1, argv=0xfef20f84) at gdb_tst.c:26
---
Perfect backtrace.

Any ideas what have caused this? As I am
using gdb very frequently, this bug gives
me some headache.


[-- Attachment #2: gdb_tst.c --]
[-- Type: text/x-csrc, Size: 534 bytes --]


#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(int argc, char *argv[]) {
  char buf[255];
  int s;
  FILE *f;
  pid_t pid;
  switch((pid = fork())) {
    case 0:
      sprintf(buf, "gdb %s %i", argv[0], getppid());
      f = popen(buf, "w");
      fprintf(f, "bt\n");
      fprintf(f, "quit\n");
      fflush(f);
      wait(&s);
      pclose(f);
      break;
    case -1:
      return 1;
    default:
      waitpid(pid, &s, 0);
  }
  return 0;
}

[-- Attachment #3: Type: text/plain, Size: 82 bytes --]


Scanned by evaluation version of Dr.Web antivirus Daemon 
http://drweb.ru/unix/


                 reply	other threads:[~2004-06-14 19:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=40CDF984.9030503@aknet.ru \
    --to=stsp@aknet.ru \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox