This is the mail archive of the libc-alpha@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[jbpn@adaptivebroadband.com] libc/1194: pthread bug triggered by mixing fprintf and fputc



Hi all,

here comes another bug report where I ask for your help fixing it.

Thanks,
Andreas



Topics:
   libc/1194: pthread bug triggered by mixing fprintf and fputc


----------------------------------------------------------------------

Date: Thu, 1 Jul 1999 10:36:16 -0400
From: jbpn@adaptivebroadband.com
To: bugs@gnu.org
Subject: libc/1194: pthread bug triggered by mixing fprintf and fputc
Message-Id: <199907011436.KAA32480@delysid.gnu.org>


>Number:         1194
>Category:       libc
>Synopsis:       pthread bug triggered by mixing fprintf and fputc
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    libc-gnats
>State:          open
>Class:          sw-bug
>Submitter-Id:   unknown
>Arrival-Date:   Thu Jul 01 10:40:01 EDT 1999
>Last-Modified:
>Originator:     jbpn@adaptivebroadband.com
>Organization:
net
>Release:        2.1.1-6
>Environment:
Linux santiago.adaptivebroadband.com 2.2.9 #3 Mon Jun 21 11:30:38 BST 1999 i686 unknown
>Description:
Compiling the code included below with the command line:

	gcc -lpthread -D_REENTRANT <source file>

and then running it cause a SEGV.  It looks a bit like fputc might still have
the same mutex problems that other operations used to have. 
>How-To-Repeat:
#include <stdlib.h>
#include <stdio.h>
#include <pthread.h>
#include <stdarg.h>
#include <unistd.h>

void *thread_a(void *p) {
  for (;;) {
    fprintf(stderr, "*");
  }
}

void *thread_b(void *p) {
  for (;;) {
    fputc(' ', stderr);
  }
}

int main (int argc, char *argv[]) 
{
  pthread_t thread;

  pthread_create (&thread, NULL, thread_a, NULL);
  pthread_create (&thread, NULL, thread_b, NULL);
  for (;;) {
    sleep(30);
  }
  return 0;
}%0
>Fix:
>Audit-Trail:
>Unformatted:


------------------------------

End of forwardtJBecT Digest
***************************



-- 
 Andreas Jaeger   aj@arthur.rhein-neckar.de    jaeger@informatik.uni-kl.de
  for pgp-key finger ajaeger@aixd1.rhrk.uni-kl.de

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]