Subject: pkg/34901: TME sun3 emulator asserts bad float format when running a.out executables
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <sigmfsk@aol.com>
List: pkgsrc-bugs
Date: 10/24/2006 17:00:01
>Number:         34901
>Category:       pkg
>Synopsis:       TME sun3 emulator asserts bad float format when running a.out executables
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Oct 24 17:00:00 +0000 2006
>Originator:     arthur townsend
>Release:        3.0
>Organization:
>Environment:
3.0 for i386
>Description:
Following assertion is made whenever NetBSD 1.5.3 shutsdown.

Also made whenever running (under SunOS or NetBSD 1.5.3 or NetBSD 3.0) a statically linked executable created under sunos 4.1.1, gcc-3.2.3.
If TME is built with --disable-debug, the exectuble runs fine.

tmesh> assertion "x->tme_float_format & formats" failed: file "../../tme/generic/float.h", line 280, function "tme_float_assert_formats"
[1]   Abort trap (core dumped) tmesh startnetbsd3.0.generic.net


>How-To-Repeat:
This happened with every SunOS a.out executable I tested.  One example is the gcc-3.3.3 testcase 20010325-1.c as follows:


extern void exit (int);
extern void abort (void);

int
main (void)
{
  if (L"a" "b"[1] != L'b')
    abort ();
  exit (0);
}


>Fix:
I commented out the assertion via the following patch, so that I could continue running the emulator and see if any other assertions popped up.

The a.outs seem to run fine with the following commented out (or when TME is built with --disable-debug) but the problem should be investigated before electing to permanently remove the assertion.


--- float.h.orig        2006-10-24 08:06:17.000000000 -0400
+++ float.h     2006-10-24 08:08:30.000000000 -0400
@@ -277,7 +277,14 @@
 static _tme_inline int
 tme_float_assert_formats(_tme_const struct tme_float *x, unsigned int formats)
 {
+
+/* This asserts true when running (under SunOS 4.1.1/NetBSD 1.5.3/NetBSD 3.0),
+   a statically linked executable created under SunOS 4.1.1 gcc-3.2.3.
+   Also asserts true when shutting down NetBSD 1.5.3
+
   assert (x->tme_float_format & formats);
+*/
+
   return (TRUE);
 }
 #else  /* NDEBUG */