NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

port-sparc64/46724: Cannot compute sizeof short on NetBSD/sparc64 6.0_BETA2



>Number:         46724
>Category:       port-sparc64
>Synopsis:       Cannot compute sizeof short on NetBSD/sparc64 6.0_BETA2
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-sparc64-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jul 19 18:45:00 +0000 2012
>Originator:     Greg Schenzel
>Release:        NetBSD 6.0_BETA2
>Organization:
unixdev.net
>Environment:
System: NetBSD idlefortress.accessaxis.com 6.0_BETA2 NetBSD 6.0_BETA2 (GKERNEL) 
#0: Sat Jun 9 20:08:32 MDT 2012 
root%netbsd.accessaxis.com@localhost:/usr/src/sys/arch/sparc64/compile/GKERNEL 
sparc64
Architecture: sparc64
Machine: sparc64
Hardware: Sun Netra X1
>Description:

When attempting to compute the sizeof short on NetBSD/sparc64 6.0_BETA2, a 
fatal error is received. See below for sample conftest.c from pure-ftpd and 
ktruss output from the conftest binary.

>How-To-Repeat:

1. Create conftest.c as below:

/* confdefs.h.  */
#define PACKAGE_NAME "pure-ftpd"
#define PACKAGE_TARNAME "pure-ftpd"
#define PACKAGE_VERSION "1.0.35"
#define PACKAGE_STRING "pure-ftpd 1.0.35"
#define PACKAGE_BUGREPORT "bugs at pureftpd dot org"
#define PACKAGE "pure-ftpd"
#define VERSION "1.0.35"
#define _GNU_SOURCE 1
#define STDC_HEADERS 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STRING_H 1
#define HAVE_MEMORY_H 1
#define HAVE_STRINGS_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_STDINT_H 1
#define HAVE_UNISTD_H 1
#define __EXTENSIONS__ 1
#define _POSIX_PTHREAD_SEMANTICS 1
#define _TANDEM_SOURCE 1
#define STDC_HEADERS 1
#define TIME_WITH_SYS_TIME 1
#define HAVE_DIRENT_H 1
#define HAVE_SYS_WAIT_H 1
#define HAVE_UNISTD_H 1
#define HAVE_STRING_H 1
#define HAVE_STRINGS_H 1
#define HAVE_SYS_PARAM_H 1
#define HAVE_SYS_IOCTL_H 1
#define HAVE_SYS_STATVFS_H 1
#define HAVE_SYS_UIO_H 1
#define HAVE_SYS_TIME_H 1
#define HAVE_SYS_RESOURCE_H 1
#define HAVE_GETOPT_H 1
#define HAVE_STDDEF_H 1
#define HAVE_STDINT_H 1
#define HAVE_NETINET_IN_SYSTM_H 1
#define HAVE_NETINET_IN_H 1
#define HAVE_SYS_FILE_H 1
#define HAVE_SYS_MOUNT_H 1
#define HAVE_FCNTL_H 1
#define HAVE_SYS_FCNTL_H 1
#define HAVE_SYS_PTRACE_H 1
#define HAVE_SECURITY_PAM_APPL_H 1
#define HAVE_SECURITY_PAM_MODULES_H 1
#define HAVE_SGTTY_H 1
#define HAVE_LOCALE_H 1
#define HAVE_STDARG_H 1
#define HAVE_UTIME_H 1
#define HAVE_OPENSSL_SSL_H 1
#define HAVE_ICONV_H 1
#define HAVE_POSIX_TERMIOS
#define WORDS_BIGENDIAN 1
#define RETSIGTYPE void
#define HAVE_STRUCT_TM_TM_ZONE 1
#define HAVE_TM_ZONE 1
#define STRUCT_TM_TM_GMTOFF
#define HAVE_SCALAR_TIMEZONE
/* end confdefs.h.  */
#include <stdio.h>
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#ifdef STDC_HEADERS
# include <stdlib.h>
# include <stddef.h>
#else
# ifdef HAVE_STDLIB_H
#  include <stdlib.h>
# endif
#endif
#ifdef HAVE_STRING_H
# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
#  include <memory.h>
# endif
# include <string.h>
#endif
#ifdef HAVE_STRINGS_H
# include <strings.h>
#endif
#ifdef HAVE_INTTYPES_H
# include <inttypes.h>
#endif
#ifdef HAVE_STDINT_H
# include <stdint.h>
#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
   typedef short ac__type_sizeof_;
