www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - An error message from hell!

reply Don Clugston <dac nospam.com.au> writes:
Try compiling this little baby. There's a bug in the code,
but the error message is about five megabytes long!
Brings Windows to its knees.

If you change the second line to const real val=0x1p90, the error 
message drops to about 100kb long.

I think we need an error for "Compilation Error limit exceeded".
Ideally it would be user-configurable, with a default limit of probably 
about 100-200 errors.

---------------
template a()
{
   const real val= 0x1p990;
}

template half(alias f)
{
   const real val = f.val/2;
}

template c(alias f)
{
    static if (f.val > 2.0)  const int val = c!( half!(f) ).val;
}

const int m = c!(a!()).val;
--------------------
Nov 23 2005
next sibling parent reply Georg Wrede <georg.wrede nospam.org> writes:
Don Clugston wrote:
 Try compiling this little baby. There's a bug in the code,
 but the error message is about five megabytes long!
 Brings Windows to its knees.

On FC4 Linux I get 2.0MB of errors.
 I think we need an error for "Compilation Error limit exceeded".

Really interesting was that DMD didn't seem to crash. And the error messages looked sane. (991 lines, some of them quite long.) But it never took Linux to its knees! Business as usual in the other xterm windows. Changing the command to time dmd hell.d > /dev/null gives 4.5s real, 4.2s user, and 0.2s sys, on an 800MHz PIII.
 Ideally it would be user-configurable, with a default limit of probably 
 about 100-200 errors.

Also, running out of resouces (like memory, stack, etc.) might be told to the user. (As it is, DMD seemed to handle the situation already, so the error message would not be too hard to add.) BTW, Don, is there a way to give an existing program (like DMD) more stack space on Windows?
Nov 24 2005
next sibling parent Stefan Zobel <Stefan_member pathlink.com> writes:
In article <4385C1A1.10607 nospam.org>, Georg Wrede says...

[snip]

BTW, Don, is there a way to give an existing program (like DMD) more 
stack space on Windows?

[snip] You can use Microsofts editbin for that. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/HTML/_core_editbin_reference.asp Best regards, Stefan
Nov 24 2005
prev sibling parent reply Don Clugston <dac nospam.com.au> writes:
Georg Wrede wrote:
 Don Clugston wrote:
 
 Try compiling this little baby. There's a bug in the code,
 but the error message is about five megabytes long!
 Brings Windows to its knees.

On FC4 Linux I get 2.0MB of errors.

Aargh. You're right, it's not really 5Mb. Don, I've told you a million times not to exaggerate.
 I think we need an error for "Compilation Error limit exceeded".

Really interesting was that DMD didn't seem to crash. And the error messages looked sane. (991 lines, some of them quite long.)

Yes, it doesn't crash. It's not even really a bug, as such. It's just not helpful. :-)
 But it never took Linux to its knees! Business as usual in the other 
 xterm windows.

Windows Explorer just locked up until DMD was finished. Might be related to my network settings though. I've noticed XP SP2 is pretty unstable; probably because they restricted MSIE, to try to plug the gaping security hole it causes. But MSIE is deeply embedded in the OS by now.
 Changing the command to
 
 time dmd hell.d > /dev/null
 
 gives 4.5s real, 4.2s user, and 0.2s sys, on an 800MHz PIII.
 
 Ideally it would be user-configurable, with a default limit of 
 probably about 100-200 errors.

Also, running out of resouces (like memory, stack, etc.) might be told to the user. (As it is, DMD seemed to handle the situation already, so the error message would not be too hard to add.)

It would be nice. I've heard that Windows can't detect when an application overflows its stack ??? Certainly when dmd has a stack overflow, you're just dropped back into the command line. No error message, no popup, no indication that anything was wrong.
 BTW, Don, is there a way to give an existing program (like DMD) more 
 stack space on Windows?

Don't know, but I'd like to.
Nov 24 2005
parent reply Georg Wrede <georg.wrede nospam.org> writes:
Some juicy quotes of the day:

Brings Windows to its knees.

Windows Explorer just locked up until DMD was finished.

Might be related to my network settings though.

