Thread: RE: [Dev-C++] Problem on XP Professional
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Ed C. <em...@ed...> - 2004-01-27 15:18:46
|
Mohammed, You have a buffer overflow or a problem with pointers. For example, if you declared in one place char a[] = "Hello world", then tried to do sprintf(a,"xxxxxxxxxxxxxxxxxxxx"), that could do it. More likely, you're doing something like assigning an invalid value to a pointer or failing to use malloc(). If your program took three hours to compile and you haven't debugged it, yet, it's going to take you a LONG time to find all the problems. I suggest reading up on pointers at http://www.eskimo.com/~scs/C-faq/top.html Hope that helps! -Ed -----Original Message----- From: dev...@li... [mailto:dev...@li...] On Behalf Of Mohammed Iqbal Sent: Saturday, January 24, 2004 12:36 AM To: Dev-Cpp-Users Subject: [Dev-C++] Problem on XP Professional Hi... I wrote a a large program with Dev-C++ on Windows XP Professional. The compilation went smooth for three hours and the program ran fine. There's only one problem I can't find the reason for it. Some parts of my program when I try to use produces an error message saying that some portion of memory can't be written. Why? Mohammed ------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ Dev-cpp-users mailing list Dev...@li... TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm https://lists.sourceforge.net/lists/listinfo/dev-cpp-users |
|
From: Ed C. <em...@ed...> - 2004-01-27 21:36:35
|
Marhaba Mohammed, Glad it's working for you! I'm sorry if I sounded patronizing, earlier; = I didn't mean to be. I'm surprised adding memory worked, but I'm glad it works. -Ed P.S. Are you in Jordan? (I saw the .jo in your address.) Where, if you = don't mind my asking? I've spent some time in Amman, and I love the country. =20 -----Original Message----- From: Mohammed Iqbal [mailto:mi...@ac...]=20 Sent: Tuesday, January 27, 2004 12:52 PM To: Ed Cottrell; 'Dev-Cpp-Users' Subject: Re: [Dev-C++] Problem on XP Professional ----- Original Message ----- From: "Ed Cottrell" <em...@ed...> To: "'Mohammed Iqbal'" <mi...@ac...>; "'Dev-Cpp-Users'" <dev...@li...> Sent: Tuesday, January 27, 2004 6:16 PM Subject: RE: [Dev-C++] Problem on XP Professional > Mohammed, > > You have a buffer overflow or a problem with pointers. For example, if = you > declared in one place char a[] =3D "Hello world", then tried to do > sprintf(a,"xxxxxxxxxxxxxxxxxxxx"), that could do it. More likely, = you're > doing something like assigning an invalid value to a pointer or = failing to > use malloc(). I checked it many times. No problem with pointers. It is a memory = allocation problem. The problem is solved because I added more memory to my = computer. > If your program took three hours to compile and you haven't debugged = it, > yet, it's going to take you a LONG time to find all the problems. I suggest > reading up on pointers at http://www.eskimo.com/~scs/C-faq/top.html it took all that time to compile because it is very big and uses class templates and function templates heavily. Mohammed |
|
From: Mohammed I. <mi...@ac...> - 2004-01-27 18:51:11
|
----- Original Message ----- From: "Ed Cottrell" <em...@ed...> To: "'Mohammed Iqbal'" <mi...@ac...>; "'Dev-Cpp-Users'" <dev...@li...> Sent: Tuesday, January 27, 2004 6:16 PM Subject: RE: [Dev-C++] Problem on XP Professional > Mohammed, > > You have a buffer overflow or a problem with pointers. For example, if you > declared in one place char a[] = "Hello world", then tried to do > sprintf(a,"xxxxxxxxxxxxxxxxxxxx"), that could do it. More likely, you're > doing something like assigning an invalid value to a pointer or failing to > use malloc(). I checked it many times. No problem with pointers. It is a memory allocation problem. The problem is solved because I added more memory to my computer. > If your program took three hours to compile and you haven't debugged it, > yet, it's going to take you a LONG time to find all the problems. I suggest > reading up on pointers at http://www.eskimo.com/~scs/C-faq/top.html it took all that time to compile because it is very big and uses class templates and function templates heavily. Mohammed |
|
From: Per W. <pw...@ia...> - 2004-01-27 22:30:37
|
You should still track down the problem. If a memory allocation fail, you want to trap the problem and either terminate the program with a message that the user should release more memory before running it, or you want the program to continue but without the exptra features that requires more memory. /Per W On Tue, 27 Jan 2004, Mohammed Iqbal wrote: > > ----- Original Message ----- > From: "Ed Cottrell" <em...@ed...> > To: "'Mohammed Iqbal'" <mi...@ac...>; "'Dev-Cpp-Users'" > <dev...@li...> > Sent: Tuesday, January 27, 2004 6:16 PM > Subject: RE: [Dev-C++] Problem on XP Professional > > > > Mohammed, > > > > You have a buffer overflow or a problem with pointers. For example, if you > > declared in one place char a[] = "Hello world", then tried to do > > sprintf(a,"xxxxxxxxxxxxxxxxxxxx"), that could do it. More likely, you're > > doing something like assigning an invalid value to a pointer or failing to > > use malloc(). > > I checked it many times. No problem with pointers. It is a memory allocation > problem. The problem is solved because I added more memory to my computer. > > > > If your program took three hours to compile and you haven't debugged it, > > yet, it's going to take you a LONG time to find all the problems. I > suggest > > reading up on pointers at http://www.eskimo.com/~scs/C-faq/top.html > > it took all that time to compile because it is very big and uses class > templates and function templates heavily. > > Mohammed > > > > > > ------------------------------------------------------- > The SF.Net email is sponsored by EclipseCon 2004 > Premiere Conference on Open Tools Development and Integration > See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. > http://www.eclipsecon.org/osdn > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |