Bug in SosMan's getline_test

Discussion in 'C Programming' started by Friar Tuck, Sep 11, 2007.

  1. Friar Tuck

    Friar Tuck Guest

    I believe I have found a bug in Dr Sosman's getline_test program, which
    is one of the official newsgroup programs. Debugging information
    follows.

    $ gdb ./getline_test
    GNU gdb 6.3
    Copyright 2004 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 "i586-suse-linux"...Using host libthread_db library
    "/lib/tls/libthread_db.so.1".

    (gdb) r
    Starting program: /tmp/getline_test

    Program received signal SIGSEGV, Segmentation fault.
    0x4008febf in getdelim () from /lib/tls/libc.so.6
    (gdb) bt
    #0 0x4008febf in getdelim () from /lib/tls/libc.so.6
    #1 0x4008d844 in getline () from /lib/tls/libc.so.6
    #2 0x080486b2 in verify (file=0x804a008, st=0xbfffee70, special=0) at
    getline_test.c:44
    #3 0x0804891d in main () at getline_test.c:103
    (gdb) f 2
    #2 0x080486b2 in verify (file=0x804a008, st=0xbfffee70, special=0) at
    getline_test.c:44
    44 buff = getline(file);
    (gdb) p *file
    $1 = {_flags = -72539008,
    _IO_read_ptr = 0x40018000 'n' <repeats 25 times>, "\n", 'd' <repeats 174 times>...,
    _IO_read_end = 0x40018000 'n' <repeats 25 times>, "\n", 'd' <repeats 174 times>...,
    _IO_read_base = 0x40018000 'n' <repeats 25 times>, "\n", 'd' <repeats 174 times>...,
    _IO_write_base = 0x40018000 'n' <repeats 25 times>, "\n", 'd' <repeats 174 times>...,
    _IO_write_ptr = 0x40018000 'n' <repeats 25 times>, "\n", 'd' <repeats 174 times>...,
    _IO_write_end = 0x40018000 'n' <repeats 25 times>, "\n", 'd' <repeats 174 times>...,
    _IO_buf_base = 0x40018000 'n' <repeats 25 times>, "\n", 'd' <repeats 174 times>...,
    _IO_buf_end = 0x40019000 'b' <repeats 200 times>...,
    _IO_save_base = 0x0,
    _IO_backup_base = 0x0, _IO_save_end = 0x0, _markers = 0x0,
    _chain = 0x40151460,
    _fileno = 6, _flags2 = 0, _old_offset = 0, _cur_column = 0,
    _vtable_offset = 0 '\0',
    _shortbuf = "", _lock = 0x804a0a0, _offset = 0, __pad1 =
    0x0, __pad2 = 0x804a0ac,
    _mode = -1, _unused2 = '\0' <repeats 51 times>}
    (gdb)

    It looks to me like the _flags field of file has become corrupted - it
    seems to have an odd value.
    Friar Tuck, Sep 11, 2007
    #1
    1. Advertising

  2. Friar Tuck

    Ben Pfaff Guest

    Friar Tuck <> writes:

    > I believe I have found a bug in Dr Sosman's getline_test program, which
    > is one of the official newsgroup programs.


    There is no such thing as an "official newsgroup program", at
    least not in comp.lang.c

    > (gdb) bt
    > #0 0x4008febf in getdelim () from /lib/tls/libc.so.6
    > #1 0x4008d844 in getline () from /lib/tls/libc.so.6
    > #2 0x080486b2 in verify (file=0x804a008, st=0xbfffee70, special=0) at
    > getline_test.c:44
    > #3 0x0804891d in main () at getline_test.c:103
    > (gdb) f 2
    > #2 0x080486b2 in verify (file=0x804a008, st=0xbfffee70, special=0) at
    > getline_test.c:44
    > 44 buff = getline(file);


    It seems very unlikely that Eric would have written his code to
    call into the "getline" function in the GNU C library, which is
    what this backtrace is showing. I think that you did not compile
    and link the test program correctly.

    GNU lib'c getline and Eric's getline evidently have different
    interfaces, judging from the line of source code above.
    --
    "If I've told you once, I've told you LLONG_MAX times not to
    exaggerate."
    --Jack Klein
    Ben Pfaff, Sep 12, 2007
    #2
    1. Advertising

  3. Ben Pfaff said:

    > Friar Tuck <> writes:
    >
    >> I believe I have found a bug in Dr Sosman's getline_test program,
    >> which is one of the official newsgroup programs.

    >
    > There is no such thing as an "official newsgroup program", at
    > least not in comp.lang.c


    There is one. It is:

    #include <stdio.h>

    int main(void)
    {
    puts("Hello, world!");
    return 0;
    }

    (or minor variations thereof).

    <snip>

    >> 44 buff = getline(file);

    >
    > It seems very unlikely that Eric would have written his code to
    > call into the "getline" function in the GNU C library, which is
    > what this backtrace is showing. I think that you did not compile
    > and link the test program correctly.


    Quite so. I think Eric is guilty of poor name choice here, but no more.

    > GNU lib'c getline and Eric's getline evidently have different
    > interfaces, judging from the line of source code above.


    Alas, I think Eric forgot Einstein's dictum that "it should be as simple
    as possible, but no simpler". Eric's function is simpler than possible.

    --
    Richard Heathfield <http://www.cpax.org.uk>
    Email: -www. +rjh@
    Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
    "Usenet is a strange place" - dmr 29 July 1999
    Richard Heathfield, Sep 12, 2007
    #3
  4. Friar Tuck

    Friar Tuck Guest

    On 11 Sep 2007 at 23:30, Ben Pfaff wrote:
    > Friar Tuck <> writes:
    >
    >> I believe I have found a bug in Dr Sosman's getline_test program, which
    >> is one of the official newsgroup programs.

    >
    > There is no such thing as an "official newsgroup program", at
    > least not in comp.lang.c


    Well, it's listed on the group website, so I'd say that's official.

    >
    >> (gdb) bt
    >> #0 0x4008febf in getdelim () from /lib/tls/libc.so.6
    >> #1 0x4008d844 in getline () from /lib/tls/libc.so.6
    >> #2 0x080486b2 in verify (file=0x804a008, st=0xbfffee70, special=0) at
    >> getline_test.c:44
    >> #3 0x0804891d in main () at getline_test.c:103
    >> (gdb) f 2
    >> #2 0x080486b2 in verify (file=0x804a008, st=0xbfffee70, special=0) at
    >> getline_test.c:44
    >> 44 buff = getline(file);

    >
    > It seems very unlikely that Eric would have written his code to
    > call into the "getline" function in the GNU C library, which is
    > what this backtrace is showing. I think that you did not compile
    > and link the test program correctly.
    >
    > GNU lib'c getline and Eric's getline evidently have different
    > interfaces, judging from the line of source code above.


    I don't believe there's a standard library function called getline. If
    there is, wouldn't it be better if Dr Sosman's version either had a
    different name, or followed the same interface?
    Friar Tuck, Sep 12, 2007
    #4
  5. Friar Tuck

    user923005 Guest

    On Sep 12, 10:59 am, Friar Tuck <> wrote:
    > On 11 Sep 2007 at 23:30, Ben Pfaff wrote:
    >
    > > Friar Tuck <> writes:

    >
    > >> I believe I have found a bug in Dr Sosman's getline_test program, which
    > >> is one of the official newsgroup programs.

    >
    > > There is no such thing as an "official newsgroup program", at
    > > least not in comp.lang.c

    >
    > Well, it's listed on the group website, so I'd say that's official.


    What's the group website?

    > >> (gdb) bt
    > >> #0 0x4008febf in getdelim () from /lib/tls/libc.so.6
    > >> #1 0x4008d844 in getline () from /lib/tls/libc.so.6
    > >> #2 0x080486b2 in verify (file=0x804a008, st=0xbfffee70, special=0) at
    > >> getline_test.c:44
    > >> #3 0x0804891d in main () at getline_test.c:103
    > >> (gdb) f 2
    > >> #2 0x080486b2 in verify (file=0x804a008, st=0xbfffee70, special=0) at
    > >> getline_test.c:44
    > >> 44 buff = getline(file);

    >
    > > It seems very unlikely that Eric would have written his code to
    > > call into the "getline" function in the GNU C library, which is
    > > what this backtrace is showing. I think that you did not compile
    > > and link the test program correctly.

    >
    > > GNU lib'c getline and Eric's getline evidently have different
    > > interfaces, judging from the line of source code above.

    >
    > I don't believe there's a standard library function called getline.


    There isn't. But there is a GNU version that is very popular among
    POSIX platforms.
    http://www.gnu.org/software/libc/manual/html_node/Line-Input.html

    > If
    > there is, wouldn't it be better if Dr Sosman's version either had a
    > different name, or followed the same interface?


    Right. But there isn't a standard C function called getline(). There
    is a popular one, so it still might be a good idea to change the name
    a bit.
    user923005, Sep 12, 2007
    #5
  6. On Wed, 12 Sep 2007 19:59:32 +0200 (CEST), in comp.lang.c , Friar Tuck
    <> wrote:

    >On 11 Sep 2007 at 23:30, Ben Pfaff wrote:
    >> Friar Tuck <> writes:
    >>
    >>> I believe I have found a bug in Dr Sosman's getline_test program, which
    >>> is one of the official newsgroup programs.

    >>
    >> There is no such thing as an "official newsgroup program", at
    >> least not in comp.lang.c

    >
    >Well, it's listed on the group website, so I'd say that's official.


    There /is/ no group website. Do you mean the CLC wiki? Thats an
    unofficial effort maintained by some of the regulars here, but by no
    means officially sanctioned (how could it be, there's no elected
    officers of this unmoderated group).
    >>
    >> GNU lib'c getline and Eric's getline evidently have different
    >> interfaces, judging from the line of source code above.

    >
    >I don't believe there's a standard library function called getline.


    Correct. However what Ben said was "GNU libc's getline". GNU evidently
    provide a nonstandard 'getline' function with different semantics to
    Eric's.

    --
    Mark McIntyre

    "Debugging is twice as hard as writing the code in the first place.
    Therefore, if you write the code as cleverly as possible, you are,
    by definition, not smart enough to debug it."
    --Brian Kernighan
    Mark McIntyre, Sep 12, 2007
    #6
  7. Friar Tuck

    pete Guest

    Friar Tuck wrote:
    >
    > On 11 Sep 2007 at 23:30, Ben Pfaff wrote:
    > > Friar Tuck <> writes:
    > >
    > >> I believe I have found a bug in
    > >> Dr Sosman's getline_test program,


    Is he really a doctor?

    > >> which is one of the official newsgroup programs.

    > >
    > > There is no such thing as an "official newsgroup program", at
    > > least not in comp.lang.c

    >
    > Well, it's listed on the group website, so I'd say that's official.


    There is no such thing as "the group website".

    > > GNU lib'c getline


    > I don't believe there's a standard library function called getline.


    There isn't.
    What is your native language?

    --
    pete
    pete, Sep 13, 2007
    #7
  8. Friar Tuck

    CBFalconer Guest

    Friar Tuck wrote:
    > On 11 Sep 2007 at 23:30, Ben Pfaff wrote:
    >> Friar Tuck <> writes:
    >>
    >>> I believe I have found a bug in Dr Sosman's getline_test program,
    >>> which is one of the official newsgroup programs.

    >>
    >> There is no such thing as an "official newsgroup program", at
    >> least not in comp.lang.c

    >
    > Well, it's listed on the group website, so I'd say that's official.


    There is no such thing as a 'group website'.

    --
    Chuck F (cbfalconer at maineline dot net)
    Available for consulting/temporary embedded and systems.
    <http://cbfalconer.home.att.net>



    --
    Posted via a free Usenet account from http://www.teranews.com
    CBFalconer, Sep 13, 2007
    #8
  9. Friar Tuck

    pete Guest

    user923005 wrote:
    >
    > On Sep 12, 10:59 am, Friar Tuck <> wrote:


    > > I don't believe there's a standard library function called getline.

    >
    > There isn't. But there is a GNU version that is very popular among
    > POSIX platforms.
    > http://www.gnu.org/software/libc/manual/html_node/Line-Input.html


    I have a somewhat similar one:

    http://www.mindspring.com/~pfilandr/C/get_line/get_line.c

    > > If there is,
    > > wouldn't it be better if Dr Sosman's version either had a
    > > different name, or followed the same interface?

    >
    > Right. But there isn't a standard C function called getline(). There
    > is a popular one, so it still might be a good idea to change the name
    > a bit.


    I changed the name of my function a little bit.

    --
    pete
    pete, Sep 13, 2007
    #9
  10. "Richard Heathfield" <> wrote in message
    news:...
    > #include <stdio.h>
    >
    > int main(void)
    > {
    > puts("Hello, world!");
    > return 0;
    > }
    >
    > (or minor variations thereof).
    >

    Buggy code is highly frowned on here.
    Your progrm returns a success status if the puts operation fails.
    It should be

    #include <stdio.h>
    #include <stdlib.h>

    int main(void)
    {
    if(puts("Hello world!") == EOF)
    exit(EXIT_FAILURE);
    return 0;
    }

    --
    Free games and programming goodies.
    http://www.personal.leeds.ac.uk/~bgy1mm
    Malcolm McLean, Sep 13, 2007
    #10
  11. "Malcolm McLean" <> a écrit dans le message de news:
    ...
    >
    > "Richard Heathfield" <> wrote in message
    > news:...
    >> #include <stdio.h>
    >>
    >> int main(void)
    >> {
    >> puts("Hello, world!");
    >> return 0;
    >> }
    >>
    >> (or minor variations thereof).
    >>

    > Buggy code is highly frowned on here.
    > Your progrm returns a success status if the puts operation fails.
    > It should be
    >
    > #include <stdio.h>
    > #include <stdlib.h>
    >
    > int main(void)
    > {
    > if(puts("Hello world!") == EOF)
    > exit(EXIT_FAILURE);
    > return 0;
    > }


    Since you want to be overtly picky, you should also notice that writing text
    to stdout without a final new-line invokes implementation defined behaviour
    (7.19.2p2). There is always one more bug.

    --
    Chqrlie
    Charlie Gordon, Sep 13, 2007
    #11
  12. "Charlie Gordon" <> schrieb im Newsbeitrag
    news:46e90935$0$2527$...
    > "Malcolm McLean" <> a écrit dans le message de
    > news: ...
    >>
    >> "Richard Heathfield" <> wrote in message
    >> news:...
    >>> #include <stdio.h>
    >>>
    >>> int main(void)
    >>> {
    >>> puts("Hello, world!");
    >>> return 0;
    >>> }
    >>>
    >>> (or minor variations thereof).
    >>>

    >> Buggy code is highly frowned on here.
    >> Your progrm returns a success status if the puts operation fails.
    >> It should be
    >>
    >> #include <stdio.h>
    >> #include <stdlib.h>
    >>
    >> int main(void)
    >> {
    >> if(puts("Hello world!") == EOF)
    >> exit(EXIT_FAILURE);
    >> return 0;
    >> }

    >
    > Since you want to be overtly picky, you should also notice that writing
    > text to stdout without a final new-line invokes implementation defined
    > behaviour (7.19.2p2). There is always one more bug.

    True had he used printf(). puts() though does add a newline (7.17.7.10-2 in
    n1124)

    Bye, Jojo
    Joachim Schmitz, Sep 13, 2007
    #12
  13. "Joachim Schmitz" <> schrieb im Newsbeitrag
    news:fcb1nf$di7$...
    > "Charlie Gordon" <> schrieb im Newsbeitrag
    > news:46e90935$0$2527$...
    >> "Malcolm McLean" <> a écrit dans le message de
    >> news: ...
    >>>
    >>> "Richard Heathfield" <> wrote in message
    >>> news:...
    >>>> #include <stdio.h>
    >>>>
    >>>> int main(void)
    >>>> {
    >>>> puts("Hello, world!");
    >>>> return 0;
    >>>> }
    >>>>
    >>>> (or minor variations thereof).
    >>>>
    >>> Buggy code is highly frowned on here.
    >>> Your progrm returns a success status if the puts operation fails.
    >>> It should be
    >>>
    >>> #include <stdio.h>
    >>> #include <stdlib.h>
    >>>
    >>> int main(void)
    >>> {
    >>> if(puts("Hello world!") == EOF)
    >>> exit(EXIT_FAILURE);
    >>> return 0;
    >>> }

    >>
    >> Since you want to be overtly picky, you should also notice that writing
    >> text to stdout without a final new-line invokes implementation defined
    >> behaviour (7.19.2p2). There is always one more bug.

    > True had he used printf(). puts() though does add a newline (7.17.7.10-2
    > in n1124)

    Sorry, 7.19.7.10-2:
    The puts function writes the string pointed to by s to the stream pointed to
    by stdout, and appends a new-line character to the output.
    Joachim Schmitz, Sep 13, 2007
    #13
  14. Charlie Gordon wrote:
    > "Malcolm McLean" <> a écrit dans le message de news:
    >> Buggy code is highly frowned on here.
    >> Your progrm returns a success status if the puts operation fails.
    >> It should be
    >>
    >> #include <stdio.h>
    >> #include <stdlib.h>
    >>
    >> int main(void)
    >> {
    >> if(puts("Hello world!") == EOF)
    >> exit(EXIT_FAILURE);
    >> return 0;
    >> }

    >
    > Since you want to be overtly picky, you should also notice that writing text
    > to stdout without a final new-line invokes implementation defined behaviour
    > (7.19.2p2). There is always one more bug.


    puts() supplies that newline for you.

    Phil

    --
    Philip Potter pgp <at> doc.ic.ac.uk
    Philip Potter, Sep 13, 2007
    #14
  15. "Charlie Gordon" <> a écrit dans le message de news:
    46e90935$0$2527$...
    > "Malcolm McLean" <> a écrit dans le message de
    > news: ...
    >>
    >> "Richard Heathfield" <> wrote in message
    >> news:...
    >>> #include <stdio.h>
    >>>
    >>> int main(void)
    >>> {
    >>> puts("Hello, world!");
    >>> return 0;
    >>> }
    >>>
    >>> (or minor variations thereof).
    >>>

    >> Buggy code is highly frowned on here.
    >> Your progrm returns a success status if the puts operation fails.
    >> It should be
    >>
    >> #include <stdio.h>
    >> #include <stdlib.h>
    >>
    >> int main(void)
    >> {
    >> if(puts("Hello world!") == EOF)
    >> exit(EXIT_FAILURE);
    >> return 0;
    >> }

    >
    > Since you want to be overtly picky, you should also notice that writing
    > text to stdout without a final new-line invokes implementation defined
    > behaviour (7.19.2p2). There is always one more bug.


    OOPS! it was puts, not printf !
    But why betray the original scriptures? The Word has always been

    printf("Hello world!\n");

    --
    Chqrlie.
    Charlie Gordon, Sep 13, 2007
    #15
  16. Friar Tuck

    Ben Pfaff Guest

    "Malcolm McLean" <> writes:

    > int main(void)
    > {
    > if(puts("Hello world!") == EOF)
    > exit(EXIT_FAILURE);
    > return 0;
    > }


    I'd recommend flushing stdout and checking its return value also,
    to ensure that the message was actually printed.
    --
    "The way I see it, an intelligent person who disagrees with me is
    probably the most important person I'll interact with on any given
    day."
    --Billy Chambless
    Ben Pfaff, Sep 13, 2007
    #16
  17. Friar Tuck

    pete Guest

    Charlie Gordon wrote:
    >
    > "Charlie Gordon" <> a écrit dans le message de news:
    > 46e90935$0$2527$...
    > > "Malcolm McLean" <> a écrit dans le message de
    > > news: ...
    > >>
    > >> "Richard Heathfield" <> wrote in message
    > >> news:...
    > >>> #include <stdio.h>
    > >>>
    > >>> int main(void)
    > >>> {
    > >>> puts("Hello, world!");
    > >>> return 0;
    > >>> }
    > >>>
    > >>> (or minor variations thereof).
    > >>>
    > >> Buggy code is highly frowned on here.
    > >> Your progrm returns a success status if the puts operation fails.
    > >> It should be
    > >>
    > >> #include <stdio.h>
    > >> #include <stdlib.h>
    > >>
    > >> int main(void)
    > >> {
    > >> if(puts("Hello world!") == EOF)
    > >> exit(EXIT_FAILURE);
    > >> return 0;
    > >> }

    > >
    > > Since you want to be overtly picky,
    > > you should also notice that writing
    > > text to stdout without a final new-line
    > > invokes implementation defined
    > > behaviour (7.19.2p2). There is always one more bug.

    >
    > OOPS! it was puts, not printf !


    It's not implementation defined behavior either.
    Whether or not the behavior is defined,
    is implementation defined.
    In other words, the behavior of a program which does not
    terminate the last line of a text stream with a newline,
    is not constrained by the standard;
    and in yet other words, it's undefined behavior.

    --
    pete
    pete, Sep 13, 2007
    #17
  18. Friar Tuck

    Friar Tuck Guest

    On 12 Sep 2007 at 23:47, pete wrote:
    > Friar Tuck wrote:
    >>
    >> On 11 Sep 2007 at 23:30, Ben Pfaff wrote:
    >> > Friar Tuck <> writes:
    >> >
    >> >> I believe I have found a bug in
    >> >> Dr Sosman's getline_test program,

    >
    > Is he really a doctor?
    >
    >> >> which is one of the official newsgroup programs.
    >> >
    >> > There is no such thing as an "official newsgroup program", at
    >> > least not in comp.lang.c

    >>
    >> Well, it's listed on the group website, so I'd say that's official.

    >
    > There is no such thing as "the group website".


    Isn't the group website cpac.org? It's in one of the group moderator's
    signatures and has lots of C resources. It certainly looks official.

    >> > GNU lib'c getline

    >
    >> I don't believe there's a standard library function called getline.

    >
    > There isn't.
    > What is your native language?


    C (gcc 4.1.3).

    Was the final conclusion of this thread that Dr Sosman's function
    clashes with a common library funcion and should be renamed?

    Actually, looking through that backtrace again is quite interesting:

    (gdb) p *file
    $1 = {_flags = -72539008,
    _IO_read_ptr = 0x40018000 'n' <repeats 25 times>, "\n", 'd' <repeats
    174 times>...,
    _IO_read_end = 0x40018000 'n' <repeats 25 times>, "\n", 'd' <repeats
    174 times>...,
    _IO_read_base = 0x40018000 'n' <repeats 25 times>, "\n", 'd'
    <repeats 174 times>...,
    _IO_write_base = 0x40018000 'n' <repeats 25 times>, "\n", 'd'
    <repeats 174 times>...,
    _IO_write_ptr = 0x40018000 'n' <repeats 25 times>, "\n", 'd'
    <repeats 174 times>...,
    _IO_write_end = 0x40018000 'n' <repeats 25 times>, "\n", 'd'
    <repeats 174 times>...,
    _IO_buf_base = 0x40018000 'n' <repeats 25 times>, "\n",
    'd' <repeats 174 times>...,
    _IO_buf_end = 0x40019000 'b' <repeats 200 times>...,
    _IO_save_base = 0x0,
    _IO_backup_base = 0x0, _IO_save_end = 0x0, _markers
    = 0x0,
    _chain = 0x40151460,
    _fileno = 6, _flags2 = 0, _old_offset = 0,
    _cur_column = 0,
    _vtable_offset = 0 '\0',
    _shortbuf = "", _lock = 0x804a0a0, _offset =
    0, __pad1 =
    0x0, __pad2 = 0x804a0ac,
    _mode = -1, _unused2 = '\0' <repeats
    51 times>}
    (gdb)

    Does anyone know what all these fields in the FILE * structure do? It
    could be useful to be able to pick out information directly from a file
    pointer. (By the way, it still looks to me like the _flags field has
    been corrupted somehow by getline_test.)
    Friar Tuck, Sep 14, 2007
    #18
  19. On Fri, 14 Sep 2007 01:39:12 +0200 (CEST), Friar Tuck
    <> wrote:

    >On 12 Sep 2007 at 23:47, pete wrote:
    >> Friar Tuck wrote:
    >>>
    >>> On 11 Sep 2007 at 23:30, Ben Pfaff wrote:
    >>> > Friar Tuck <> writes:
    >>> >
    >>> >> I believe I have found a bug in
    >>> >> Dr Sosman's getline_test program,

    >>
    >> Is he really a doctor?
    >>
    >>> >> which is one of the official newsgroup programs.
    >>> >
    >>> > There is no such thing as an "official newsgroup program", at
    >>> > least not in comp.lang.c
    >>>
    >>> Well, it's listed on the group website, so I'd say that's official.

    >>
    >> There is no such thing as "the group website".

    >
    >Isn't the group website cpac.org? It's in one of the group moderator's
    >signatures and has lots of C resources. It certainly looks official.


    This group doesn't have a moderator either.

    I wonder what you think a political web site has to do with the C
    language.


    snip

    >
    >Actually, looking through that backtrace again is quite interesting:
    >
    >(gdb) p *file
    >$1 = {_flags = -72539008,
    > _IO_read_ptr = 0x40018000 'n' <repeats 25 times>, "\n", 'd' <repeats
    > 174 times>...,
    > _IO_read_end = 0x40018000 'n' <repeats 25 times>, "\n", 'd' <repeats
    > 174 times>...,
    > _IO_read_base = 0x40018000 'n' <repeats 25 times>, "\n", 'd'
    > <repeats 174 times>...,
    > _IO_write_base = 0x40018000 'n' <repeats 25 times>, "\n", 'd'
    > <repeats 174 times>...,
    > _IO_write_ptr = 0x40018000 'n' <repeats 25 times>, "\n", 'd'
    > <repeats 174 times>...,
    > _IO_write_end = 0x40018000 'n' <repeats 25 times>, "\n", 'd'
    > <repeats 174 times>...,
    > _IO_buf_base = 0x40018000 'n' <repeats 25 times>, "\n",
    > 'd' <repeats 174 times>...,
    > _IO_buf_end = 0x40019000 'b' <repeats 200 times>...,
    > _IO_save_base = 0x0,
    > _IO_backup_base = 0x0, _IO_save_end = 0x0, _markers
    > = 0x0,
    > _chain = 0x40151460,
    > _fileno = 6, _flags2 = 0, _old_offset = 0,
    > _cur_column = 0,
    > _vtable_offset = 0 '\0',
    > _shortbuf = "", _lock = 0x804a0a0, _offset =
    > 0, __pad1 =
    > 0x0, __pad2 = 0x804a0ac,
    > _mode = -1, _unused2 = '\0' <repeats
    > 51 times>}
    >(gdb)


    The internal structure of a FILE object is implementation dependent.
    You will need to ask in a group that discusses your implementation.


    Remove del for email
    Barry Schwarz, Sep 14, 2007
    #19
  20. Friar Tuck

    Ben Pfaff Guest

    Friar Tuck <> writes:

    > On 12 Sep 2007 at 23:47, pete wrote:
    >> Friar Tuck wrote:
    >>>
    >>> On 11 Sep 2007 at 23:30, Ben Pfaff wrote:
    >>> > Friar Tuck <> writes:
    >>> >
    >>> >> I believe I have found a bug in
    >>> >> Dr Sosman's getline_test program,

    >>
    >> Is he really a doctor?
    >>
    >>> >> which is one of the official newsgroup programs.
    >>> >
    >>> > There is no such thing as an "official newsgroup program", at
    >>> > least not in comp.lang.c
    >>>
    >>> Well, it's listed on the group website, so I'd say that's official.

    >>
    >> There is no such thing as "the group website".

    >
    > Isn't the group website cpac.org? It's in one of the group moderator's
    > signatures and has lots of C resources. It certainly looks official.


    Do you mean www.cpax.org.uk? That's just a website that Richard
    Heathfield likes to point to, and apparently contributes to
    and/or maintains. He's a leading contributor to comp.lang.c, but
    doesn't speak for the group (no one does).

    (I doubt that an "official" comp.lang.c website would have a
    pointer to "the next Northampton Prayer and Praise meeting", as
    that seems quite off-topic for the purpose of the group.)
    --
    "Your correction is 100% correct and 0% helpful. Well done!"
    --Richard Heathfield
    Ben Pfaff, Sep 14, 2007
    #20
    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. John

    Re: BUG? OR NOT A BUG?

    John, Sep 20, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    534
  2. RedEye
    Replies:
    2
    Views:
    567
    Jason Kester
    Dec 13, 2005
  3. Michel Joly de Lotbiniere

    Bug Parade Bug 4953793

    Michel Joly de Lotbiniere, Nov 30, 2003, in forum: Java
    Replies:
    4
    Views:
    629
    Michel
    Dec 2, 2003
  4. DarkSpy
    Replies:
    4
    Views:
    872
    tom_usenet
    Jun 27, 2003
  5. Contact details for Eric Sosman

    , Jul 22, 2011, in forum: C Programming
    Replies:
    18
    Views:
    1,433
    Ben Pfaff
    Jul 26, 2011
Loading...

Share This Page