Bug 114845

Summary: _exit() in IA32 comaptibility lib calls unimplemented syscall
Product: Red Hat Enterprise Linux 3 Reporter: Martin Wilck <martin.wilck>
Component: glibcAssignee: Jakub Jelinek <jakub>
Status: CLOSED CURRENTRELEASE QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.0   
Target Milestone: ---   
Target Release: ---   
Hardware: ia64   
OS: Linux   
Whiteboard:
Fixed In Version: 107116 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-02-09 10:52:21 EST Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:

Description Martin Wilck 2004-02-03 10:34:18 EST
Description of problem:
The _exit() function in libc(IA32) calls syscall 252 (exit_group)
which is unimplemented in the IA64 emulation. exit() is called anyway,
so this may not have major adverse effects. However, the wrong syscall
generates an ugly syslog message. Moreover, there are many other
unimplemented ia32 syscalls, some of which are called on a regular
basis by ia32 applications. 

Version-Release number of selected component (if applicable):
2.3.2-95.6

How reproducible:
always

Steps to Reproduce:
1. compile "Hello World" C Program on i386 (using shared libs)
2. run generated executable on ia64

  
Actual results:
/var/log/messages entry:
kernel: IA32 syscall #252 issued, maybe we should implement it


Expected results:
No error message

Additional info:
There are a number of other syscalls that cause similar error
messages, I have seen #258 (set_tid_address) and #270 (tgkill).
Comment 1 Martin Wilck 2004-02-03 10:39:42 EST
I know you want to mark this as a duplicate of BUG 107116.

Before you do so, hgave a look at this code:

GLIBC_SOURCES/sysdeps/unix/sysv/linux/_exit.c

void
_exit (status)
     int status;
{
  while (1)
    {
#ifdef __NR_exit_group
      INLINE_SYSCALL (exit_group, 1, status);
#endif
      INLINE_SYSCALL (exit, 1, status);

#ifdef ABORT_INSTRUCTION
      ABORT_INSTRUCTION;
#endif
    }
}

Looking at this code, it seems that this file includes wrong kernel
headers suggesting that the exit_group() syscall exists. 

IMO there'd be an easy way to handle this problem: include correct
kernel headers that do not define NR_exit_group and other NR_ macros
for unimplemented syscalls on ia64/ia32.
Comment 2 Jakub Jelinek 2004-02-09 10:52:21 EST
exit_group is implemented on i386, therefore it is of course in
i386 headers.  Compatibility libraries certainly shouldn't differ
from the real ones, it really either needs to be implemented in the
kernel, or implemented in the emulator.
Comment 3 Martin Wilck 2004-02-09 12:30:05 EST
I fail to see why a compatibility library should invoke unimplemented
system calls. Actually, I consider that pretty dangerous. 

To my understanding, what mainly matters is the ABI exposed by the
library to applications, not the kernel interface.