I've noticed XP SP2 is pretty unstable.

Probably because they restricted MSIE.

Try to plug the gaping security hole.

MSIE is deeply embedded in the OS by now.

Windows can't detect when an application overflows its stack?

Has a stack overflow, you're just dropped back into
the command line.

No error message, no popup.

No indication that anything was wrong.

---

You're too valuable to waste your time "fighting with the computer"!

Unless your D programs do GUI stuff, I'd suggest you do your programming 
on Linux.

And you get everything you need right there, instead of buying (good 
grief) or at least searching and downloading from Microsoft all kinds of 
utilities that should come right with the OS.

On Linux you'd just do "man ulimit" to get a description on how you can 
change stack, memory, number of open files, cpu time, etc. -- per run, 
as opposed to tweaking the executable itself (as per Stefan's excellent 
post).

Once the app is final, then compile it on Windows. You'd save hours!
Nov 24 2005
parent reply Niko Korhonen <niktheblak hotmail.com> writes:
Georg Wrede wrote:
 You're too valuable to waste your time "fighting with the computer"!
 
 Unless your D programs do GUI stuff, I'd suggest you do your programming 
 on Linux.
 
 And you get everything you need right there, instead of buying (good 
 grief) or at least searching and downloading from Microsoft all kinds of 
 utilities that should come right with the OS.

So, what distribution should I use? What differences there are? What if the feature I want isn't on the distribution I downloaded randomly? What if the distribution I chose was 'wrong'? How can I find, download and install the utility I want if it wasn't included to begin with? Is it available for all Linux distributions? What kind of different installation schemes there are on Linux? Can I easily know where the program installs itself and is there a control panel for uninstalling them? Can I choose on what directory I want the program to be installed? Why are vast majority of Linux programs made by some guys calling themselves the GNU? I thought they made software for Unix. Are Linux and Unix binary compatible? What's the difference between Linux and Unix? Can I use programs made for AIM Unix on my Red Hat Linux? How do I download and update the GNU compiler suite anyway? Can I just download simple 'replace this file' patches and not have to recompile pretty much everything when I change pretty much anything? Does Linux have 'automatic updates'? Does etc etc etc ...
 On Linux you'd just do "man ulimit" to get a description on how you can 
 change stack, memory, number of open files, cpu time, etc. -- per run, 
 as opposed to tweaking the executable itself (as per Stefan's excellent 
 post).

What if I didn't know the 'ulimit' magic word? What if I tried 'man limit', 'man stack', 'man memory' or 'man number of files'? Where can I get a list of man arguments? And what if I didn't know the 'man' command? What 2-3 letter commands are there on Linux? Are the commands same for all command shells and Linux distributions? What do all of the 2-3 letter commands do? How can I get a list of them? How do I use that 'vi' thing to edit text files anyway? The keyboard commands don't make any sense at all! Why is a text editor called 'vi'? How can I etc etc etc ...
 Once the app is final, then compile it on Windows. You'd save hours!

...after losing years learning all that Unix folklore, that is! -- Niko Korhonen SW Developer
Nov 25 2005
next sibling parent "Lionello Lunesu" <lio remove.lunesu.com> writes:
Niko, if you ever get answer to those question, please forward them to me 
too!!

L. 
Nov 25 2005
prev sibling next sibling parent reply Georg Wrede <georg.wrede nospam.org> writes:
Niko Korhonen wrote:
 Georg Wrede wrote:
 
 You're too valuable to waste your time "fighting with the computer"!

 Unless your D programs do GUI stuff, I'd suggest you do your 
 programming on Linux.

 And you get everything you need right there, instead of buying (good 
 grief) or at least searching and downloading from Microsoft all kinds 
 of utilities that should come right with the OS.


