Skip to contentSkip to conversation

IA64 Linux library problem

Linux-ia64 Einar Saltnes 2 participants 3 messages Jul 19, 2000 – Jul 21, 2000

lore
Share & tools
lore
#0 lore raw

Hello!

We are experiencing some problems using some library routines on ia64. We have an Itanium monoprocessor from Fujitsu Siemens running Red Hat Linux
Development Release for IA-64.

1)
We experience that
sysconf(_SC_NPROCESSORS_ONLN) returns 0 (zero) on a monoprocessor ia64.

2)
We also experience errors using
cout << xxx << endl;
when linking with the pthread library.
Using "endl" will give segmentation fault when linking with pthread library, while the very same statement will be OK when not linking with pthread library.

//Program-------------------------------
#include <iostream.h>

int
main(void)
{
cout << "Heisann++" << endl;
}
//--------------------------------------

// Compilation:------------------------------------------ //-------------------------------------------------------
: eisa@scali9-11:ScaThread; g++ -D_REENTRANT -v -g -o
Linux2.ia64.gnu/test_out test_out.cpp -lstdc
++ -lm -lgcc -lc -lpthread
Reading specs from /usr/lib/gcc-lib/ia64-redhat-linux/2.9-ia64-000216-final/specs gcc version 2.9-ia64-000216-final
/usr/lib/gcc-lib/ia64-redhat-linux/2.9-ia64-000216-final/cpp -lang-c++
-v -D__GNUC__=2 -D__GNUG__=2
-D__GNUC_MINOR__=9 -D__cplusplus -D__ia64 -D__ia64__ -D__linux -D__linux__ -D_LONGLONG -Dlinux -Dunix
-D__LP64__ -D__ELF__ -D__ia64 -D__ia64__ -D__linux -D__linux__
-D_LONGLONG -D__linux__ -D__unix__ -D
__LP64__ -D__ELF__ -D__linux -D__unix -Asystem(linux) -Acpu(ia64) -Amachine(ia64) -D__EXCEPTIONS -g - D__LONG_MAX__’23372036854775807L -D_REENTRANT test_out.cpp /tmp/ccVJHNF8.ii
GNU CPP version 2.9-ia64-000216-final (IA-64)
#include "..." search starts here:
#include <...> search starts here:

/usr/lib/gcc-lib/ia64-redhat-linux/2.9-ia64-000216-final/../../../../include/g++-3
/usr/include

/usr/lib/gcc-lib/ia64-redhat-linux/2.9-ia64-000216-final/../../../../ia64-redhat-linux/include
/usr/lib/gcc-lib/ia64-redhat-linux/2.9-ia64-000216-final/include
/usr/include
End of search list.
The following default directories have been omitted from the search
path:
End of omitted list.
/usr/lib/gcc-lib/ia64-redhat-linux/2.9-ia64-000216-final/cc1plus
/tmp/ccVJHNF8.ii -ma-step -quiet -d
umpbase test_out.cc -g -version -o /tmp/cc6wLFW9.s
GNU C++ version 2.9-ia64-000216-final (ia64-redhat-linux) compiled by
GNU C version 2.9-ia64-000216-f
inal.

/usr/lib/gcc-lib/ia64-redhat-linux/2.9-ia64-000216-final/../../../../ia64-redhat-linux/bin/as -o /tm
p/ccSUoF6u.o /tmp/cc6wLFW9.s
/usr/lib/gcc-lib/ia64-redhat-linux/2.9-ia64-000216-final/collect2
-dynamic-linker /lib/ld-linux-ia64
.so.1 -o Linux2.ia64.gnu/test_out /usr/lib/gcc-lib/ia64-redhat-linux/2.9-ia64-000216-final/../../../c
rt1.o
/usr/lib/gcc-lib/ia64-redhat-linux/2.9-ia64-000216-final/../../../crti.o /usr/lib/gcc-lib/ia64-
redhat-linux/2.9-ia64-000216-final/crtbegin.o -L/usr/lib/gcc-lib/ia64-redhat-linux/2.9-ia64-000216-fi
nal -L/usr/lib/gcc-lib/ia64-redhat-linux/2.9-ia64-000216-final/../../../../ia64-redhat-linux/lib -L/u
sr/lib/gcc-lib/ia64-redhat-linux/2.9-ia64-000216-final/../../.. /tmp/ccSUoF6u.o -lstdc++ -lgcc -lpthr
ead -lstdc++ -lm -lc -lgcc -lc -lgcc /usr/lib/gcc-lib/ia64-redhat-linux/2.9-ia64-000216-final/crtend.
o
/usr/lib/gcc-lib/ia64-redhat-linux/2.9-ia64-000216-final/../../../crtn.o
: eisa@scali9-11:ScaThread; Linux2.ia64.gnu/test_out
Segmentation fault (core dumped)
: eisa@scali9-11:ScaThread;

