Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Aug 2001 13:49:29 +0200 (CEST)
From:      Jakub Kruszona-Zawadzki <acid@gem.pl>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   misc/29987: error in libc (simultanous call to malloc or free and printf causes Segmentation Fault)
Message-ID:  <200108231149.f7NBnTu98952@unix-server.local.gem.pl>

next in thread | raw e-mail | index | archive | help

>Number:         29987
>Category:       misc
>Synopsis:       error in libc (simultanous call to malloc or free and printf causes Segmentation Fault)
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Aug 23 04:50:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Jakub Kruszona-Zawadzki
>Release:        FreeBSD 4.4-PRERELEASE i386
>Organization:
Global eMarketing S.A.
>Environment:

System: FreeBSD unix-server.local.gem.pl 4.4-PRERELEASE FreeBSD 4.4-PRERELEASE #0: Wed Aug 8 11:23:46 CEST 2001 acid@unix-server.local.gem.pl:/usr/obj/usr/src/sys/GEMIUS i386
Machine: Celeron 600

same bug exists on different freebsd versions. We tested FreeBSD 4.1 and FreeBSD 4.3. On both problem exists
(We tested it on Linux too - there is no such problem)

>Description:
	It looks like libc has problems with simultanous calls to some functions
>How-To-Repeat:
	Just compile, and run this code:

/-------------------------------------------------/
#include <signal.h>
#include <stdio.h>

void salarm(int sn) {
	static int s=1;
	alarm(1);
	fprintf(stderr,"Test %09d, %lf\n",s,1/((double)s));	
	s++;
}

int main() {
	char *a;
	int i;
	signal(SIGALRM,salarm);
	alarm(1);
	for (i=0 ; i<1000000 ; i++) {
		a=(char *)malloc(1000000);
		if (a==NULL) printf("NULL !!!\n");
		free(a);
	}
	return 1;
}
/-------------------------------------------------/

>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200108231149.f7NBnTu98952>