Niko, I choose to take this as, either a rhetorical barrage of questions, or, ehhhh, the other alternative.
 So, what distribution should I use? What differences there are? What if 
 the feature I want isn't on the distribution I downloaded randomly? What 
 if the distribution I chose was 'wrong'? How can I find, download and 
 install the utility I want if it wasn't included to begin with? Is it 
 available for all Linux distributions? What kind of different 
 installation schemes there are on Linux? Can I easily know where the 
 program installs itself and is there a control panel for uninstalling 
 them? Can I choose on what directory I want the program to be installed? 
 Why are vast majority of Linux programs made by some guys calling 
 themselves the GNU? I thought they made software for Unix. Are Linux and 
 Unix binary compatible? What's the difference between Linux and Unix? 
 Can I use programs made for AIM Unix on my Red Hat Linux? How do I 
 download and update the GNU compiler suite anyway? Can I just download 
 simple 'replace this file' patches and not have to recompile pretty much 
 everything when I change pretty much anything? Does Linux have 
 'automatic updates'? Does etc etc etc ...
 
 On Linux you'd just do "man ulimit" to get a description on how you 
 can change stack, memory, number of open files, cpu time, etc. -- per 
 run, as opposed to tweaking the executable itself (as per Stefan's 
 excellent post).

What if I didn't know the 'ulimit' magic word? What if I tried 'man limit', 'man stack', 'man memory' or 'man number of files'? Where can I get a list of man arguments? And what if I didn't know the 'man' command? What 2-3 letter commands are there on Linux? Are the commands same for all command shells and Linux distributions? What do all of the 2-3 letter commands do? How can I get a list of them? How do I use that 'vi' thing to edit text files anyway? The keyboard commands don't make any sense at all! Why is a text editor called 'vi'? How can I etc etc etc ...
 Once the app is final, then compile it on Windows. You'd save hours!

...after losing years learning all that Unix folklore, that is!

Do I detect an adverse attitude here? ((((((( I could have actually answered the question, but then, you would have started to ask what the difference in my evaluation of you and Don is. So I decline. )))))))
Nov 25 2005
parent reply Niko Korhonen <niktheblak hotmail.com> writes:
Georg Wrede wrote:
 Niko, I choose to take this as, either a rhetorical barrage of 
 questions, or, ehhhh, the other alternative.

Yep, it was a rhetorical barrage of questions. My main point was that just switching to Linux might not help to save much time at all, or at least that these potential time-savings come after a huge initial investment of learning the 'nix folklore. -- Niko Korhonen SW Developer
Nov 28 2005
parent reply Georg Wrede <georg.wrede nospam.org> writes:
Niko Korhonen wrote:
 Georg Wrede wrote:
 
 Niko, I choose to take this as, either a rhetorical barrage of 
 questions, or, ehhhh, the other alternative.

Yep, it was a rhetorical barrage of questions. My main point was that just switching to Linux might not help to save much time at all, or at least that these potential time-savings come after a huge initial investment of learning the 'nix folklore.

Sigh. How much Windows or MSDOS do you have to know, if you develop using the command line DMD? One does not need very much Unix knowledge just to edit and compile. For example, often I don't even bother to fire up the GUI, I just use the console window. Just about ls, cd, mkdir, rmdir, cat, less, joe, -- can get you a long way. (Which is not more than what one used to learn from a 20 year old MSDOS user's guide.) If that seems hard, then for that person it really is best to avoid Unix.
Nov 29 2005
next sibling parent reply Don Clugston <dac nospam.com.au> writes:
Georg Wrede wrote:
 Niko Korhonen wrote:
 
 Georg Wrede wrote:

 Niko, I choose to take this as, either a rhetorical barrage of 
 questions, or, ehhhh, the other alternative.

Yep, it was a rhetorical barrage of questions. My main point was that just switching to Linux might not help to save much time at all, or at least that these potential time-savings come after a huge initial investment of learning the 'nix folklore.

Sigh. How much Windows or MSDOS do you have to know, if you develop using the command line DMD? One does not need very much Unix knowledge just to edit and compile. For example, often I don't even bother to fire up the GUI, I just use the console window. Just about ls, cd, mkdir, rmdir, cat, less, joe, -- can get you a long way. (Which is not more than what one used to learn from a 20 year old MSDOS user's guide.) If that seems hard, then for that person it really is best to avoid Unix.