static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
static unsigned long int ulongval () { return (long int) (sizeof 
(ac__type_sizeof_)); }
#include <stdio.h>
#include <stdlib.h>
int
main ()
{

  FILE *f = fopen ("conftest.val", "w");
  if (! f)
    return 1;
  if (((long int) (sizeof (ac__type_sizeof_))) < 0)
    {
      long int i = longval ();
      if (i != ((long int) (sizeof (ac__type_sizeof_))))
      return 1;
      fprintf (f, "%ld\n", i);
    }
  else
    {
      unsigned long int i = ulongval ();
      if (i != ((long int) (sizeof (ac__type_sizeof_))))
      return 1;
      fprintf (f, "%lu\n", i);
    }
  return ferror (f) || fclose (f) != 0;

  ;
  return 0;
}

2. Compile the program: gcc -o conftest -O2 -DLDAP_DEPRECATED -I/usr/include 
-fPIE -fno-strict-aliasing -fno-strict-overflow -fstack-protector-all 
-Winit-self -Wwrite-strings -Wdiv-by-zero -DLDAP_DEPRECATED -I/usr/include 
-D_FORTIFY_SOURCE=2 -L/usr/lib -Wl,-R/usr/lib -Wl,-R/usr/pkg/lib -pie -z relro 
-z now conftest.c

3. Run the program: ./conftest
Fatal error

4. Running under ktruss shows: ktruss -t A ./conftest
Fatal error
 22756      1 ktruss   fcntl(0x4, 0x3, 0)          = 1, 3
 22756      1 ktruss   emul(netbsd)
 22756      1 ktruss   fcntl(0x4, 0x4, 0x1)        = 0, 4
 22756      1 conftest execve("./conftest", 0xffffffffffffb790, 
0xffffffffffffb7a0) JUSTRETURN
 22756      1 conftest emul(netbsd)
 22756      1 conftest mmap(0, 0x8000, 0x3, 0x1002, 0xffffffffffffffff, 0, 0) = 
0x40206000
 22756      1 conftest open("/etc/ld.so.conf", 0, 0) Err#2 ENOENT
 22756      1 conftest open("/usr/lib/libc.so.12", 0, 0x7f7f7f7f7f7f7f7f) = 3
 22756      1 conftest __fstat50(0x3, 0xffffffffffffaca8) = 0, -21336
 22756      1 conftest mmap(0, 0x2000, 0x1, 0x1, 0x3, 0, 0) = 0x40210000
 22756      1 conftest munmap(0x40210000, 0x2000)  = 0, 8192
 22756      1 conftest mmap(0, 0x250000, 0x5, 0x14000002, 0x3, 0, 0) = 
0x40500000
 22756      1 conftest mmap(0x40728000, 0x18000, 0x7, 0x12, 0x3, 0, 0x128000) = 
0x40728000
 22756      1 conftest mmap(0x40740000, 0x10000, 0x7, 0x1012, 
0xffffffffffffffff, 0, 0) = 0x40740000
 22756      1 conftest mprotect(0x40628000, 0x100000, 0) = 0, 1048576
 22756      1 conftest close(0x3)                  = 0, 3
 22756      1 conftest mprotect(0x100000, 0x2000, 0x7) = 0, 8192
 22756      1 conftest mprotect(0x100000, 0x2000, 0x5) = 0, 8192
 22756      1 conftest write(0x2, 0xffffffffffffb338, 0xb) = 11, -19656
       "Fatal error"
 22756      1 conftest write(0x2, 0x40311298, 0x1) = 1, 1076957848
       "\n"
 22756      1 conftest exit(0x1)


>Fix:
No fix is currently known.



Home | Main Index | Thread Index | Old Index