Bug 836541

Summary: When I use crypt(3) function, the programs crash with Segmentation fault on x64 openSUSE .
Product: [openSUSE] openSUSE Tumbleweed Reporter: Mitsutoshi NAKANO <bkbin005>
Component: BasesystemAssignee: E-mail List <bnc-team-screening>
Status: VERIFIED INVALID QA Contact: E-mail List <qa-bugs>
Severity: Major    
Priority: P5 - None    
Version: 13.1 Milestone 4   
Target Milestone: ---   
Hardware: x86-64   
OS: SUSE Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: fixed source program .

Description Mitsutoshi NAKANO 2013-08-24 06:42:24 UTC
User-Agent:       Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1609.3 Safari/537.36

I am testing openSUSE 13.1 Milestone 4 x86_64 with GNOME desktop in VirtualBox
4.2.16 r86992 on Windows 7 SP1 64 bit .
Host information: https://dl.dropboxusercontent.com/u/86335040/DxDiag17.txt .

I am using crypt(3) function, but the programs crash with Segmentation fault on x64 openSUSE .
i586 has no problem .


This is the sample program .
/******** crypttest.c ********/
#include <stdio.h>
#include <unistd.h>

int
main(int argc, char *argv[])
{
  printf("%s\n", crypt ("aaaaaaaa", "aa"));
  return 0;
}
/******** End of crypttest.c ********/


Reproducible: Always

Steps to Reproduce:
1. gcc crypttest.c -lcrypt
2. ./a.out

Actual Results:  
The program crashes with SEGV in _IO_vfprintf_internal() at vfprintf.c:1629 .

Expected Results:  
The program should print an encrypted string "aakcR08PK3l1o", like as i586 openSUSE .

> rpm -qf /usr/lib64/libcrypt.so
glibc-devel-2.17-21.2.x86_64
> rpm -qf /lib64/libcrypt-2.17.so
glibc-2.17-21.2.x86_64

Debian 7.1 x64 has same issue .
Debian 7.1 x86 has no problem .


Please see also: http://sourceforge.jp/projects/freewnn/lists/archive/users/2013-August/000161.html
Comment 1 Mitsutoshi NAKANO 2013-08-24 10:14:41 UTC
Created attachment 554055 [details]
fixed source program .

I noticed that I foreget to define a feature test macro "_XOPEN_SOURCE" .
I added "#define _XOPEN_SOURCE",
then the program outputs normal encrypted string .

Sorry .
Comment 2 Mitsutoshi NAKANO 2013-08-24 10:19:23 UTC
This issue was closed as INVALID .
Because This issue is a misunderstanding .