Date: Tue, 12 May 1998 11:14:56 -0700 (PDT) From: Doug White <dwhite@gdi.uoregon.edu> To: Jean-Paul Beconne <beconne@nmrc.ucc.ie> Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Problem with malloc() and free() Message-ID: <Pine.BSF.3.96.980512111331.2985e-100000@gdi.uoregon.edu> In-Reply-To: <355848E3.CC8FFC39@nmrc.ucc.ie>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 12 May 1998, Jean-Paul Beconne wrote: > I wrote some code using malloc(), realloc() and free(). When I compiled > it I got an application which has the following problems : > > 1- when free(pointeur) is reach, the application exited and sent the > following error : /usr/libexec/ld.so "AMIC" undefined symbol Please quote the entire error message. > 2- the function printf has a strange behavior : > the code : > printf("something"); > printf("variable %s\n", string); > where string is a pointeur (char) manipulated with malloc() and > realloc() is > working. > And the code : > /* printf("something"); */ > printf("variable %s\n", string); > sends the error "Segmentation fault". Are you initializing string to NULLs? printf is probably running off the end of the variable because it isn't initialized. I'd have to see the entire code. Doug White | University of Oregon Internet: dwhite@resnet.uoregon.edu | Residence Networking Assistant http://gladstone.uoregon.edu/~dwhite | Computer Science Major To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.980512111331.2985e-100000>