As the catalyst for the flame war, I should mention that one of my machines is a dual-boot SuSE Linux machine, so I'm not completely ignorant of the UNIX command line. You're right that I should look at doing some D dev in Linux. Unfortunately (a) the power supply for the PC has died, not yet repaired, so I only have my Windows laptop right now; (b) I am doing some GUI stuff, and also linking to Windows DLLs. So Linux is not really an option for most of what I'm doing right now. Since almost all my free time is while commuting, I'm restricted to Windows.
Nov 30 2005
next sibling parent John Reimer <terminal.node gmail.com> writes:
Don Clugston wrote:

 
 As the catalyst for the flame war, I should mention that one of my 
 machines is a dual-boot SuSE Linux machine, so I'm not completely 
 ignorant of the UNIX command line. You're right that I should look at 
 doing some D dev in Linux. Unfortunately
 (a) the power supply for the PC has died, not yet repaired, so I only 
 have my Windows laptop right now;
 (b) I am doing some GUI stuff, and also linking to Windows DLLs. So 
 Linux is not really an option for most of what I'm doing right now.
 
 Since almost all my free time is while commuting, I'm restricted to 
 Windows.

Solution: dual-boot laptop. ;)
Nov 30 2005
prev sibling parent Sean Kelly <sean f4.ca> writes:
Don Clugston wrote:
 
 Since almost all my free time is while commuting, I'm restricted to 
 Windows.

Same here. Public transit is a wonderful thing :) Sean
Nov 30 2005
prev sibling parent reply Niko Korhonen <niktheblak hotmail.com> writes:
Georg Wrede wrote:
 One does not need very much Unix knowledge just to edit and compile. For 
 example, often I don't even bother to fire up the GUI, I just use the 
 console window.

Oh, the command prompt is nothing. Couple of days worth of learning, tops. It's the installation, configuration and system administration phases where the Unices are exponentially more difficult than Windows.
 Just about ls, cd, mkdir, rmdir, cat, less, joe, -- can get you a long 
 way. (Which is not more than what one used to learn from a 20 year old 
 MSDOS user's guide.)

I just *have* to ask, what on earth does 'joe' do? :) -- Niko Korhonen SW Developer
Nov 30 2005
parent reply Georg Wrede <georg.wrede nospam.org> writes:
Niko Korhonen wrote:
 Georg Wrede wrote:
 
 One does not need very much Unix knowledge just to edit and compile. 
 For example, often I don't even bother to fire up the GUI, I just use 
 the console window.

Oh, the command prompt is nothing. Couple of days worth of learning, tops. It's the installation, configuration and system administration phases where the Unices are exponentially more difficult than Windows.

Haven't done any of that for ages. Just slapped in my Fedora (or any other modern Linux) CD, and off it goes. In the old days ('80s and so) I was thoroughly overworked with Solaris administration. Never knew the day would come when I have a much larger installation and don't have to do anything. On windows I have to do disk defragmenting, and other stuff.
 Just about ls, cd, mkdir, rmdir, cat, less, joe, -- can get you a long 
 way. (Which is not more than what one used to learn from a 20 year old 
 MSDOS user's guide.)

I just *have* to ask, what on earth does 'joe' do? :)

Joe is a text editor. It's for the challenged, who are scared of emacs and can't learn vim.
Dec 01 2005
parent =?ISO-8859-1?Q?Jari-Matti_M=E4kel=E4?= <jmjmak invalid_utu.fi> writes:
Georg Wrede wrote:
 In the old days ('80s and so) I was thoroughly overworked with Solaris 
 administration. Never knew the day would come when I have a much larger 
 installation and don't have to do anything.
 
 On windows I have to do disk defragmenting, and other stuff.

And reinstalling it once in a while. And fixing broken network connections (the funny repair-button). :/ The M$ defragment utility (other commercial utilies may exist) helps you a lot, but it may take 8-10 hours to defragment a badly fragmented 200 GB+ NTFS-drive. My Linux-box transfers 66 MB/s between hard drives, so "defragmenting" the same data by moving the file system back and forth between two disks takes only 2h. It takes a lot more effort to cause fragmentation on ReiserFS 4. All in all, a linux user can compile a lot of programs while the windows-user just defragments his hard drive :)
Dec 01 2005
prev sibling next sibling parent clayasaurus <clayasaurus gmail.com> writes:
Linux actually requires you to know what you are doing. ;) And google is 
your friend.

