public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Casper.Dik@Holland.Sun.Com (Casper H.S. Dik - Network Security Engineer)
To: help-gcc@gnu.org
Subject: Re: Segmentation fault on malloc call
Date: Fri, 01 Oct 1999 00:00:00 -0000	[thread overview]
Message-ID: <casper.938679284@uk-usenet.uk.sun.com> (raw)
Message-ID: <19991001000000.RimZ5b5490M5fsDWbkmP0jF7ecSH7zzI1wgk_jf1K98@z> (raw)
In-Reply-To: <37F1267C.A43C951F@engr.tu.ac.th>

[[ PLEASE DON'T SEND ME EMAIL COPIES OF POSTINGS ]]

Nawin Somyat <snawin@engr.tu.ac.th> writes:

>I'm tring to test memory allocation on my system and get SIGSEGV with
>the
>following (extracted) code

>.....
>SYM_ENTRY* entry;

>if ((entry = malloc(sizeof(SYM_ENTRY)) == NULL)
>  return (NULL);
>.....

>where SYM_ENTRY is a pointer.

>When I do a loop on this code, only after a few loops, the program gives
>me
>SIGSEGV. This fault is reproducible after the same number of loops.


You're overstepping the boundaries of the malloc'ed memory.

(A crash in malloc typically indicates a memory use error in your
program)

Casper
--
Expressed in this posting are my opinions.  They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.

  reply	other threads:[~1999-10-01  0:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-09-29 13:48 Nawin Somyat
1999-09-30  1:26 ` Casper H.S. Dik - Network Security Engineer [this message]
1999-09-30 23:56   ` Casper H.S. Dik - Network Security Engineer
1999-10-01  0:00   ` Casper H.S. Dik - Network Security Engineer
1999-09-30  6:03 ` Kenneth C Stahl
1999-09-30  6:12   ` Alan Stange
1999-09-30 23:56     ` Alan Stange
1999-10-01  0:00     ` Alan Stange
1999-09-30 23:56   ` Kenneth C Stahl
1999-10-01  0:00   ` Kenneth C Stahl
1999-09-30 23:56 ` Nawin Somyat
1999-10-01  0:00 ` Nawin Somyat

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=casper.938679284@uk-usenet.uk.sun.com \
    --to=casper.dik@holland.sun.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).