Bug 12780

Summary: libf2c shared libs cause core dump
Product: [Retired] Red Hat Powertools Reporter: mbw8
Component: f2cAssignee: Trond Eivind Glomsrxd <teg>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 6.2   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-06-23 16:01:18 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description mbw8 2000-06-21 14:03:42 UTC
Can link using libf2c.a but not libf2c.so

f2c-19991109-2
egcs-1.1.2-30
glibc-2.1.3-15 

The test program should print a zero. 

[matt@cr14205-a:~/f2c-test]$ f2c bar.f foo.f
bar.f:
   MAIN bar:
foo.f:
   mysub:
[matt@cr14205-a:~/f2c-test]$ gcc -c foo.c bar.c
[matt@cr14205-a:~/f2c-test]$ gcc -lf2c -lm foo.o bar.o -o main
[matt@cr14205-a:~/f2c-test]$ ./main
Segmentation fault (core dumped)                
[matt@cr14205-a:~/f2c-test]$ gcc  foo.o bar.o -o main /usr/lib/libf2c.a
[matt@cr14205-a:~/f2c-test]$ ./main
  0.           
[matt@cr14205-a:~/f2c-test]$ gcc foo.o bar.o -o main -lg2c
[matt@cr14205-a:~/f2c-test]$ ./main
  0.

It would appear that the core dump occurs in l_write(); this is from gdb

Program received signal SIGSEGV, Segmentation fault.
0x40029086 in l_write () from /usr/lib/libf2c.so.0
(gdb) list
1       rtld.c: No such file or directory.

Comment 1 Trond Eivind Glomsrxd 2000-06-21 14:58:24 UTC
Which architecture?

Comment 2 mbw8 2000-06-21 15:44:40 UTC
ARCH=i686; I am running a dual P3 upgraded to rh 6.2; uname -a reports

Linux cr14205-a 2.2.16 #1 SMP Mon Jun 12 16:05:28 EDT 2000 i686 unknown  

I have seen this error since 6.0; I patched my own version of fort77 to use
-lg2c instead of -lf2c (with unknown side effects)

Comment 3 Trond Eivind Glomsrxd 2000-06-23 16:01:16 UTC
Do you have the source files  (FORTRAN) you used?

Comment 4 mbw8 2000-06-23 16:58:43 UTC
Sorry, my error. I had crufty legacy code with a bounds violation in the
subroutine.