Thread overview
A problem with streams ).26)
Apr 10, 2002
John Fletcher
Re: A problem with streams - bug in compiler
Apr 10, 2002
Pavel Minayev
Apr 11, 2002
John Fletcher
Apr 11, 2002
Pavel Minayev
Apr 11, 2002
John Fletcher
Apr 15, 2002
John Fletcher
Apr 15, 2002
Pavel Minayev
Apr 15, 2002
John Fletcher
Apr 16, 2002
Walter
April 10, 2002
The following program crashes with a page fault when run under version 0.26

import stream;
//import c.stdio;
import string;
import math;

int main(char[][] args)
{
    char [200] buffer;
    extended x = 1.;
    extended y = 2.;
    File dst = new File;
    dst.create("something");
    return 0;
}

The problem goes away if dst.create() is removed.

I have reported something similar before with an earlier version. There was a reference then to a different version of stream.d.

System: Win 98, DM says 8.25.1, DMD 0.26

Cheers

John


April 10, 2002
There is a bug in compiler which makes programs crash when function is called from destructor:

    import c.stdio;

    class Foo
    {
     ~this() { printf("dtor\n"); bar(); }
     void bar() { printf("bar\n"); }
    }

    int main()
    {
     Foo foo = new Foo;
    // delete foo;
     return 0;
    }

As you can see, when GC runs, it calls dtor and crashes on call to
bar(). Also note that, if you uncomment delete, the program no longer
crashes - but bar() still isn't called.

This is the case with File: it calls close() from the destructor... for now, just don't forget to close the file explicitly, and then use delete to destroy the object before GC does it for you.






April 11, 2002

Pavel Minayev wrote:

> There is a bug in compiler which makes programs crash when function is called from destructor:
>

(example deleted)

>
> This is the case with File: it calls close() from the destructor... for now, just don't forget to close the file explicitly, and then use delete to destroy the object before GC does it for you.

Thank you for this, which helps me understand what is going on. Unfortunately it now crashes at the explicit delete (DMD 0.26, Win98).

John



April 11, 2002
"John Fletcher" <J.P.Fletcher@aston.ac.uk> wrote in message news:3CB55AD4.45FB4DE6@aston.ac.uk...

> Thank you for this, which helps me understand what is going on. Unfortunately it now crashes at the explicit delete (DMD 0.26, Win98).

Strangely enough, it works for me on WinXP. Well, I guess we'll have to wait till next release...


April 11, 2002

Pavel Minayev wrote:

> "John Fletcher" <J.P.Fletcher@aston.ac.uk> wrote in message news:3CB55AD4.45FB4DE6@aston.ac.uk...
>
> > Thank you for this, which helps me understand what is going on. Unfortunately it now crashes at the explicit delete (DMD 0.26, Win98).
>
> Strangely enough, it works for me on WinXP. Well, I guess we'll have to wait till next release...

It doesn't surprise me.  There have been a number of problems with page faults under Win95/98 which don't occur with WinXP.

John


April 15, 2002

John Fletcher wrote:

> Pavel Minayev wrote:
>
> > "John Fletcher" <J.P.Fletcher@aston.ac.uk> wrote in message news:3CB55AD4.45FB4DE6@aston.ac.uk...
> >
> > > Thank you for this, which helps me understand what is going on. Unfortunately it now crashes at the explicit delete (DMD 0.26, Win98).
> >
> > Strangely enough, it works for me on WinXP. Well, I guess we'll have to wait till next release...
>
> It doesn't surprise me.  There have been a number of problems with page faults under Win95/98 which don't occur with WinXP.
>
> John

This was intended to be a bug report. It has no acknowledgement for several days.

John


April 15, 2002
"John Fletcher" <J.P.Fletcher@aston.ac.uk> wrote in message news:3CBA9DE7.44ED6716@aston.ac.uk...

> This was intended to be a bug report. It has no acknowledgement for
several
> days.

Do you expect to hear something other than, "will be fixed in the next version"? Walter probably got tired to copy-n-paste it over and over, after the 100th bug report... just wait for the next release.


April 15, 2002

Pavel Minayev wrote:

> "John Fletcher" <J.P.Fletcher@aston.ac.uk> wrote in message news:3CBA9DE7.44ED6716@aston.ac.uk...
>
> > This was intended to be a bug report. It has no acknowledgement for
> several
> > days.
>
> Do you expect to hear something other than, "will be fixed in the next version"? Walter probably got tired to copy-n-paste it over and over, after the 100th bug report... just wait for the next release.

O.K.  Just checking that it had not been missed. There seems to be a pattern emerging where the compilation throws up no errors but the resulting codes behave differently on Windows 98, giving page faults. Walter knows what he has done to solve this in previous cases. I wondered whether this was a manifestation of the same problem or something different.

John


April 16, 2002
"John Fletcher" <J.P.Fletcher@aston.ac.uk> wrote in message
> This was intended to be a bug report. It has no acknowledgement for
several
> days.

I added it to the bug list. -Walter