//Stack Trace------------------------------------------------------ //----------------------------------------------------------------- (gdb) run
Starting program:
/home/eisa/work/ScaBase/src/lib/ScaThread/Linux2.ia64.gnu/test_out [New Thread 1024 (runnable)]

Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 1024 (runnable)]
__pthread_mutex_lock (mutex=0xe000000000b3b340) at mutex.c:83
83 mutex.c: No such file or directory.
Current language: auto; currently c
(gdb) bt
#0 __pthread_mutex_lock (mutex=0xe000000000b3b340) at mutex.c:83 #1 0x2000000000055610 in __flockfile (stream=0x6000000000003f20) at lockfile.c:32
#2 0x2000000000195c50 in _IO_putc (c, fp=0x6000000000003f20) at putc.c:32
#3 0x4000000000007a20 in endl (outs=@0x6000000000003cf0) at streambuf.h:58
#4 0x4000000000017040 in ostream::operator<< (this=0x6000000000003cf0,

    func=0x4000000000023730 <__EH_FRAME_END__+216>) at

../../../libio/iostream.cc:1039
#5 0x4000000000002cd0 in main () at test_out.cpp:38 (gdb)

//----------------------------------------------------------------

We are using:
- Linux scali9-11 2.4.0-0.8smp #1 SMP Sun Jun 18 00:32:35 EDT 2000 ia64 unknown
- gnupro Version: 0501, Release: 2, Build Date: Thu 01 Jun 2000 12:45:11 AM CEST
- glibc Version: 2.1.3, Release: 0.0427.7, Build Date: Mon 12 Jun 2000 03:42:49 AM CEST

Best Regards
Einar Saltnes
SW-Engineer

  e-mail:  [email protected]         Scali AS (http://www.scali.com)
  Tlf   : (+47) 22 62 89 50      Olaf Helsets vei 6
  Fax   : (+47) 22 62 89 51      N-0621 Oslo, Norway
#1 lore raw
Quoted 8 lines · Einar Saltnes

Hello!

We are experiencing some problems using some library routines on ia64. We have an Itanium monoprocessor from Fujitsu Siemens running Red Hat Linux
Development Release for IA-64.

Quoted 4 lines

1)
We experience that
sysconf(_SC_NPROCESSORS_ONLN) returns 0 (zero) on a monoprocessor ia64.

Known problem. It is a mismatch between libc and kernel.

Quoted 7 lines

2)
We also experience errors using
cout << xxx << endl;
when linking with the pthread library.
Using "endl" will give segmentation fault when linking with pthread library, while the very same statement will be OK when not linking with

It is a known problem. libc is MT safe. But libstdc++ is not configured for MT safe.

H.J.

#2 lore raw
In reply to Einar Saltnes
Quoted 23 lines · Einar Saltnes
Quoted 17 lines · H . J . Lu
Quoted 8 lines · Einar Saltnes

Hello!

We are experiencing some problems using some library routines on ia64. We have an Itanium monoprocessor from Fujitsu Siemens running Red Hat Linux
Development Release for IA-64.

Quoted 6 lines

2)
We also experience errors using
cout << xxx << endl;
when linking with the pthread library.
Using "endl" will give segmentation fault when linking with pthread library, while the very same statement will be OK when not linking with

Quoted 4 lines

It is a known problem. libc is MT safe. But libstdc++ is not configured for MT safe.

H.J.

Quoted 9 lines

Thank You for the reply!
We don't quite understand that libstdc++ is not configured MT safe, as the program stack shows the call to "pthread_mutex_lock". However, we are looking for solutions to continue our work on the ia64 and Linux combination.
Do You have any suggestions of what we should/can do to get a MT safe libstdc++ or do You have any indications of when a MT safe libstdc++ will be available?

I put a new rpms for alpha RedHat ia64 distribution at:

http://ftp.valinux.com/pub/support/hjl/ia64

There are 2 rpms and 2 small patches. I also enabled the shared libstdc++.

BTW, the next official ia64 gcc release is ok.

H.J.