Re: gcc bug?

Discussion in 'C++' started by Balog Pal, May 22, 2011.

  1. Balog Pal

    Balog Pal Guest

    "Ruben Safir" <>
    > I've been working with gcc 4.6 with C++ doing some templates exercises
    >
    > I seem to have some unexplained behavior which might be a bug, or maybe
    > I'm ignorant.


    maybe. first run your code in valgrind and look if it points out the
    corruption.
    Balog Pal, May 22, 2011
    #1
    1. Advertising

  2. Balog Pal

    Ian Collins Guest

    On 05/22/11 04:13 PM, Ruben Safir wrote:
    > On Sun, 22 May 2011 04:34:36 +0200, Balog Pal wrote:
    >
    >> "Ruben Safir"<>
    >>> I've been working with gcc 4.6 with C++ doing some templates exercises
    >>>
    >>> I seem to have some unexplained behavior which might be a bug, or maybe
    >>> I'm ignorant.

    >>
    >> maybe. first run your code in valgrind and look if it points out the
    >> corruption.

    >
    > valgrind?


    google.

    --
    Ian Collins
    Ian Collins, May 22, 2011
    #2
    1. Advertising

  3. Balog Pal

    Jorgen Grahn Guest

    On Sun, 2011-05-22, Balog Pal wrote:
    > "Ruben Safir" <>
    >> I've been working with gcc 4.6 with C++ doing some templates exercises
    >>
    >> I seem to have some unexplained behavior which might be a bug, or maybe
    >> I'm ignorant.

    >
    > maybe. first run your code in valgrind and look if it points out the
    > corruption.


    I get "75060 errors from 34 contexts" when I run the "del2" test, and
    they start appearing long before the crash. Most seem to be about
    accessing freed memory. I see no reason to suspect a compiler bug. (I
    used gcc 4.4; there is no use of experimental C++0x features in the
    code.)

    /Jorgen

    --
    // Jorgen Grahn <grahn@ Oo o. . .
    \X/ snipabacken.se> O o .
    Jorgen Grahn, May 22, 2011
    #3
  4. Balog Pal

    Jorgen Grahn Guest

    On Sun, 2011-05-22, Ruben Safir wrote:
    > On Sun, 22 May 2011 07:08:35 +0000, Jorgen Grahn wrote:
    >
    >> On Sun, 2011-05-22, Balog Pal wrote:
    >>> "Ruben Safir" <>
    >>>> I've been working with gcc 4.6 with C++ doing some templates exercises
    >>>>
    >>>> I seem to have some unexplained behavior which might be a bug, or
    >>>> maybe I'm ignorant.
    >>>
    >>> maybe. first run your code in valgrind and look if it points out the
    >>> corruption.

    >>
    >> I get "75060 errors from 34 contexts" when I run the "del2" test, and
    >> they start appearing long before the crash. Most seem to be about
    >> accessing freed memory. I see no reason to suspect a compiler bug. (I
    >> used gcc 4.4; there is no use of experimental C++0x features in the
    >> code.)
    >>
    >> /Jorgen

    >
    > ruben@www2:~/cplus/link_list_template_mysql> g++ -Wall -ggdb test_del2.cpp -o test_del2
    > ruben@www2:~/cplus/link_list_template_mysql>
    >
    > compiles cleanly


    You forgot -ansi -Wextra -pedantic -O3, but it still compiles cleanly
    after that.

    > I'm seeing a behavior I never saw before, though in the template

    ....
    > that makes dump according to gdb a type of

    ....

    Do yourself a favor and follow BP's advice: install and use valgrind.
    You seem to be on a system where it's supported. Like I wrote above,
    it will show errors a /long/ time before the crash.

    /Jorgen

    --
    // Jorgen Grahn <grahn@ Oo o. . .
    \X/ snipabacken.se> O o .
    Jorgen Grahn, May 22, 2011
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    8
    Views:
    413
  2. Kevin P. Fleming

    C99 structure initialization in gcc-2.95.3 vs gcc-3.3.1

    Kevin P. Fleming, Nov 6, 2003, in forum: C Programming
    Replies:
    2
    Views:
    630
    Kevin P. Fleming
    Nov 6, 2003
  3. Replies:
    5
    Views:
    350
    Nathan Addy
    Sep 17, 2005
  4. ashnin

    GCC 3.4.3 and GCC 4.1.2

    ashnin, Jul 7, 2008, in forum: C++
    Replies:
    1
    Views:
    501
    Michael DOUBEZ
    Jul 7, 2008
  5. kas
    Replies:
    1
    Views:
    308
    red floyd
    Apr 22, 2010
Loading...

Share This Page