bug on alpha. already fixed?

Martin Vogt mvogt@aixd1.rhrk.uni-kl.de
Wed Jan 13 05:41:00 GMT 1999


Hi,


This bug is in the current debian and rh5.2 distibutions.
They use an old egcs version, and maybe its already fixed.

THE BUG IS ON ALPHA ONLY INTEL WORKS !!

If you link the demo prog with the pthread library at the end of the
command line the programm works, at the begining it segfaults.
This program needs a installed KDE, and it only segfaults when
I link it with KDE. But I think its more a linker/egcs bug
than a KDE bug, because on intel it works.



/* 

  This program runs in both versions on my Intel RedHat 5.2 but on
  the alpha it gives a segfault if the pthread library is
  linked at first.

  I think this is a bug.

  Intel works:  RH5.2

  Alpha Debian segfault.
  * egcs-2.90.29 980515 (egcs-1.0.3 release)


*/

// KDE include files
#include <kapp.h>
#include <pthread.h>
 

/*




 Success :

g++ -I/opt/kde/include -I/opt/qt/include -I/usr/X11R6/include -L/opt/kde/lib
-L/opt/qt/lib -L/usr/X11R6/lib test.cpp  -lkfile -lkfm -lkdeui -lkdecore -lqt
-lXext -lX11 -lpthread


 SEGFAULT :
 
g++ -I/opt/kde/include -I/opt/qt/include -I/usr/X11R6/include -L/opt/kde/lib    
-L/opt/qt/lib -L/usr/X11R6/lib test.cpp  -lpthread -lkfile -lkfm -lkdeui
 -lkdecore -lqt  -lXext -lX11


The only difference is the linking order of the pthread library.

  
  
*/

 
static void *writerThread(void *arg){
   printf("a\n");
   return NULL;
}

int main(int nargs,char** args) {  
   printf("hi\n");
   KApplication a( nargs, args, "kmpg" );
   pthread_t tr;   
   printf("hello\n");
   pthread_create(&tr,NULL,writerThread,NULL);
   printf("b\n");
   a.exec();
   return 0;
 }







More information about the Gcc-bugs mailing list