Ask a Question related to UNIX Programming, Design and Development.

  1. #1

    Default Re: How to dump core

    In article <B5cna.60949$jVh.46894@news01.bloor.is.net.cable.r ogers.com>,
    "Samuel T" <none@none.com> writes:
    > Hi all,
    > env: gnu/linux/pthread/g++..
    > My code has a hard-to-reproduce segfault, but in gdb, it disappeared. The
    > app doesn't autogenerate coredump, so how can I generate it outside gdb?
    May be a bit late now, but try installing pthread_kill_other_threads_np() as
    the signal handler for all your fault signals:
    struct sigaction sa = { 0 };

    /*
    * Set the handler for SEGV, BUS, ILL and ABRT to the Linux thread
    * function below, to kill the threads so we can produce a core dump.
    * It should be safe using pthread_kill_other_threads_np directly,
    * as it takes no arguments (will ignore the signo) and returns void
    * also.
    */
    sa.sa_handler = pthread_kill_other_threads_np;
    sa.sa_flags = SA_RESETHAND | SA_RESTART;

    sigaction( SIGSEGV, &sa, NULL );
    sigaction( SIGBUS, &sa, NULL );
    sigaction( SIGILL, &sa, NULL );
    sigaction( SIGABRT, &sa, NULL );

    We used this to good effect for debugging our code on Linux, but you do lose
    the information on the other threads. Better than nothing, however.

    Christian

    --
    "You have not converted a man because you have silenced him." -John Morley

    ----------------------------------------------------------------------
    /"\
    \ / ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
    X - AGAINST MS ATTACHMENTS
    / \
    Christian Smith Guest

  2. Similar Questions and Discussions

    1. GDTextUtil-0.86 Makefile core dump
      I am getting a compile error (below) while trying to build GDTextUtil-0.86 on AIX 5.3, Perl v5.8.7. The weird thing is that 0.85 builds just fine....
    2. ntpd core dump
      Hi all, I have 5.3-RELEASE installed. I'm trying to run ntpd but I get a message in /var/log/messages that it exited on signal 11 (core dumped)....
    3. Core dump in java 1.3 db2
      We have DB2 7 installed on an AIX server 5.1, running a stored procedure and executing select, updates and inserts using preparedStatements. On...
    4. Core Dump in sqleatin_api on UDB 8.1
      Hi All, I am seeing a problem with a UDB client application(multi-threaded) that uses the UDB client libraries(libdb2.so) on solaris. I see a...
    5. gcc program core dump
      There is a message of core dump may be related to the scope of variables , please any explainations . it's from a book of C .It is written as it is...
  3. #2

    Default Re: How to dump core

    module "Christian Smith" core dumped with the following output:
    > In article <B5cna.60949$jVh.46894@news01.bloor.is.net.cable.r ogers.com>,
    > "Samuel T" <none@none.com> writes:
    >> Hi all,
    >> env: gnu/linux/pthread/g++..
    >> My code has a hard-to-reproduce segfault, but in gdb, it disappeared. The
    >> app doesn't autogenerate coredump, so how can I generate it outside gdb?
    I don't seem to have the original thread so I'm replying here.
    Have you already tried abort().
    This should generate a core file.
    Haran Shivanan Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139