Bug 139806

Summary: ia32el doesn't output elf32 core dump files.
Product: Red Hat Enterprise Linux 4 Reporter: L3support <linux-sid>
Component: ia32elAssignee: Jakub Jelinek <jakub>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 4.0CC: grgustaf, jturner, yoav.zach
Target Milestone: ---   
Target Release: ---   
Hardware: ia64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-01-14 11:28:56 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:
Attachments:
Description Flags
fix for this issue none

Description L3support 2004-11-18 06:15:32 UTC
Description of problem:
ia32el doesn't output elf32 core dump files but elf64 core dump files. 

Version-Release number of selected component (if applicable):
ia32el-1.1-8

How reproducible:
always

Steps to Reproduce:
1. Compile the following source on RHEL4 for i386
   # cat test-core.c
   #include <stdio.h>
   #include <stdlib.h>

   main()
   {
           printf("start\n");
           CBABRT();
           printf("ended\n");
   }

   CBABRT()
   {
           abort();
   }
   # cc -o test-core test-core.c

2. Copy the compiled application to RHEL4 for ia64
   
3. Run the applicaion on IA32EL
   # /etc/init.d/ia32el status
   Intel IA-32 Execution Layer in use
   # ulimit -c unlimited
   # file test-core
   test-core: ELF 32-bit LSB executable, Intel 80386, version 1
(SYSV), for GNU/Linux 2.2.5, dynamically linked (uses shared libs),
not stripped
   # ./test-core
   start
   Aborted (core dumped)

4. See the file type of the core dump file
   # file core.<pid>
   core.6420: ELF 64-bit LSB core file IA-64, version 1 (SYSV),
SVR4-style, SVR4-style, SVR4-style

Actual results:
   core.6420: ELF 64-bit LSB core file IA-64, version 1 (SYSV),
SVR4-style, SVR4-style, SVR4-style

Expected results:
core.6420: ELF 32-bit LSB core file Intel 80386, version 1 (SYSV),
SVR4-style, SVR4-style, from 'test-core'

Additional info:

Comment 1 Jakub Jelinek 2004-11-18 10:02:45 UTC
With ia32el the kernel doesn't really know at all that the emulator is
running 32-bit process.
I guess one option is let ia32el do the core dumping (intercept SIGABRT, SIGSEGV
etc. signals) in userland.

Comment 2 L3support 2004-11-19 00:00:19 UTC
In case of SIGSEGV, ia32el can output 32bit core dump file. So it
seems that ia32el cannot properly handle some signals whose action is
'core'.

----
$ cat test-sigsegv.c
main()
{
    int *p, *q;
    p=0;
    *q=*p;
}
$ file test-sigsegv
test-sigsegv: ELF 32-bit LSB executable, Intel 80386, version 1
(SYSV), for GNU/Linux 2.2.5, dynamically linked (uses shared libs),
not stripped
$ uname -a
Linux ipf11 2.6.9-1.648_EL #1 SMP Tue Oct 26 12:20:12 EDT 2004 ia64
ia64 ia64 GNU/Linux
$ /etc/init.d/ia32el status
Intel IA-32 Execution Layer in use
$ ./test-sigsegv
Segmentation fault
$ file core.7607
core.7607: ELF 32-bit LSB core file Intel 80386, version 1 (SYSV),
SVR4-style, SVR4-style, from 'test-sigsegv'
-----------------------

Thanks,

Comment 3 Yoav Zach 2004-11-30 23:31:06 UTC
Created attachment 107672 [details]
fix for this issue

Comment 4 Jakub Jelinek 2004-12-06 17:02:51 UTC
Should be fixed in ia32el-1.1-12 in dist-4E-lacd, also put to ftp://people.redhat.com/jakub/ia32el/

Comment 5 Jay Turner 2005-01-14 11:28:56 UTC
Fix confirmed with 1.1-20:

[root@tomservo tmp]# arch
ia64
[root@tomservo tmp]# file core.27830
core.27830: ELF 32-bit LSB core file Intel 80386, version 1 (SYSV), SVR4-style,
SVR4-style, from 'test-core'