Niko Korhonen wrote:
 Georg Wrede wrote:
 
 You're too valuable to waste your time "fighting with the computer"!

 Unless your D programs do GUI stuff, I'd suggest you do your 
 programming on Linux.

 And you get everything you need right there, instead of buying (good 
 grief) or at least searching and downloading from Microsoft all kinds 
 of utilities that should come right with the OS.

So, what distribution should I use? What differences there are? What if the feature I want isn't on the distribution I downloaded randomly? What if the distribution I chose was 'wrong'? How can I find, download and install the utility I want if it wasn't included to begin with? Is it available for all Linux distributions? What kind of different installation schemes there are on Linux? Can I easily know where the program installs itself and is there a control panel for uninstalling them? Can I choose on what directory I want the program to be installed? Why are vast majority of Linux programs made by some guys calling themselves the GNU? I thought they made software for Unix. Are Linux and Unix binary compatible? What's the difference between Linux and Unix? Can I use programs made for AIM Unix on my Red Hat Linux? How do I download and update the GNU compiler suite anyway? Can I just download simple 'replace this file' patches and not have to recompile pretty much everything when I change pretty much anything? Does Linux have 'automatic updates'? Does etc etc etc ...
 On Linux you'd just do "man ulimit" to get a description on how you 
 can change stack, memory, number of open files, cpu time, etc. -- per 
 run, as opposed to tweaking the executable itself (as per Stefan's 
 excellent post).

What if I didn't know the 'ulimit' magic word? What if I tried 'man limit', 'man stack', 'man memory' or 'man number of files'? Where can I get a list of man arguments? And what if I didn't know the 'man' command? What 2-3 letter commands are there on Linux? Are the commands same for all command shells and Linux distributions? What do all of the 2-3 letter commands do? How can I get a list of them? How do I use that 'vi' thing to edit text files anyway? The keyboard commands don't make any sense at all! Why is a text editor called 'vi'? How can I etc etc etc ...
 Once the app is final, then compile it on Windows. You'd save hours!

...after losing years learning all that Unix folklore, that is!

Nov 25 2005
prev sibling parent Thomas Kuehne <thomas-dloop kuehne.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Niko Korhonen schrieb am 2005-11-25:
 Georg Wrede wrote:
 You're too valuable to waste your time "fighting with the computer"!
 
 Unless your D programs do GUI stuff, I'd suggest you do your programming 
 on Linux.


<snip>
 What if I didn't know the 'ulimit' magic word? What if I tried 'man 
 limit', 'man stack', 'man memory' or 'man number of files'?

stack and memory aren't good keywords as they are very frequent.
 Where can I  get a list of man arguments? 

 Once the app is final, then compile it on Windows. You'd save hours!

...after losing years learning all that Unix folklore, that is!

Nobody told you to use AIX *g* Seriously there are some very advanced IDEs on Windows systems, but automation/scripting is a pain. How do you replace every "a" by a "b" in every even line of 100 files? (-> man sed) How about the keyword "LUG"? (maybe combined with your town/district/province...) Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFDiZdy3w+/yD4P9tIRAodxAKCAXKjDo80ZWIBf6v+Nb2xoNn4NQgCfTCRm iR4q+lp0c9xGXiv8scy9kGM= =1lp+ -----END PGP SIGNATURE-----
Nov 27 2005
prev sibling next sibling parent reply Ivan Senji <ivan.senji_REMOVE_ _THIS__gmail.com> writes:
Don Clugston wrote:
 Try compiling this little baby. There's a bug in the code,
 but the error message is about five megabytes long!

hm, I don't get it. I tried to compile your code: build test.d -clean >> output.txt and output.txt is 15MB!
Nov 24 2005
parent reply clayasaurus <clayasaurus gmail.com> writes:
Ivan Senji wrote:
 Don Clugston wrote:
 
 Try compiling this little baby. There's a bug in the code,
 but the error message is about five megabytes long!

