Bug 139806 - ia32el doesn't output elf32 core dump files.
Summary: ia32el doesn't output elf32 core dump files.
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: ia32el
Version: 4.0
Hardware: ia64
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-11-18 06:15 UTC by L3support
Modified: 2007-11-30 22:07 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-01-14 11:28:56 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
fix for this issue (3.81 KB, patch)
2004-11-30 23:31 UTC, Yoav Zach
no flags Details | Diff

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'



Note You need to log in before you can comment on or make changes to this bug.