public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: atharaken@my-deja.com
To: help-gcc@gnu.org
Subject: Re: Segmentation Fault: new char[12]
Date: Wed, 08 Dec 1999 07:21:00 -0000	[thread overview]
Message-ID: <82ls9f$8il$1@nnrp1.deja.com> (raw)
In-Reply-To: <82kesh$994$1@nnrp1.deja.com>

Any free tools to detect memory leaks!!! Purify and Insure both cost a
lot. Any others!

In article < 82kesh$994$1@nnrp1.deja.com >,
  hwidjaja@my-deja.com wrote:
> I didn't see problem at your code..
> you mentioned that i gives a segm. fault when large number of users
> are accessing it ...
> I suspect that there is memory leaks in your code. Then you run out of
> memory...
> my suggestion is to check it,
>  you can use 'top -U<username>' or 'ps'.
>
> hwidjaja
> In article < 82jp3a$pal$1@nnrp1.deja.com >,
>   atharaken@my-deja.com wrote:
> > This is a snippet of some code I am using. I get a Segmentation
Fault
> > in _smalloc (malloc). It works sometimes and when a large number of
> > users are accessing it gives a segmentation fault.
> >
> > It happens at the line:
> >
> > _string = new char [_capacity];
> >
> > I call this using _Init(12);
> > This is a protected class.
> >
> > /* BEGIN CODE HERE */
> >
> > bool MyClass::_Init (long size)
> > {
> >     _capacity = size;
> >     _string = new char [_capacity]; //Get Segmentation Fault at
> _smalloc
> >     if (!_string) {
> >         _capacity = _size = 0L;
> >         return false;
> >     }
> >     _size = 0;
> >     _string[0] = '\0';
> >     return true;
> > }
> >
> > /*END CODE HERE */
> >
> > Machine: i386
> > OS: Solaris 7
> > GCC 2.95 (Release)
> >
> > Any help is appreciated
> >
> > Thanks
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
> >
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>


Sent via Deja.com http://www.deja.com/
Before you buy.

WARNING: multiple messages have this Message-ID
From: atharaken@my-deja.com
To: help-gcc@gnu.org
Subject: Re: Segmentation Fault: new char[12]
Date: Fri, 31 Dec 1999 22:24:00 -0000	[thread overview]
Message-ID: <82ls9f$8il$1@nnrp1.deja.com> (raw)
Message-ID: <19991231222400.9jUATemWiwfUKiIneO8lbvqNDrsmgFZLjJlbYKsbqMk@z> (raw)
In-Reply-To: <82kesh$994$1@nnrp1.deja.com>

Any free tools to detect memory leaks!!! Purify and Insure both cost a
lot. Any others!

In article < 82kesh$994$1@nnrp1.deja.com >,
  hwidjaja@my-deja.com wrote:
> I didn't see problem at your code..
> you mentioned that i gives a segm. fault when large number of users
> are accessing it ...
> I suspect that there is memory leaks in your code. Then you run out of
> memory...
> my suggestion is to check it,
>  you can use 'top -U<username>' or 'ps'.
>
> hwidjaja
> In article < 82jp3a$pal$1@nnrp1.deja.com >,
>   atharaken@my-deja.com wrote:
> > This is a snippet of some code I am using. I get a Segmentation
Fault
> > in _smalloc (malloc). It works sometimes and when a large number of
> > users are accessing it gives a segmentation fault.
> >
> > It happens at the line:
> >
> > _string = new char [_capacity];
> >
> > I call this using _Init(12);
> > This is a protected class.
> >
> > /* BEGIN CODE HERE */
> >
> > bool MyClass::_Init (long size)
> > {
> >     _capacity = size;
> >     _string = new char [_capacity]; //Get Segmentation Fault at
> _smalloc
> >     if (!_string) {
> >         _capacity = _size = 0L;
> >         return false;
> >     }
> >     _size = 0;
> >     _string[0] = '\0';
> >     return true;
> > }
> >
> > /*END CODE HERE */
> >
> > Machine: i386
> > OS: Solaris 7
> > GCC 2.95 (Release)
> >
> > Any help is appreciated
> >
> > Thanks
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
> >
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>


Sent via Deja.com http://www.deja.com/
Before you buy.

  parent reply	other threads:[~1999-12-08  7:21 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-12-07 12:11 atharaken
1999-12-07 18:21 ` hwidjaja
1999-12-08  6:51   ` atharaken
1999-12-08 14:22     ` hwidjaja
1999-12-31 22:24       ` hwidjaja
1999-12-31 22:24     ` atharaken
1999-12-08  7:21   ` atharaken [this message]
1999-12-08 10:35     ` Mike Albaugh
1999-12-08 10:54       ` Josh Gagliardi
1999-12-31 22:24         ` Josh Gagliardi
1999-12-31 22:24       ` Mike Albaugh
1999-12-31 22:24     ` atharaken
1999-12-31 22:24   ` hwidjaja
1999-12-31 22:24 ` atharaken

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='82ls9f$8il$1@nnrp1.deja.com' \
    --to=atharaken@my-deja.com \
    --cc=help-gcc@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).