August 20, 2004
I compiled the code and it works fine for me...

In article <cg4cd0$26l$1@digitaldaemon.com>, very worried says...
>
>See: "to Walter: important BUG (I think)"
>
>Error on a very low level of the D language is a very big problem and I think it must be handled very quiqkly.
>
>>This looks like it could be a problem with stack overflows.
>
>Yes, and it looks like it is an error in compiler. It is not a server error, because everything elese works fine. It is not a cgi error, because I tested it also direct throw ssh.  And I don't thik there is an error in my program, because it is very simple and there is nothing there that could cause a "Segmentation fault".
>
>I dested it with 0.99, nothing changed.
>
>SO DO YOU WANT THE CORE DUMP FILES(I think they include the memory image of the
>prgogram, at the moment of segmentation fault)?
>If you do, where do I send them?
>if you don't, tell me, I stop offering then.
>
>I think this error is a very big problem, because the 1.00 version is very near.
>
>If the 1.00 has this error, it is quite USELESS, atleast for server applications. I would have no other choice than to move back to C, because I am writing server applications and they need to work.
>
>I am sorry for my boldness but I am just VERY WORRIED.
>I was under the impression that you didn't take it very seriously.
>But this error shlould be taken care of, or else the D is not very valuable.
>
>So are you going to fix it?
>
>And agin: do you want the core dump files?
>
>
>THANK YOU!
>
>
>AGAIN THE PROGRAM:
>
>
>import std.c.stdlib;
>import std.c.stdio;
>import std.stream;
>import std.string;
>import std.conv;
>
>void ulog(char []s){  //LOGS ONTO SCREEN
>printf("%.*s\n",s);
>fflush(std.c.stdio.stdout);
>}
>
>int open(){
>char *s;
>char abs[2000];
>char qu[100];
>int a;
>ulog("reaches this only 9 times of 10!\n");
>return 0;
>}
>
>
>int yhenda(){
>char MEM[2200];
>int a;
>ulog("point(2.1) \n");
>open();
>ulog("point(2.2) \n");
>return 0;
>}
>
>
>int main(){
>printf("Content-type: text/html\n\n");
>fflush(std.c.stdio.stdout);
>ulog("point(1.1)\n");
>yhenda();
>ulog("point(1.2)\n");
>return 0;
>}
>
>
>
>In article <cg2r0o$28pk$1@digitaldaemon.com>, Walter says...
>>
>>This looks like it could be a problem with stack overflows.
>>
>>"Martin" <Martin_member@pathlink.com> wrote in message news:cg1o1m$179m$1@digitaldaemon.com...
>>> I have been writing a cgi program and I've noticed one problem. There tend
>>to be
>>> some problems with local arrays (inside functions).
>>>
>>> Here is a sample program, that tends to crash about 1/10 of time. It only crashes on a busy web server, never on my local computer. (And it isnt the fflush function, it's the same without it)
>>> -----------------------------------------------------------------------
>>> import std.c.stdlib;
>>> import std.c.stdio;
>>> import std.stream;
>>> import std.string;
>>> import std.conv;
>>>
>>> void ulog(char []s){  //LOGS ONTO SCREEN
>>> printf("%.*s\n",s);
>>> fflush(std.c.stdio.stdout);
>>> }
>>>
>>> int open(){
>>> char *s;
>>> char abs[2000];
>>> char qu[100];
>>> int a;
>>> ulog("reaches this only 9 times of 10!\n");
>>> return 0;
>>> }
>>>
>>>
>>> int yhenda(){
>>> char MEM[2200];
>>> int a;
>>> ulog("point(2.1) \n");
>>> open();
>>> ulog("point(2.2) \n");
>>> return 0;
>>> }
>>>
>>>
>>> int main(){
>>> printf("Content-type: text/html\n\n");
>>> fflush(std.c.stdio.stdout);
>>> ulog("point(1.1)\n");
>>> yhenda();
>>> ulog("point(1.2)\n");
>>> return 0;
>>> }
>>> -----------------------------------------------------------------------
>>> Very simple program, shouldn't crash.
>>> (Notice: when I put char []abs=new char[2000]; instead of char abs[2000];,
>>the
>>> same with qu, it works fine.)
>>>
>>>
>>> I tested it over ssh, here is the screen(viga.cgi is the name of the
>>progam, it
>>> is compiled with the latest version of dmd):
>>> -----------------------------------------------------------------------
>>> bash-2.05b$ ./viga.cgi
>>> Content-type: text/html
>>>
>>> point(1.1)
>>>
>>> point(2.1)
>>>
>>> reaches this only 9 times of 10!
>>>
>>> point(2.2)
>>>
>>> point(1.2)
>>>
>>> bash-2.05b$ ./viga.cgi
>>> Content-type: text/html
>>>
>>> point(1.1)
>>>
>>> point(2.1)
>>>
>>> Segmentation fault (core dumped)
>>> bash-2.05b$ ./viga.cgi
>>> Content-type: text/html
>>>
>>> point(1.1)
>>>
>>> point(2.1)
>>>
>>> Segmentation fault (core dumped)
>>> bash-2.05b$ ./viga.cgi
>>> Content-type: text/html
>>>
>>> point(1.1)
>>>
>>> point(2.1)
>>>
>>> reaches this only 9 times of 10!
>>>
>>> point(2.2)
>>>
>>> point(1.2)
>>>
>>> bash-2.05b$ bash-2.05b$
>>> ---------------------------------------------------------------------
>>>
>>> I can send you the core dump files. I dont want to put them on a public
>>server,
>>> because they might contain important information about my server. Can I
>>send
>>> them to your email?
>>>
>>> Martin.
>>>
>>>
>>>
>>
>>
>
>


August 20, 2004
I can't wait for version 0.101, so that this can be dropped for good. <sigh>

"Bent Rasmussen" <exo@bent-rasmussen.info> wrote in message news:cg4epi$3fo$1@digitaldaemon.com...
> > I think this error is a very big problem, because the 1.00 version is very near.
>
> Oh boy, don't go down that road. :-) I believe it is possible and probable that 0.100 will follow.
>
>


August 20, 2004
May be it's time to run memtest86 overnight?

ub

In article <cg4fmo$3qe$1@digitaldaemon.com>, anon says...
>
>I compiled the code and it works fine for me...
>
>In article <cg4cd0$26l$1@digitaldaemon.com>, very worried says...
>>
>>See: "to Walter: important BUG (I think)"
>>
>>Error on a very low level of the D language is a very big problem and I think it must be handled very quiqkly.
>>
>>>This looks like it could be a problem with stack overflows.
>>
>>Yes, and it looks like it is an error in compiler. It is not a server error, because everything elese works fine. It is not a cgi error, because I tested it also direct throw ssh.  And I don't thik there is an error in my program, because it is very simple and there is nothing there that could cause a "Segmentation fault".
>>
>>I dested it with 0.99, nothing changed.
>>
>>SO DO YOU WANT THE CORE DUMP FILES(I think they include the memory image of the
>>prgogram, at the moment of segmentation fault)?
>>If you do, where do I send them?
>>if you don't, tell me, I stop offering then.
>>
>>I think this error is a very big problem, because the 1.00 version is very near.
>>
>>If the 1.00 has this error, it is quite USELESS, atleast for server applications. I would have no other choice than to move back to C, because I am writing server applications and they need to work.
>>
>>I am sorry for my boldness but I am just VERY WORRIED.
>>I was under the impression that you didn't take it very seriously.
>>But this error shlould be taken care of, or else the D is not very valuable.
>>
>>So are you going to fix it?
>>
>>And agin: do you want the core dump files?
>>
>>
>>THANK YOU!
>>
>>
>>AGAIN THE PROGRAM:
>>
>>
>>import std.c.stdlib;
>>import std.c.stdio;
>>import std.stream;
>>import std.string;
>>import std.conv;
>>
>>void ulog(char []s){  //LOGS ONTO SCREEN
>>printf("%.*s\n",s);
>>fflush(std.c.stdio.stdout);
>>}
>>
>>int open(){
>>char *s;
>>char abs[2000];
>>char qu[100];
>>int a;
>>ulog("reaches this only 9 times of 10!\n");
>>return 0;
>>}
>>
>>
>>int yhenda(){
>>char MEM[2200];
>>int a;
>>ulog("point(2.1) \n");
>>open();
>>ulog("point(2.2) \n");
>>return 0;
>>}
>>
>>
>>int main(){
>>printf("Content-type: text/html\n\n");
>>fflush(std.c.stdio.stdout);
>>ulog("point(1.1)\n");
>>yhenda();
>>ulog("point(1.2)\n");
>>return 0;
>>}
>>
>>
>>
>>In article <cg2r0o$28pk$1@digitaldaemon.com>, Walter says...
>>>
>>>This looks like it could be a problem with stack overflows.
>>>
>>>"Martin" <Martin_member@pathlink.com> wrote in message news:cg1o1m$179m$1@digitaldaemon.com...
>>>> I have been writing a cgi program and I've noticed one problem. There tend
>>>to be
>>>> some problems with local arrays (inside functions).
>>>>
>>>> Here is a sample program, that tends to crash about 1/10 of time. It only crashes on a busy web server, never on my local computer. (And it isnt the fflush function, it's the same without it)
>>>> -----------------------------------------------------------------------
>>>> import std.c.stdlib;
>>>> import std.c.stdio;
>>>> import std.stream;
>>>> import std.string;
>>>> import std.conv;
>>>>
>>>> void ulog(char []s){  //LOGS ONTO SCREEN
>>>> printf("%.*s\n",s);
>>>> fflush(std.c.stdio.stdout);
>>>> }
>>>>
>>>> int open(){
>>>> char *s;
>>>> char abs[2000];
>>>> char qu[100];
>>>> int a;
>>>> ulog("reaches this only 9 times of 10!\n");
>>>> return 0;
>>>> }
>>>>
>>>>
>>>> int yhenda(){
>>>> char MEM[2200];
>>>> int a;
>>>> ulog("point(2.1) \n");
>>>> open();
>>>> ulog("point(2.2) \n");
>>>> return 0;
>>>> }
>>>>
>>>>
>>>> int main(){
>>>> printf("Content-type: text/html\n\n");
>>>> fflush(std.c.stdio.stdout);
>>>> ulog("point(1.1)\n");
>>>> yhenda();
>>>> ulog("point(1.2)\n");
>>>> return 0;
>>>> }
>>>> -----------------------------------------------------------------------
>>>> Very simple program, shouldn't crash.
>>>> (Notice: when I put char []abs=new char[2000]; instead of char abs[2000];,
>>>the
>>>> same with qu, it works fine.)
>>>>
>>>>
>>>> I tested it over ssh, here is the screen(viga.cgi is the name of the
>>>progam, it
>>>> is compiled with the latest version of dmd):
>>>> -----------------------------------------------------------------------
>>>> bash-2.05b$ ./viga.cgi
>>>> Content-type: text/html
>>>>
>>>> point(1.1)
>>>>
>>>> point(2.1)
>>>>
>>>> reaches this only 9 times of 10!
>>>>
>>>> point(2.2)
>>>>
>>>> point(1.2)
>>>>
>>>> bash-2.05b$ ./viga.cgi
>>>> Content-type: text/html
>>>>
>>>> point(1.1)
>>>>
>>>> point(2.1)
>>>>
>>>> Segmentation fault (core dumped)
>>>> bash-2.05b$ ./viga.cgi
>>>> Content-type: text/html
>>>>
>>>> point(1.1)
>>>>
>>>> point(2.1)
>>>>
>>>> Segmentation fault (core dumped)
>>>> bash-2.05b$ ./viga.cgi
>>>> Content-type: text/html
>>>>
>>>> point(1.1)
>>>>
>>>> point(2.1)
>>>>
>>>> reaches this only 9 times of 10!
>>>>
>>>> point(2.2)
>>>>
>>>> point(1.2)
>>>>
>>>> bash-2.05b$ bash-2.05b$
>>>> ---------------------------------------------------------------------
>>>>
>>>> I can send you the core dump files. I dont want to put them on a public
>>>server,
>>>> because they might contain important information about my server. Can I
>>>send
>>>> them to your email?
>>>>
>>>> Martin.
>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>


August 20, 2004
Did you run it in your home computer?
In my home computer it works fine too, but it crashes on a server.
It crashes avarage about 1/10 of time, can vary from 1/3 to 1/25.

In your home computer only a very few programs run, but in a server  there are many programs. If you start the program the second time in your computer, it will probably get the same memory addresses and the same junk that was there last time the program run. In server, the program gets different memory each time (ok, not each time,but often) and this memory has some junk from some other program. So, if a program code takes memory and starts using it, without cleaning it, it may crash depending on the junk that is in the memory.

So in your home computer, this part of the program gets 'clean' memory, and the mistake does'nt come out, but on a server it might get 'dirty' memory, and it crashes.

Martin


In article <cg4fmo$3qe$1@digitaldaemon.com>, anon says...
>
>I compiled the code and it works fine for me...
>
>In article <cg4cd0$26l$1@digitaldaemon.com>, very worried says...
>>
>>See: "to Walter: important BUG (I think)"
>>
>>Error on a very low level of the D language is a very big problem and I think it must be handled very quiqkly.
>>
>>>This looks like it could be a problem with stack overflows.
>>
>>Yes, and it looks like it is an error in compiler. It is not a server error, because everything elese works fine. It is not a cgi error, because I tested it also direct throw ssh.  And I don't thik there is an error in my program, because it is very simple and there is nothing there that could cause a "Segmentation fault".
>>
>>I dested it with 0.99, nothing changed.
>>
>>SO DO YOU WANT THE CORE DUMP FILES(I think they include the memory image of the
>>prgogram, at the moment of segmentation fault)?
>>If you do, where do I send them?
>>if you don't, tell me, I stop offering then.
>>
>>I think this error is a very big problem, because the 1.00 version is very near.
>>
>>If the 1.00 has this error, it is quite USELESS, atleast for server applications. I would have no other choice than to move back to C, because I am writing server applications and they need to work.
>>
>>I am sorry for my boldness but I am just VERY WORRIED.
>>I was under the impression that you didn't take it very seriously.
>>But this error shlould be taken care of, or else the D is not very valuable.
>>
>>So are you going to fix it?
>>
>>And agin: do you want the core dump files?
>>
>>
>>THANK YOU!
>>
>>
>>AGAIN THE PROGRAM:
>>
>>
>>import std.c.stdlib;
>>import std.c.stdio;
>>import std.stream;
>>import std.string;
>>import std.conv;
>>
>>void ulog(char []s){  //LOGS ONTO SCREEN
>>printf("%.*s\n",s);
>>fflush(std.c.stdio.stdout);
>>}
>>
>>int open(){
>>char *s;
>>char abs[2000];
>>char qu[100];
>>int a;
>>ulog("reaches this only 9 times of 10!\n");
>>return 0;
>>}
>>
>>
>>int yhenda(){
>>char MEM[2200];
>>int a;
>>ulog("point(2.1) \n");
>>open();
>>ulog("point(2.2) \n");
>>return 0;
>>}
>>
>>
>>int main(){
>>printf("Content-type: text/html\n\n");
>>fflush(std.c.stdio.stdout);
>>ulog("point(1.1)\n");
>>yhenda();
>>ulog("point(1.2)\n");
>>return 0;
>>}
>>
>>
>>
>>In article <cg2r0o$28pk$1@digitaldaemon.com>, Walter says...
>>>
>>>This looks like it could be a problem with stack overflows.
>>>
>>>"Martin" <Martin_member@pathlink.com> wrote in message news:cg1o1m$179m$1@digitaldaemon.com...
>>>> I have been writing a cgi program and I've noticed one problem. There tend
>>>to be
>>>> some problems with local arrays (inside functions).
>>>>
>>>> Here is a sample program, that tends to crash about 1/10 of time. It only crashes on a busy web server, never on my local computer. (And it isnt the fflush function, it's the same without it)
>>>> -----------------------------------------------------------------------
>>>> import std.c.stdlib;
>>>> import std.c.stdio;
>>>> import std.stream;
>>>> import std.string;
>>>> import std.conv;
>>>>
>>>> void ulog(char []s){  //LOGS ONTO SCREEN
>>>> printf("%.*s\n",s);
>>>> fflush(std.c.stdio.stdout);
>>>> }
>>>>
>>>> int open(){
>>>> char *s;
>>>> char abs[2000];
>>>> char qu[100];
>>>> int a;
>>>> ulog("reaches this only 9 times of 10!\n");
>>>> return 0;
>>>> }
>>>>
>>>>
>>>> int yhenda(){
>>>> char MEM[2200];
>>>> int a;
>>>> ulog("point(2.1) \n");
>>>> open();
>>>> ulog("point(2.2) \n");
>>>> return 0;
>>>> }
>>>>
>>>>
>>>> int main(){
>>>> printf("Content-type: text/html\n\n");
>>>> fflush(std.c.stdio.stdout);
>>>> ulog("point(1.1)\n");
>>>> yhenda();
>>>> ulog("point(1.2)\n");
>>>> return 0;
>>>> }
>>>> -----------------------------------------------------------------------
>>>> Very simple program, shouldn't crash.
>>>> (Notice: when I put char []abs=new char[2000]; instead of char abs[2000];,
>>>the
>>>> same with qu, it works fine.)
>>>>
>>>>
>>>> I tested it over ssh, here is the screen(viga.cgi is the name of the
>>>progam, it
>>>> is compiled with the latest version of dmd):
>>>> -----------------------------------------------------------------------
>>>> bash-2.05b$ ./viga.cgi
>>>> Content-type: text/html
>>>>
>>>> point(1.1)
>>>>
>>>> point(2.1)
>>>>
>>>> reaches this only 9 times of 10!
>>>>
>>>> point(2.2)
>>>>
>>>> point(1.2)
>>>>
>>>> bash-2.05b$ ./viga.cgi
>>>> Content-type: text/html
>>>>
>>>> point(1.1)
>>>>
>>>> point(2.1)
>>>>
>>>> Segmentation fault (core dumped)
>>>> bash-2.05b$ ./viga.cgi
>>>> Content-type: text/html
>>>>
>>>> point(1.1)
>>>>
>>>> point(2.1)
>>>>
>>>> Segmentation fault (core dumped)
>>>> bash-2.05b$ ./viga.cgi
>>>> Content-type: text/html
>>>>
>>>> point(1.1)
>>>>
>>>> point(2.1)
>>>>
>>>> reaches this only 9 times of 10!
>>>>
>>>> point(2.2)
>>>>
>>>> point(1.2)
>>>>
>>>> bash-2.05b$ bash-2.05b$
>>>> ---------------------------------------------------------------------
>>>>
>>>> I can send you the core dump files. I dont want to put them on a public
>>>server,
>>>> because they might contain important information about my server. Can I
>>>send
>>>> them to your email?
>>>>
>>>> Martin.
>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>


August 20, 2004
Everything else works fine on this server, it is a busy web server hosting many
virtual servers.
I am renting a virtual server there.
So, I don't think it is the server.



In article <cg4gtb$4ai$1@digitaldaemon.com>, ub says...
>
>May be it's time to run memtest86 overnight?
>
>ub
>
>In article <cg4fmo$3qe$1@digitaldaemon.com>, anon says...
>>
>>I compiled the code and it works fine for me...
>>
>>In article <cg4cd0$26l$1@digitaldaemon.com>, very worried says...
>>>
>>>See: "to Walter: important BUG (I think)"
>>>
>>>Error on a very low level of the D language is a very big problem and I think it must be handled very quiqkly.
>>>
>>>>This looks like it could be a problem with stack overflows.
>>>
>>>Yes, and it looks like it is an error in compiler. It is not a server error, because everything elese works fine. It is not a cgi error, because I tested it also direct throw ssh.  And I don't thik there is an error in my program, because it is very simple and there is nothing there that could cause a "Segmentation fault".
>>>
>>>I dested it with 0.99, nothing changed.
>>>
>>>SO DO YOU WANT THE CORE DUMP FILES(I think they include the memory image of the
>>>prgogram, at the moment of segmentation fault)?
>>>If you do, where do I send them?
>>>if you don't, tell me, I stop offering then.
>>>
>>>I think this error is a very big problem, because the 1.00 version is very near.
>>>
>>>If the 1.00 has this error, it is quite USELESS, atleast for server applications. I would have no other choice than to move back to C, because I am writing server applications and they need to work.
>>>
>>>I am sorry for my boldness but I am just VERY WORRIED.
>>>I was under the impression that you didn't take it very seriously.
>>>But this error shlould be taken care of, or else the D is not very valuable.
>>>
>>>So are you going to fix it?
>>>
>>>And agin: do you want the core dump files?
>>>
>>>
>>>THANK YOU!
>>>
>>>
>>>AGAIN THE PROGRAM:
>>>
>>>
>>>import std.c.stdlib;
>>>import std.c.stdio;
>>>import std.stream;
>>>import std.string;
>>>import std.conv;
>>>
>>>void ulog(char []s){  //LOGS ONTO SCREEN
>>>printf("%.*s\n",s);
>>>fflush(std.c.stdio.stdout);
>>>}
>>>
>>>int open(){
>>>char *s;
>>>char abs[2000];
>>>char qu[100];
>>>int a;
>>>ulog("reaches this only 9 times of 10!\n");
>>>return 0;
>>>}
>>>
>>>
>>>int yhenda(){
>>>char MEM[2200];
>>>int a;
>>>ulog("point(2.1) \n");
>>>open();
>>>ulog("point(2.2) \n");
>>>return 0;
>>>}
>>>
>>>
>>>int main(){
>>>printf("Content-type: text/html\n\n");
>>>fflush(std.c.stdio.stdout);
>>>ulog("point(1.1)\n");
>>>yhenda();
>>>ulog("point(1.2)\n");
>>>return 0;
>>>}
>>>
>>>
>>>
>>>In article <cg2r0o$28pk$1@digitaldaemon.com>, Walter says...
>>>>
>>>>This looks like it could be a problem with stack overflows.
>>>>
>>>>"Martin" <Martin_member@pathlink.com> wrote in message news:cg1o1m$179m$1@digitaldaemon.com...
>>>>> I have been writing a cgi program and I've noticed one problem. There tend
>>>>to be
>>>>> some problems with local arrays (inside functions).
>>>>>
>>>>> Here is a sample program, that tends to crash about 1/10 of time. It only crashes on a busy web server, never on my local computer. (And it isnt the fflush function, it's the same without it)
>>>>> -----------------------------------------------------------------------
>>>>> import std.c.stdlib;
>>>>> import std.c.stdio;
>>>>> import std.stream;
>>>>> import std.string;
>>>>> import std.conv;
>>>>>
>>>>> void ulog(char []s){  //LOGS ONTO SCREEN
>>>>> printf("%.*s\n",s);
>>>>> fflush(std.c.stdio.stdout);
>>>>> }
>>>>>
>>>>> int open(){
>>>>> char *s;
>>>>> char abs[2000];
>>>>> char qu[100];
>>>>> int a;
>>>>> ulog("reaches this only 9 times of 10!\n");
>>>>> return 0;
>>>>> }
>>>>>
>>>>>
>>>>> int yhenda(){
>>>>> char MEM[2200];
>>>>> int a;
>>>>> ulog("point(2.1) \n");
>>>>> open();
>>>>> ulog("point(2.2) \n");
>>>>> return 0;
>>>>> }
>>>>>
>>>>>
>>>>> int main(){
>>>>> printf("Content-type: text/html\n\n");
>>>>> fflush(std.c.stdio.stdout);
>>>>> ulog("point(1.1)\n");
>>>>> yhenda();
>>>>> ulog("point(1.2)\n");
>>>>> return 0;
>>>>> }
>>>>> -----------------------------------------------------------------------
>>>>> Very simple program, shouldn't crash.
>>>>> (Notice: when I put char []abs=new char[2000]; instead of char abs[2000];,
>>>>the
>>>>> same with qu, it works fine.)
>>>>>
>>>>>
>>>>> I tested it over ssh, here is the screen(viga.cgi is the name of the
>>>>progam, it
>>>>> is compiled with the latest version of dmd):
>>>>> -----------------------------------------------------------------------
>>>>> bash-2.05b$ ./viga.cgi
>>>>> Content-type: text/html
>>>>>
>>>>> point(1.1)
>>>>>
>>>>> point(2.1)
>>>>>
>>>>> reaches this only 9 times of 10!
>>>>>
>>>>> point(2.2)
>>>>>
>>>>> point(1.2)
>>>>>
>>>>> bash-2.05b$ ./viga.cgi
>>>>> Content-type: text/html
>>>>>
>>>>> point(1.1)
>>>>>
>>>>> point(2.1)
>>>>>
>>>>> Segmentation fault (core dumped)
>>>>> bash-2.05b$ ./viga.cgi
>>>>> Content-type: text/html
>>>>>
>>>>> point(1.1)
>>>>>
>>>>> point(2.1)
>>>>>
>>>>> Segmentation fault (core dumped)
>>>>> bash-2.05b$ ./viga.cgi
>>>>> Content-type: text/html
>>>>>
>>>>> point(1.1)
>>>>>
>>>>> point(2.1)
>>>>>
>>>>> reaches this only 9 times of 10!
>>>>>
>>>>> point(2.2)
>>>>>
>>>>> point(1.2)
>>>>>
>>>>> bash-2.05b$ bash-2.05b$
>>>>> ---------------------------------------------------------------------
>>>>>
>>>>> I can send you the core dump files. I dont want to put them on a public
>>>>server,
>>>>> because they might contain important information about my server. Can I
>>>>send
>>>>> them to your email?
>>>>>
>>>>> Martin.
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>


August 20, 2004
It's *FAR* more likely that the server has multiple processes, and your running it there is precipitating a genuine race condition that is not picked up on a uniprocessor box due to atomic integer operations.

"Martin" <Martin_member@pathlink.com> wrote in message news:cg4iog$54u$1@digitaldaemon.com...
> Did you run it in your home computer?
> In my home computer it works fine too, but it crashes on a server.
> It crashes avarage about 1/10 of time, can vary from 1/3 to 1/25.
>
> In your home computer only a very few programs run, but in a server  there are many programs. If you start the program the second time in your computer, it will probably get the same memory addresses and the same junk that was there last time the program run. In server, the program gets different memory each time (ok, not each time,but often) and this memory has some junk from some other program. So, if a program code takes memory and starts using it, without cleaning it, it may crash depending on the junk that is in the memory.
>
> So in your home computer, this part of the program gets 'clean' memory, and the mistake does'nt come out, but on a server it might get 'dirty' memory, and it crashes.
>
> Martin
>
>
> In article <cg4fmo$3qe$1@digitaldaemon.com>, anon says...
> >
> >I compiled the code and it works fine for me...
> >
> >In article <cg4cd0$26l$1@digitaldaemon.com>, very worried says...
> >>
> >>See: "to Walter: important BUG (I think)"
> >>
> >>Error on a very low level of the D language is a very big problem and I think it must be handled very quiqkly.
> >>
> >>>This looks like it could be a problem with stack overflows.
> >>
> >>Yes, and it looks like it is an error in compiler. It is not a server error, because everything elese works fine. It is not a cgi error, because I tested it also direct throw ssh.  And I don't thik there is an error in my program, because it is very simple and there is nothing there that could cause a "Segmentation fault".
> >>
> >>I dested it with 0.99, nothing changed.
> >>
> >>SO DO YOU WANT THE CORE DUMP FILES(I think they include the memory image of the
> >>prgogram, at the moment of segmentation fault)?
> >>If you do, where do I send them?
> >>if you don't, tell me, I stop offering then.
> >>
> >>I think this error is a very big problem, because the 1.00 version is very near.
> >>
> >>If the 1.00 has this error, it is quite USELESS, atleast for server applications. I would have no other choice than to move back to C, because I am writing server applications and they need to work.
> >>
> >>I am sorry for my boldness but I am just VERY WORRIED.
> >>I was under the impression that you didn't take it very seriously.
> >>But this error shlould be taken care of, or else the D is not very valuable.
> >>
> >>So are you going to fix it?
> >>
> >>And agin: do you want the core dump files?
> >>
> >>
> >>THANK YOU!
> >>
> >>
> >>AGAIN THE PROGRAM:
> >>
> >>
> >>import std.c.stdlib;
> >>import std.c.stdio;
> >>import std.stream;
> >>import std.string;
> >>import std.conv;
> >>
> >>void ulog(char []s){  //LOGS ONTO SCREEN
> >>printf("%.*s\n",s);
> >>fflush(std.c.stdio.stdout);
> >>}
> >>
> >>int open(){
> >>char *s;
> >>char abs[2000];
> >>char qu[100];
> >>int a;
> >>ulog("reaches this only 9 times of 10!\n");
> >>return 0;
> >>}
> >>
> >>
> >>int yhenda(){
> >>char MEM[2200];
> >>int a;
> >>ulog("point(2.1) \n");
> >>open();
> >>ulog("point(2.2) \n");
> >>return 0;
> >>}
> >>
> >>
> >>int main(){
> >>printf("Content-type: text/html\n\n");
> >>fflush(std.c.stdio.stdout);
> >>ulog("point(1.1)\n");
> >>yhenda();
> >>ulog("point(1.2)\n");
> >>return 0;
> >>}
> >>
> >>
> >>
> >>In article <cg2r0o$28pk$1@digitaldaemon.com>, Walter says...
> >>>
> >>>This looks like it could be a problem with stack overflows.
> >>>
> >>>"Martin" <Martin_member@pathlink.com> wrote in message news:cg1o1m$179m$1@digitaldaemon.com...
> >>>> I have been writing a cgi program and I've noticed one problem. There tend
> >>>to be
> >>>> some problems with local arrays (inside functions).
> >>>>
> >>>> Here is a sample program, that tends to crash about 1/10 of time. It only crashes on a busy web server, never on my local computer. (And it isnt the fflush function, it's the same without it)
> >>>> -----------------------------------------------------------------------
> >>>> import std.c.stdlib;
> >>>> import std.c.stdio;
> >>>> import std.stream;
> >>>> import std.string;
> >>>> import std.conv;
> >>>>
> >>>> void ulog(char []s){  //LOGS ONTO SCREEN
> >>>> printf("%.*s\n",s);
> >>>> fflush(std.c.stdio.stdout);
> >>>> }
> >>>>
> >>>> int open(){
> >>>> char *s;
> >>>> char abs[2000];
> >>>> char qu[100];
> >>>> int a;
> >>>> ulog("reaches this only 9 times of 10!\n");
> >>>> return 0;
> >>>> }
> >>>>
> >>>>
> >>>> int yhenda(){
> >>>> char MEM[2200];
> >>>> int a;
> >>>> ulog("point(2.1) \n");
> >>>> open();
> >>>> ulog("point(2.2) \n");
> >>>> return 0;
> >>>> }
> >>>>
> >>>>
> >>>> int main(){
> >>>> printf("Content-type: text/html\n\n");
> >>>> fflush(std.c.stdio.stdout);
> >>>> ulog("point(1.1)\n");
> >>>> yhenda();
> >>>> ulog("point(1.2)\n");
> >>>> return 0;
> >>>> }
> >>>> -----------------------------------------------------------------------
> >>>> Very simple program, shouldn't crash.
> >>>> (Notice: when I put char []abs=new char[2000]; instead of char abs[2000];,
> >>>the
> >>>> same with qu, it works fine.)
> >>>>
> >>>>
> >>>> I tested it over ssh, here is the screen(viga.cgi is the name of the
> >>>progam, it
> >>>> is compiled with the latest version of dmd):
> >>>> -----------------------------------------------------------------------
> >>>> bash-2.05b$ ./viga.cgi
> >>>> Content-type: text/html
> >>>>
> >>>> point(1.1)
> >>>>
> >>>> point(2.1)
> >>>>
> >>>> reaches this only 9 times of 10!
> >>>>
> >>>> point(2.2)
> >>>>
> >>>> point(1.2)
> >>>>
> >>>> bash-2.05b$ ./viga.cgi
> >>>> Content-type: text/html
> >>>>
> >>>> point(1.1)
> >>>>
> >>>> point(2.1)
> >>>>
> >>>> Segmentation fault (core dumped)
> >>>> bash-2.05b$ ./viga.cgi
> >>>> Content-type: text/html
> >>>>
> >>>> point(1.1)
> >>>>
> >>>> point(2.1)
> >>>>
> >>>> Segmentation fault (core dumped)
> >>>> bash-2.05b$ ./viga.cgi
> >>>> Content-type: text/html
> >>>>
> >>>> point(1.1)
> >>>>
> >>>> point(2.1)
> >>>>
> >>>> reaches this only 9 times of 10!
> >>>>
> >>>> point(2.2)
> >>>>
> >>>> point(1.2)
> >>>>
> >>>> bash-2.05b$ bash-2.05b$
> >>>> ---------------------------------------------------------------------
> >>>>
> >>>> I can send you the core dump files. I dont want to put them on a public
> >>>server,
> >>>> because they might contain important information about my server. Can I
> >>>send
> >>>> them to your email?
> >>>>
> >>>> Martin.
> >>>>
> >>>>
> >>>>
> >>>
> >>>
> >>
> >>
> >
> >
>
>


August 20, 2004
In English please!

Explain it to me please!

In article <cg4jdi$5d7$1@digitaldaemon.com>, Matthew says...
>
>It's *FAR* more likely that the server has multiple processes, and your running it there is precipitating a genuine race condition that is not picked up on a uniprocessor box due to atomic integer operations.
>
>"Martin" <Martin_member@pathlink.com> wrote in message news:cg4iog$54u$1@digitaldaemon.com...
>> Did you run it in your home computer?
>> In my home computer it works fine too, but it crashes on a server.
>> It crashes avarage about 1/10 of time, can vary from 1/3 to 1/25.
>>
>> In your home computer only a very few programs run, but in a server  there are many programs. If you start the program the second time in your computer, it will probably get the same memory addresses and the same junk that was there last time the program run. In server, the program gets different memory each time (ok, not each time,but often) and this memory has some junk from some other program. So, if a program code takes memory and starts using it, without cleaning it, it may crash depending on the junk that is in the memory.
>>
>> So in your home computer, this part of the program gets 'clean' memory, and the mistake does'nt come out, but on a server it might get 'dirty' memory, and it crashes.
>>
>> Martin
>>
>>
>> In article <cg4fmo$3qe$1@digitaldaemon.com>, anon says...
>> >
>> >I compiled the code and it works fine for me...
>> >
>> >In article <cg4cd0$26l$1@digitaldaemon.com>, very worried says...
>> >>
>> >>See: "to Walter: important BUG (I think)"
>> >>
>> >>Error on a very low level of the D language is a very big problem and I think it must be handled very quiqkly.
>> >>
>> >>>This looks like it could be a problem with stack overflows.
>> >>
>> >>Yes, and it looks like it is an error in compiler. It is not a server error, because everything elese works fine. It is not a cgi error, because I tested it also direct throw ssh.  And I don't thik there is an error in my program, because it is very simple and there is nothing there that could cause a "Segmentation fault".
>> >>
>> >>I dested it with 0.99, nothing changed.
>> >>
>> >>SO DO YOU WANT THE CORE DUMP FILES(I think they include the memory image of the
>> >>prgogram, at the moment of segmentation fault)?
>> >>If you do, where do I send them?
>> >>if you don't, tell me, I stop offering then.
>> >>
>> >>I think this error is a very big problem, because the 1.00 version is very near.
>> >>
>> >>If the 1.00 has this error, it is quite USELESS, atleast for server applications. I would have no other choice than to move back to C, because I am writing server applications and they need to work.
>> >>
>> >>I am sorry for my boldness but I am just VERY WORRIED.
>> >>I was under the impression that you didn't take it very seriously.
>> >>But this error shlould be taken care of, or else the D is not very valuable.
>> >>
>> >>So are you going to fix it?
>> >>
>> >>And agin: do you want the core dump files?
>> >>
>> >>
>> >>THANK YOU!
>> >>
>> >>
>> >>AGAIN THE PROGRAM:
>> >>
>> >>
>> >>import std.c.stdlib;
>> >>import std.c.stdio;
>> >>import std.stream;
>> >>import std.string;
>> >>import std.conv;
>> >>
>> >>void ulog(char []s){  //LOGS ONTO SCREEN
>> >>printf("%.*s\n",s);
>> >>fflush(std.c.stdio.stdout);
>> >>}
>> >>
>> >>int open(){
>> >>char *s;
>> >>char abs[2000];
>> >>char qu[100];
>> >>int a;
>> >>ulog("reaches this only 9 times of 10!\n");
>> >>return 0;
>> >>}
>> >>
>> >>
>> >>int yhenda(){
>> >>char MEM[2200];
>> >>int a;
>> >>ulog("point(2.1) \n");
>> >>open();
>> >>ulog("point(2.2) \n");
>> >>return 0;
>> >>}
>> >>
>> >>
>> >>int main(){
>> >>printf("Content-type: text/html\n\n");
>> >>fflush(std.c.stdio.stdout);
>> >>ulog("point(1.1)\n");
>> >>yhenda();
>> >>ulog("point(1.2)\n");
>> >>return 0;
>> >>}
>> >>
>> >>
>> >>
>> >>In article <cg2r0o$28pk$1@digitaldaemon.com>, Walter says...
>> >>>
>> >>>This looks like it could be a problem with stack overflows.
>> >>>
>> >>>"Martin" <Martin_member@pathlink.com> wrote in message news:cg1o1m$179m$1@digitaldaemon.com...
>> >>>> I have been writing a cgi program and I've noticed one problem. There tend
>> >>>to be
>> >>>> some problems with local arrays (inside functions).
>> >>>>
>> >>>> Here is a sample program, that tends to crash about 1/10 of time. It only crashes on a busy web server, never on my local computer. (And it isnt the fflush function, it's the same without it)
>> >>>> -----------------------------------------------------------------------
>> >>>> import std.c.stdlib;
>> >>>> import std.c.stdio;
>> >>>> import std.stream;
>> >>>> import std.string;
>> >>>> import std.conv;
>> >>>>
>> >>>> void ulog(char []s){  //LOGS ONTO SCREEN
>> >>>> printf("%.*s\n",s);
>> >>>> fflush(std.c.stdio.stdout);
>> >>>> }
>> >>>>
>> >>>> int open(){
>> >>>> char *s;
>> >>>> char abs[2000];
>> >>>> char qu[100];
>> >>>> int a;
>> >>>> ulog("reaches this only 9 times of 10!\n");
>> >>>> return 0;
>> >>>> }
>> >>>>
>> >>>>
>> >>>> int yhenda(){
>> >>>> char MEM[2200];
>> >>>> int a;
>> >>>> ulog("point(2.1) \n");
>> >>>> open();
>> >>>> ulog("point(2.2) \n");
>> >>>> return 0;
>> >>>> }
>> >>>>
>> >>>>
>> >>>> int main(){
>> >>>> printf("Content-type: text/html\n\n");
>> >>>> fflush(std.c.stdio.stdout);
>> >>>> ulog("point(1.1)\n");
>> >>>> yhenda();
>> >>>> ulog("point(1.2)\n");
>> >>>> return 0;
>> >>>> }
>> >>>> -----------------------------------------------------------------------
>> >>>> Very simple program, shouldn't crash.
>> >>>> (Notice: when I put char []abs=new char[2000]; instead of char abs[2000];,
>> >>>the
>> >>>> same with qu, it works fine.)
>> >>>>
>> >>>>
>> >>>> I tested it over ssh, here is the screen(viga.cgi is the name of the
>> >>>progam, it
>> >>>> is compiled with the latest version of dmd):
>> >>>> -----------------------------------------------------------------------
>> >>>> bash-2.05b$ ./viga.cgi
>> >>>> Content-type: text/html
>> >>>>
>> >>>> point(1.1)
>> >>>>
>> >>>> point(2.1)
>> >>>>
>> >>>> reaches this only 9 times of 10!
>> >>>>
>> >>>> point(2.2)
>> >>>>
>> >>>> point(1.2)
>> >>>>
>> >>>> bash-2.05b$ ./viga.cgi
>> >>>> Content-type: text/html
>> >>>>
>> >>>> point(1.1)
>> >>>>
>> >>>> point(2.1)
>> >>>>
>> >>>> Segmentation fault (core dumped)
>> >>>> bash-2.05b$ ./viga.cgi
>> >>>> Content-type: text/html
>> >>>>
>> >>>> point(1.1)
>> >>>>
>> >>>> point(2.1)
>> >>>>
>> >>>> Segmentation fault (core dumped)
>> >>>> bash-2.05b$ ./viga.cgi
>> >>>> Content-type: text/html
>> >>>>
>> >>>> point(1.1)
>> >>>>
>> >>>> point(2.1)
>> >>>>
>> >>>> reaches this only 9 times of 10!
>> >>>>
>> >>>> point(2.2)
>> >>>>
>> >>>> point(1.2)
>> >>>>
>> >>>> bash-2.05b$ bash-2.05b$
>> >>>> ---------------------------------------------------------------------
>> >>>>
>> >>>> I can send you the core dump files. I dont want to put them on a public
>> >>>server,
>> >>>> because they might contain important information about my server. Can I
>> >>>send
>> >>>> them to your email?
>> >>>>
>> >>>> Martin.
>> >>>>
>> >>>>
>> >>>>
>> >>>
>> >>>
>> >>
>> >>
>> >
>> >
>>
>>
>
>


August 20, 2004
I suspect the process that you've built contains somewhere within it - maybe your code, maybe the D libs - a race condition that relates to an integer operation - say increment of a 16 or 32-bit quantity (assuming a 32-bit architecture). On machines with only one processor such operations will *always* work atomically, because of the way Intel (and most other architectures) works.

However, when doing so on a machine with two processes, explicit instructions are required to lock the bus to prevent interleaving of the separate thread's actions. This can work as follows:

    Thread A reads the value from memory (to register)
    Thread B reads the value from memory (to register)
    Thread B increments the value (in register)
    Thread B writes the value to memory (from register)
    Thread A increments the value (in register)
    Thread A writes the value to memory (from register)

When Thread A writes the value it overwrites the changes made by thread B. Rather than the variable being incremented twice, as expected, the net result is only one incremented.

This is a classic race condition, and such things easily bring down processes (or even machines!).


Note: I'm not saying that the problem that has manifested itself on your server *is* due to this, just that it smells a lot like it to me.


-- 
Matthew Wilson

Author: "Imperfect C++", Addison-Wesley, 2004
    (http://www.imperfectcplusplus.com)
Contributing editor, C/C++ Users Journal
    (http://www.synesis.com.au/articles.html#columns)
Director, Synesis Software
    (www.synesis.com.au)
STLSoft moderator
    (http://www.stlsoft.org)

"Youth ages, Immaturity is outgrown, Ignorance can be educated, drunkeness sobered. But stupid lasts forever", Aristophenes

-----------------------------------------------------


"Martin" <Martin_member@pathlink.com> wrote in message news:cg4k2g$5j0$1@digitaldaemon.com...
> In English please!
>
> Explain it to me please!
>
> In article <cg4jdi$5d7$1@digitaldaemon.com>, Matthew says...
> >
> >It's *FAR* more likely that the server has multiple processes, and your running it there is precipitating a genuine
race
> >condition that is not picked up on a uniprocessor box due to atomic integer operations.
> >
> >"Martin" <Martin_member@pathlink.com> wrote in message news:cg4iog$54u$1@digitaldaemon.com...
> >> Did you run it in your home computer?
> >> In my home computer it works fine too, but it crashes on a server.
> >> It crashes avarage about 1/10 of time, can vary from 1/3 to 1/25.
> >>
> >> In your home computer only a very few programs run, but in a server  there are many programs. If you start the program the second time in your computer, it will probably get the same memory addresses and the same junk that was there last time the program run. In server, the program gets different memory each time (ok, not each time,but often) and this memory has some junk from some other program. So, if a program code takes memory and starts using it, without cleaning it, it may crash depending on the junk that is in the memory.
> >>
> >> So in your home computer, this part of the program gets 'clean' memory, and the mistake does'nt come out, but on a server it might get 'dirty' memory, and it crashes.
> >>
> >> Martin
> >>
> >>
> >> In article <cg4fmo$3qe$1@digitaldaemon.com>, anon says...
> >> >
> >> >I compiled the code and it works fine for me...
> >> >
> >> >In article <cg4cd0$26l$1@digitaldaemon.com>, very worried says...
> >> >>
> >> >>See: "to Walter: important BUG (I think)"
> >> >>
> >> >>Error on a very low level of the D language is a very big problem and I think it must be handled very quiqkly.
> >> >>
> >> >>>This looks like it could be a problem with stack overflows.
> >> >>
> >> >>Yes, and it looks like it is an error in compiler. It is not a server error, because everything elese works fine. It is not a cgi error, because I tested it also direct throw ssh.  And I don't thik there is an error in my program, because it is very simple and there is nothing there that could cause a "Segmentation fault".
> >> >>
> >> >>I dested it with 0.99, nothing changed.
> >> >>
> >> >>SO DO YOU WANT THE CORE DUMP FILES(I think they include the memory image of the
> >> >>prgogram, at the moment of segmentation fault)?
> >> >>If you do, where do I send them?
> >> >>if you don't, tell me, I stop offering then.
> >> >>
> >> >>I think this error is a very big problem, because the 1.00 version is very near.
> >> >>
> >> >>If the 1.00 has this error, it is quite USELESS, atleast for server applications. I would have no other choice than to move back to C, because I am writing server applications and they need to work.
> >> >>
> >> >>I am sorry for my boldness but I am just VERY WORRIED.
> >> >>I was under the impression that you didn't take it very seriously.
> >> >>But this error shlould be taken care of, or else the D is not very valuable.
> >> >>
> >> >>So are you going to fix it?
> >> >>
> >> >>And agin: do you want the core dump files?
> >> >>
> >> >>
> >> >>THANK YOU!
> >> >>
> >> >>
> >> >>AGAIN THE PROGRAM:
> >> >>
> >> >>
> >> >>import std.c.stdlib;
> >> >>import std.c.stdio;
> >> >>import std.stream;
> >> >>import std.string;
> >> >>import std.conv;
> >> >>
> >> >>void ulog(char []s){  //LOGS ONTO SCREEN
> >> >>printf("%.*s\n",s);
> >> >>fflush(std.c.stdio.stdout);
> >> >>}
> >> >>
> >> >>int open(){
> >> >>char *s;
> >> >>char abs[2000];
> >> >>char qu[100];
> >> >>int a;
> >> >>ulog("reaches this only 9 times of 10!\n");
> >> >>return 0;
> >> >>}
> >> >>
> >> >>
> >> >>int yhenda(){
> >> >>char MEM[2200];
> >> >>int a;
> >> >>ulog("point(2.1) \n");
> >> >>open();
> >> >>ulog("point(2.2) \n");
> >> >>return 0;
> >> >>}
> >> >>
> >> >>
> >> >>int main(){
> >> >>printf("Content-type: text/html\n\n");
> >> >>fflush(std.c.stdio.stdout);
> >> >>ulog("point(1.1)\n");
> >> >>yhenda();
> >> >>ulog("point(1.2)\n");
> >> >>return 0;
> >> >>}
> >> >>
> >> >>
> >> >>
> >> >>In article <cg2r0o$28pk$1@digitaldaemon.com>, Walter says...
> >> >>>
> >> >>>This looks like it could be a problem with stack overflows.
> >> >>>
> >> >>>"Martin" <Martin_member@pathlink.com> wrote in message news:cg1o1m$179m$1@digitaldaemon.com...
> >> >>>> I have been writing a cgi program and I've noticed one problem. There tend
> >> >>>to be
> >> >>>> some problems with local arrays (inside functions).
> >> >>>>
> >> >>>> Here is a sample program, that tends to crash about 1/10 of time. It only crashes on a busy web server, never on my local computer. (And it isnt the fflush function, it's the same without it)
> >> >>>> -----------------------------------------------------------------------
> >> >>>> import std.c.stdlib;
> >> >>>> import std.c.stdio;
> >> >>>> import std.stream;
> >> >>>> import std.string;
> >> >>>> import std.conv;
> >> >>>>
> >> >>>> void ulog(char []s){  //LOGS ONTO SCREEN
> >> >>>> printf("%.*s\n",s);
> >> >>>> fflush(std.c.stdio.stdout);
> >> >>>> }
> >> >>>>
> >> >>>> int open(){
> >> >>>> char *s;
> >> >>>> char abs[2000];
> >> >>>> char qu[100];
> >> >>>> int a;
> >> >>>> ulog("reaches this only 9 times of 10!\n");
> >> >>>> return 0;
> >> >>>> }
> >> >>>>
> >> >>>>
> >> >>>> int yhenda(){
> >> >>>> char MEM[2200];
> >> >>>> int a;
> >> >>>> ulog("point(2.1) \n");
> >> >>>> open();
> >> >>>> ulog("point(2.2) \n");
> >> >>>> return 0;
> >> >>>> }
> >> >>>>
> >> >>>>
> >> >>>> int main(){
> >> >>>> printf("Content-type: text/html\n\n");
> >> >>>> fflush(std.c.stdio.stdout);
> >> >>>> ulog("point(1.1)\n");
> >> >>>> yhenda();
> >> >>>> ulog("point(1.2)\n");
> >> >>>> return 0;
> >> >>>> }
> >> >>>> -----------------------------------------------------------------------
> >> >>>> Very simple program, shouldn't crash.
> >> >>>> (Notice: when I put char []abs=new char[2000]; instead of char abs[2000];,
> >> >>>the
> >> >>>> same with qu, it works fine.)
> >> >>>>
> >> >>>>
> >> >>>> I tested it over ssh, here is the screen(viga.cgi is the name of the
> >> >>>progam, it
> >> >>>> is compiled with the latest version of dmd):
> >> >>>> -----------------------------------------------------------------------
> >> >>>> bash-2.05b$ ./viga.cgi
> >> >>>> Content-type: text/html
> >> >>>>
> >> >>>> point(1.1)
> >> >>>>
> >> >>>> point(2.1)
> >> >>>>
> >> >>>> reaches this only 9 times of 10!
> >> >>>>
> >> >>>> point(2.2)
> >> >>>>
> >> >>>> point(1.2)
> >> >>>>
> >> >>>> bash-2.05b$ ./viga.cgi
> >> >>>> Content-type: text/html
> >> >>>>
> >> >>>> point(1.1)
> >> >>>>
> >> >>>> point(2.1)
> >> >>>>
> >> >>>> Segmentation fault (core dumped)
> >> >>>> bash-2.05b$ ./viga.cgi
> >> >>>> Content-type: text/html
> >> >>>>
> >> >>>> point(1.1)
> >> >>>>
> >> >>>> point(2.1)
> >> >>>>
> >> >>>> Segmentation fault (core dumped)
> >> >>>> bash-2.05b$ ./viga.cgi
> >> >>>> Content-type: text/html
> >> >>>>
> >> >>>> point(1.1)
> >> >>>>
> >> >>>> point(2.1)
> >> >>>>
> >> >>>> reaches this only 9 times of 10!
> >> >>>>
> >> >>>> point(2.2)
> >> >>>>
> >> >>>> point(1.2)
> >> >>>>
> >> >>>> bash-2.05b$ bash-2.05b$
> >> >>>> ---------------------------------------------------------------------
> >> >>>>
> >> >>>> I can send you the core dump files. I dont want to put them on a public
> >> >>>server,
> >> >>>> because they might contain important information about my server. Can I
> >> >>>send
> >> >>>> them to your email?
> >> >>>>
> >> >>>> Martin.
> >> >>>>
> >> >>>>
> >> >>>>
> >> >>>
> >> >>>
> >> >>
> >> >>
> >> >
> >> >
> >>
> >>
> >
> >
>
>


August 20, 2004
Have you tried some simple variations like
 int main() { char[8000] x; return 0; }
or
 void foo() { char[8000] x; }
 int main(){ foo(); return 0; }
etc

Or maybe the compiler is messing up the C-style decls
char abs[2000];
vs
char[2000] abs;
That would be very wierd, but who knows...

Martin (very worried) wrote:

> See: "to Walter: important BUG (I think)"
> 
> Error on a very low level of the D language is a very big problem and I think it must be handled very quiqkly.
> 
>>This looks like it could be a problem with stack overflows.
> 
> Yes, and it looks like it is an error in compiler. It is not a server
> error, because everything elese works fine. It is not a cgi error, because
> I tested it
> also direct throw ssh.  And I don't thik there is an error in my program,
> because it is very simple and there is nothing there that could cause a
> "Segmentation fault".
> 
> I dested it with 0.99, nothing changed.
> 
> SO DO YOU WANT THE CORE DUMP FILES(I think they include the memory image
> of the prgogram, at the moment of segmentation fault)?
> If you do, where do I send them?
> if you don't, tell me, I stop offering then.
> 
> I think this error is a very big problem, because the 1.00 version is very near.
> 
> If the 1.00 has this error, it is quite USELESS, atleast for server applications. I would have no other choice than to move back to C, because I am writing server applications and they need to work.
> 
> I am sorry for my boldness but I am just VERY WORRIED.
> I was under the impression that you didn't take it very seriously.
> But this error shlould be taken care of, or else the D is not very
> valuable.
> 
> So are you going to fix it?
> 
> And agin: do you want the core dump files?
> 
> 
> THANK YOU!
> 
> 
> AGAIN THE PROGRAM:
> 
> 
> import std.c.stdlib;
> import std.c.stdio;
> import std.stream;
> import std.string;
> import std.conv;
> 
> void ulog(char []s){  //LOGS ONTO SCREEN
> printf("%.*s\n",s);
> fflush(std.c.stdio.stdout);
> }
> 
> int open(){
> char *s;
> char abs[2000];
> char qu[100];
> int a;
> ulog("reaches this only 9 times of 10!\n");
> return 0;
> }
> 
> 
> int yhenda(){
> char MEM[2200];
> int a;
> ulog("point(2.1) \n");
> open();
> ulog("point(2.2) \n");
> return 0;
> }
> 
> 
> int main(){
> printf("Content-type: text/html\n\n");
> fflush(std.c.stdio.stdout);
> ulog("point(1.1)\n");
> yhenda();
> ulog("point(1.2)\n");
> return 0;
> }
> 
> 
> 
> In article <cg2r0o$28pk$1@digitaldaemon.com>, Walter says...
>>
>>This looks like it could be a problem with stack overflows.
>>
>>"Martin" <Martin_member@pathlink.com> wrote in message news:cg1o1m$179m$1@digitaldaemon.com...
>>> I have been writing a cgi program and I've noticed one problem. There tend
>>to be
>>> some problems with local arrays (inside functions).
>>>
>>> Here is a sample program, that tends to crash about 1/10 of time. It only crashes on a busy web server, never on my local computer. (And it isnt the fflush function, it's the same without it)
>>> -----------------------------------------------------------------------
>>> import std.c.stdlib;
>>> import std.c.stdio;
>>> import std.stream;
>>> import std.string;
>>> import std.conv;
>>>
>>> void ulog(char []s){  //LOGS ONTO SCREEN
>>> printf("%.*s\n",s);
>>> fflush(std.c.stdio.stdout);
>>> }
>>>
>>> int open(){
>>> char *s;
>>> char abs[2000];
>>> char qu[100];
>>> int a;
>>> ulog("reaches this only 9 times of 10!\n");
>>> return 0;
>>> }
>>>
>>>
>>> int yhenda(){
>>> char MEM[2200];
>>> int a;
>>> ulog("point(2.1) \n");
>>> open();
>>> ulog("point(2.2) \n");
>>> return 0;
>>> }
>>>
>>>
>>> int main(){
>>> printf("Content-type: text/html\n\n");
>>> fflush(std.c.stdio.stdout);
>>> ulog("point(1.1)\n");
>>> yhenda();
>>> ulog("point(1.2)\n");
>>> return 0;
>>> }
>>> -----------------------------------------------------------------------
>>> Very simple program, shouldn't crash.
>>> (Notice: when I put char []abs=new char[2000]; instead of char
>>> abs[2000];,
>>the
>>> same with qu, it works fine.)
>>>
>>>
>>> I tested it over ssh, here is the screen(viga.cgi is the name of the
>>progam, it
>>> is compiled with the latest version of dmd):
>>> -----------------------------------------------------------------------
>>> bash-2.05b$ ./viga.cgi
>>> Content-type: text/html
>>>
>>> point(1.1)
>>>
>>> point(2.1)
>>>
>>> reaches this only 9 times of 10!
>>>
>>> point(2.2)
>>>
>>> point(1.2)
>>>
>>> bash-2.05b$ ./viga.cgi
>>> Content-type: text/html
>>>
>>> point(1.1)
>>>
>>> point(2.1)
>>>
>>> Segmentation fault (core dumped)
>>> bash-2.05b$ ./viga.cgi
>>> Content-type: text/html
>>>
>>> point(1.1)
>>>
>>> point(2.1)
>>>
>>> Segmentation fault (core dumped)
>>> bash-2.05b$ ./viga.cgi
>>> Content-type: text/html
>>>
>>> point(1.1)
>>>
>>> point(2.1)
>>>
>>> reaches this only 9 times of 10!
>>>
>>> point(2.2)
>>>
>>> point(1.2)
>>>
>>> bash-2.05b$ bash-2.05b$
>>> ---------------------------------------------------------------------
>>>
>>> I can send you the core dump files. I dont want to put them on a public
>>server,
>>> because they might contain important information about my server. Can I
>>send
>>> them to your email?
>>>
>>> Martin.
>>>
>>>
>>>
>>
>>

August 20, 2004

"Martin (very worried)" wrote:
> 
> See: "to Walter: important BUG (I think)"
> 
> Error on a very low level of the D language is a very big problem and I think it must be handled very quiqkly.
> 
> >This looks like it could be a problem with stack overflows.
> 
> Yes, and it looks like it is an error in compiler. It is not a server error, because everything elese works fine. It is not a cgi error, because I tested it also direct throw ssh.  And I don't thik there is an error in my program, because it is very simple and there is nothing there that could cause a "Segmentation fault".
> 
> I dested it with 0.99, nothing changed.
> 
> SO DO YOU WANT THE CORE DUMP FILES(I think they include the memory image of the
> prgogram, at the moment of segmentation fault)?
> If you do, where do I send them?
> if you don't, tell me, I stop offering then.

Martin, you are surely not ignored and there are at least a dozen people here that take this error seriously.

I just found the time to compile and test your code under Suse Linux 9.1 and gcc 3.3.3, dmd 0.98. I did 1225551 runs total without a single fault.

You seem to be sure it is a compiler fault.  I'm not so sure about the cause of this error. Maybe its your system or gcc.

-- 
Helmut Leitner    leitner@hls.via.at
Graz, Austria   www.hls-software.com