hm, I don't get it. I tried to compile your code: build test.d -clean >> output.txt and output.txt is 15MB!

Try 'build test.d -clean > output.txt' ;)
Nov 25 2005
parent reply Ivan Senji <ivan.senji_REMOVE_ _THIS__gmail.com> writes:
clayasaurus wrote:
 Ivan Senji wrote:
 
 Don Clugston wrote:

 Try compiling this little baby. There's a bug in the code,
 but the error message is about five megabytes long!

hm, I don't get it. I tried to compile your code: build test.d -clean >> output.txt and output.txt is 15MB!

Try 'build test.d -clean > output.txt' ;)

I get the same? Should there be any difference? Is > != >>? With DMD 0.140 16.161.964 bytes With DMD <=0.139 15.143.279 bytes
Nov 27 2005
parent reply Thomas Kuehne <thomas-dloop kuehne.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ivan Senji schrieb am 2005-11-27:
 clayasaurus wrote:
 Ivan Senji wrote:
 
 Don Clugston wrote:

 Try compiling this little baby. There's a bug in the code,
 but the error message is about five megabytes long!

hm, I don't get it. I tried to compile your code: build test.d -clean >> output.txt and output.txt is 15MB!

Try 'build test.d -clean > output.txt' ;)

I get the same? Should there be any difference? Is > != >>?

">" redirects ">>" appends Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFDidB+3w+/yD4P9tIRAtQ5AJ4q9JgbtQAESrbarygWLyU8FOb2agCgjnQw 5C6J1E4W0cvK9R0q892nuNI= =bsj+ -----END PGP SIGNATURE-----
Nov 27 2005
parent Ivan Senji <ivan.senji_REMOVE_ _THIS__gmail.com> writes:
Thomas Kuehne wrote:
 
 ">" redirects
 ">>" appends
 

Thanks, i didn't know that :)
Nov 27 2005
prev sibling next sibling parent Thomas Kuehne <thomas-dloop kuehne.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Don Clugston schrieb am 2005-11-24:
 Try compiling this little baby. There's a bug in the code,
 but the error message is about five megabytes long!
 Brings Windows to its knees.

 If you change the second line to const real val=0x1p90, the error 
 message drops to about 100kb long.

 I think we need an error for "Compilation Error limit exceeded".
 Ideally it would be user-configurable, with a default limit of probably 
 about 100-200 errors.

 ---------------
 template a()
 {
    const real val= 0x1p990;
 }

 template half(alias f)
 {
    const real val = f.val/2;
 }

 template c(alias f)
 {
     static if (f.val > 2.0)  const int val = c!( half!(f) ).val;
 }

 const int m = c!(a!()).val;

Added to DStress as http://dstress.kuehne.cn/complex/error_message/error_message_01_A.d http://dstress.kuehne.cn/complex/error_message/error_message_01_B.d http://dstress.kuehne.cn/complex/error_message/error_message_01_C.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFDiYDQ3w+/yD4P9tIRAq+jAKC4OmgTMisZJQZcjYvS7Mpk8hBYDgCfXBYU 5jLViV2AgxWduzftAMXDZt4= =7O3m -----END PGP SIGNATURE-----
Nov 27 2005
prev sibling parent Hasan Aljudy <hasan.aljudy gmail.com> writes:
Don Clugston wrote:
 Try compiling this little baby. There's a bug in the code,
 but the error message is about five megabytes long!
 Brings Windows to its knees.
 
 If you change the second line to const real val=0x1p90, the error 
 message drops to about 100kb long.
 
 I think we need an error for "Compilation Error limit exceeded".
 Ideally it would be user-configurable, with a default limit of probably 
 about 100-200 errors.
 
 ---------------
 template a()
 {
   const real val= 0x1p990;
 }
 
 template half(alias f)
 {
   const real val = f.val/2;
 }
 
 template c(alias f)
 {
    static if (f.val > 2.0)  const int val = c!( half!(f) ).val;
 }
 
 const int m = c!(a!()).val;
 --------------------

Wow!!! the output I get is ~10 MB, but I didn't get any crashes or anything. Seems to me like an infinite parsing loop.
Nov 29 2005