From owner-freebsd-questions Tue May 12 06:04:56 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id GAA28250 for freebsd-questions-outgoing; Tue, 12 May 1998 06:04:56 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from bastion.nmrc.ucc.ie (nmrc.ucc.ie [143.239.64.1]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id GAA28244 for ; Tue, 12 May 1998 06:04:51 -0700 (PDT) (envelope-from beconne@nmrc.ucc.ie) Received: from odessa.nmrc.ucc.ie (odessa.nmrc.ucc.ie [143.239.64.65]) by bastion.nmrc.ucc.ie (8.9.0.Beta5/8.9.0.Beta5) with ESMTP id OAA00810 for ; Tue, 12 May 1998 14:05:08 +0100 (BST) Message-ID: <355848E3.CC8FFC39@nmrc.ucc.ie> Date: Tue, 12 May 1998 14:04:35 +0100 From: Jean-Paul Beconne Organization: NMRC X-Mailer: Mozilla 4.05 [en] (X11; U; SunOS 5.5.1 sun4u) MIME-Version: 1.0 To: freebsd-questions@FreeBSD.ORG Subject: Problem with malloc() and free() Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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 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". I am developping the application under FreeBSD 2.2.5 and I don't get the errors under Solaris. Thanks for any help. J-P. Beconne ------------------------------------------------------- Dr. Jean-Paul Beconne National Microelectronics Research Center CAD Group University College Phone : +353 21 904063 Lee Maltings Fax : +353 21 270271 Prospect Row http://nmrc.ucc.ie/ CORK (Ireland) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message