From: Dan Miner (dminer@nyx.cs.du.edu)
Date: 06/30/93


From: dminer@nyx.cs.du.edu (Dan Miner)
Subject: [BUG? C++ lib]: C++ problem. (core dumps!)
Date: Wed, 30 Jun 1993 06:47:20 GMT


        I'm writing a uuencode/uudecode replacement program (ever
smarter and better :). I'm doing it in C++. There is 6 main
objects. A file Converter class, this class (template) takes
5 other class for its data members.

( actual order in the main() )
        Input i("./tmp", Input::Binary);
// -Does input from a file and calls intType to store the data.

        Output o("-", Output::Text);
// -Does the output to a file (including stdout). Gets its data
        from object outType.

        Convert c;
// -The actual converter object. Calls intType and encodes data and
// stores in outType.

        intType id(15, "./tmp");
// -class for input data storage.

        outType od(15);
// -class for output data storage.

        Converter < Convert, Input, intType, Output, outType >
                cv (c, i, id, o, od);
// -The "wrapper" object. Calls input, Convert::process(), output.

Here is what I get. (debug info)

% p
 in setFileinfo
in getELines()
BeginV2.0 644 4089CB4A 2 ./tmp
:=*E2BAG*RL@+5=A;&P@+4\R("UC("U$4$Q!5$9/4DT]54Y)6"!M86EN+D,*
:=*E2A%G*RL@("UO('`@;6%I;BYO"BU$
exiting run()
in main!
 last meaningful statement
OutputData dstor
Segmentation fault (core dumped)

[You can see. outType (typedef for class OutputData) is being
destroy (a malloc()/free()). Wham! Here is gdb. I don't
know how to use it and this is what I could get out of it.]

% gdb p
GDB is free software and you are welcome to 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.
GDB 4.6, Copyright 1992 Free Software Foundation, Inc...
(no debugging symbols found)...
(gdb) run
Starting program: /users/dminer/shpmail/shpmail/p

Program received signal 11, Segmentation fault
0x60022b24 in ios::sync_with_stdio (Cannot access memory at address 0xdde85008.
(gdb) quit
The program is running. Quit anyway? (y or n)

Is this a bugs in the C++ libs?

If someone can tell me how to get more info out of gdb, please
do! :)

Thanks,
Dan