Patches for ILU 2.0alpha10

Revised $Date: 1997/08/27 22:24:13 $ GMT

About Patches

Getting the "patch" program

The program "patch" is distributed from a number of places, and odds are you already have it on your system. If not, try ftp://gatekeeper.dec.com/pub/BSD/FreeBSD/FreeBSD-current/src/gnu/usr.bin/patch/ for the sources. On Windows platforms, there appears to be a version in the Win32 distribution of the GNU tools.

Applying a patch

To patch your sources, copy any patch listed below into a patch file. If you're going to apply more than one, apply them in order, and put each patch in a separate patch file. Then change your working directory to the top of the ILU source tree (ILUSRC), and use the command "patch -p", redirecting standard input to come from this file. For example, if you had put the ILU sources in /usr/local/ilu/src, and had put the patch in /usr/local/ilu/src/this-patch, you'd type
  % cd /usr/local/ilu/src
  % patch -p < /usr/local/ilu/src/this-patch
  [...various output from the patch program...]
  %
NOTE: On a fresh (unpatched) distribution, it usually works to just feed this entire patch.html file into the patch program, e.g. patch -l -p < patch.html WARNING: copying these files from a browser may produce problems with some patches due to a conversion of tabs to spaces. If you have a patch application fail, try specifying the -l switch to patch. Also, when ftp'ing this page, use binary transfer. On Windows, some patches may be reported as malformed if you transfer the file in ascii mode.

Actual Patches


  • When doing "make" in examples/test1, the Lisp compiler doesn't exit gracefully. The following patch fixes that:

    *** examples/test1/load-lisp-example.lisp.dist	1997/01/29 01:33:09
    --- 1.3	1997/05/08 22:38:46
    ***************
    *** 26,28 ****
    --- 26,31 ----
      
      #+aclpc
      (setf *default-pathname-defaults* *saved-default-pathname-defaults*)
    + 
    + #+ilu-batch-compile
    + (exit)
    

  • Creating a surrogate object for a Visigenic or Orbix true instance causes an ilu_Check error in the kernel, because the still-empty kernel server has a reference count of 0 while doing the ilu_StartCall for "is_a". Fixed by bumping the refcount while doing the outcalls. Thanks to Bob Jackson for reporting this.

    *** runtime/kernel/object.c	1997/04/26 07:30:00
    --- 1.156	1997/05/09 23:02:31
    ***************
    *** 559,591 ****
      	     "on server <%s> (%p).\n",
      	     o, ih, s->sr_id, s));
            if (mstid == NIL || !tidfound) {
      	ilu_ExitServer(s, static_type);
      #ifdef IIOP_PROTOCOL
    ! 	if ((strncmp(s->sr_id, "CORBA:", 6) == 0) &&
    ! 	    ih[0] == '$' && ih[1] == 0)
    ! 	  /*
    ! 	   * non-ILU object; use "-is-a" instead of "ILUGetTypes";
    ! 	   * less efficient but works with non-ILU orbs
    ! 	   */
    ! 	  cl = _ilu_IIOP_FindClassViaRPC(o);
    ! 	else
      #endif
    ! 	  cl = _ilu_FindClassViaRPC(o);
    ! 	if (cl != NIL) {
    ! 	  object_class(o) = cl;
      	  ilu_EnterServer(s, static_type);
    ! 	} else {
    ! 	  ILU_NOTE(OBJECT_DEBUG,
    ! 		("_ilu_FindOrCreateObject:  Couldn't determine"
    ! 		 " type for object %p, given mstid \"%s\".\n",
    ! 		 o, mstid));
    ! 	  UncreateObject(o);
    ! 	  o = NIL;
    ! 	  (void) ILU_ERR_CONS1(inv_objref, err, minor,
    ! 			       ilu_iom_mstid_fail, 6);
      	}
            }
    !       if (o != NIL) {
      	if (s->sr_closing == TRUE) {
      	  ILU_NOTE(OBJECT_DEBUG,
      		("_ilu_FindOrCreateObject:  %s (ih %s) %s %s.\n",
    --- 559,596 ----
      	     "on server <%s> (%p).\n",
      	     o, ih, s->sr_id, s));
            if (mstid == NIL || !tidfound) {
    + 	ilu_DeltaServerHolds(s, +1, err);
      	ilu_ExitServer(s, static_type);
    + 	if (ILU_ERROK(*err)) {
      #ifdef IIOP_PROTOCOL
    ! 	  if ((strncmp(s->sr_id, "CORBA:", 6) == 0) &&
    ! 	      ih[0] == '$' && ih[1] == 0)
    ! 	    /*
    ! 	     * non-ILU object; use "-is-a" instead of "ILUGetTypes";
    ! 	     * less efficient but works with non-ILU orbs
    ! 	     */
    ! 	    cl = _ilu_IIOP_FindClassViaRPC(o);
    ! 	  else
      #endif
    ! 	    cl = _ilu_FindClassViaRPC(o);
      	  ilu_EnterServer(s, static_type);
    ! 	  ilu_DeltaServerHolds(s, -1, err);
    ! 	  if (cl != NIL) {
    ! 	    object_class(o) = cl;
    ! 	  } else {
    ! 	    ILU_NOTE(OBJECT_DEBUG,
    ! 		     ("_ilu_FindOrCreateObject:  Couldn't determine"
    ! 		      " type for object %p, given mstid \"%s\".\n",
    ! 		      o, mstid));
    ! 	    UncreateObject(o);
    ! 	    o = NIL;
    ! 	    ilu_ExitServer(s, static_type);
    ! 	    (void) ILU_ERR_CONS1(inv_objref, err, minor,
    ! 				 ilu_iom_mstid_fail, 6);
    ! 	  }
      	}
            }
    !       if (ILU_ERROK(*err)) {
      	if (s->sr_closing == TRUE) {
      	  ILU_NOTE(OBJECT_DEBUG,
      		("_ilu_FindOrCreateObject:  %s (ih %s) %s %s.\n",
    

  • Joachim Achtzehnter points out that enum-discriminated unions in Lisp have problems when the ISL form of the enum field name differs from the Lisp form. Here's a fix:

    *** stubbers/lisp/type-basics.c	1997/05/05 04:59:41
    --- 1.31	1997/05/09 23:47:24
    ***************
    *** 84,90 ****
      	       (val->val.i.sign < 0) ? "-" : "", val->val.i.value);
            break;
          case shortcharacter_Type:
    !       fprintf (context->file, "%s", val->val.s);
            break;
          case boolean_Type:
            fprintf (context->file, "%s", val->val.b ? "cl:t" : "cl:nil");
    --- 84,94 ----
      	       (val->val.i.sign < 0) ? "-" : "", val->val.i.value);
            break;
          case shortcharacter_Type:
    !       {
    ! 	char *fixed_up = lisp_string(val->val.s);
    ! 	fprintf (context->file, "%s", fixed_up);
    ! 	iluparser_Free(fixed_up);
    !       }
            break;
          case boolean_Type:
            fprintf (context->file, "%s", val->val.b ? "cl:t" : "cl:nil");
    

  • Joachim Achtzehnter points out that typedefs for object types don't work, because of a missing variable called "_Foo__ILUType". The following patch provides the missing #define (and also provides the missing #define for "Foo__CreateFromURL").

    *** stubbers/c/cheaders.c	1997/04/21 17:07:37
    --- 1.106	1997/05/10 00:17:12
    ***************
    *** 486,493 ****
    --- 486,495 ----
            fprintf (context->file, "#define %s__CreateTrue %s__CreateTrue\n", c_type_name(t), c_type_name(ut));
            fprintf (context->file, "#define %s__OTCreateTrue %s__OTCreateTrue\n", c_type_name(t), c_type_name(ut));
            fprintf (context->file, "#define %s__CreateFromSBH %s__CreateFromSBH\n", c_type_name(t), c_type_name(ut));
    +       fprintf (context->file, "#define %s__CreateFromURL %s__CreateFromURL\n", c_type_name(t), c_type_name(ut));
            fprintf (context->file, "#define %s__SetUserData %s__SetUserData\n", c_type_name(t), c_type_name(ut));
            fprintf (context->file, "#define %s__GetUserData %s__GetUserData\n", c_type_name(t), c_type_name(ut));
    +       fprintf (context->file, "#define _%s__ILUType _%s__ILUType\n", c_type_name(t), c_type_name(ut));
            fprintf (context->file, "#define %s__MSType _%s__ILUType\n", c_type_name(t),
      	       (TypeIsJustAlias(t) ? c_type_name(ut) : c_type_name(t)));
            fprintf (context->file, "#define %s__Free %s__Free\n", c_type_name(t), c_type_name(ut));
    

  • Jody Winston points out that the aggressive GC of Python true objects reveals a long-standing ref-counting bug. Here's a patch:

    *** runtime/python/iluPrmodule.c	1997/05/10 02:41:08
    --- 1.184	1997/05/13 04:17:34
    ***************
    *** 1603,1609 ****
            return 0;
          }
        kobj = getKobjFromOtObject((PyInstanceObject *) inst, otr->kserver);
    -   Py_DECREF(inst);
        return kobj;
      }
      
    --- 1603,1608 ----
    
    

  • A pre-release mod to allow Java to replace read write procedures didn't properly account for Win32 __stdcall calling conventions. This can result in bizarre behavior. Here's a patch:

    *** runtime/kernel/iluxport.h	Thu May  8 14:25:56 1997
    --- iluxport.h	Tue May 13 13:53:24 1997
    ***************
    *** 34,42 ****
    --- 34,44 ----
      #define ILU_PUBLIC __declspec(dllimport) extern
      #define ILU_PUBLIC_CLASS class __declspec(dllimport)
      #endif /* defined(ILU_BUILDING_KERNEL) */
    + #define ILU_STDCALL __stdcall
      #else
      #define ILU_PUBLIC extern
      #define ILU_PUBLIC_CLASS class
    + #define ILU_STDCALL
      #endif /* defined(WIN32) */
      
      #if (defined(WIN32)||defined(WIN16))
    ***************
    *** 149,156 ****
      typedef ilu_refany ilu_Lock;
      	/* slot for lock implementation's use */
      
    ! typedef int (*ilu_RecvProc)(int,char*,int,int);
    ! typedef int (*ilu_SendProc)(int,const char*,int,int);
      
      typedef struct _ilu_IdentityInfo_s * ilu_IdentityInfo;
      typedef struct _ilu_IdentityType_s * ilu_IdentityType;
    --- 151,158 ----
      typedef ilu_refany ilu_Lock;
      	/* slot for lock implementation's use */
      
    ! typedef int (ILU_STDCALL *ilu_RecvProc)(int,char*,int,int);
    ! typedef int (ILU_STDCALL *ilu_SendProc)(int,const char*,int,int);
      
      typedef struct _ilu_IdentityInfo_s * ilu_IdentityInfo;
      typedef struct _ilu_IdentityType_s * ilu_IdentityType;
    
    

  • Joachim Achtzehnter points out that the C mapping doesn't allow for types with PICKLE fields, as the def of CORBA_any isn't exposed. The following patch fixes this:

    *** stubbers/c/server.c	1997/04/02 08:26:08
    --- 1.91	1997/05/14 00:49:59
    ***************
    *** 592,601 ****
      
        fprintf(file, "#include \n\n");
        fprintf(file, "#include \"%s.h\"\n\n", pc_interfacename);
    - 
    -   fprintf(file, "#ifdef ADD_VARIANT_SUPPORT\n");
    -   fprintf(file, "struct CORBA_any_s { CORBA_TypeCode _type; void *_value; ilu_Pickle _pickle; };\n\n");
    -   fprintf(file, "#endif /* ADD_VARIANT_SUPPORT */\n");
      
        list_enumerate(parse->classes, generateServerClassTable, &context);
      
    --- 592,597 ----
    *** runtime/c/iluchdrs.h	1997/04/26 07:29:15
    --- 1.122	1997/05/14 00:53:11
    ***************
    *** 121,134 ****
      
      typedef ilu_Exception	ILU_C_ExceptionCode;
      
    - #ifdef ADD_VARIANT_SUPPORT
    - 
    - typedef struct CORBA_any_s CORBA_any;
    - 
    - #define ilu_any CORBA_any
    - 
    - #endif /* ADD_VARIANT_SUPPORT */
    - 
      ILU_RUNTIME_PUBLIC void
        _ILU_C_InitializeCRuntime(void);
      /* called to do any runtime registration of types and/or other things
    --- 121,126 ----
    ***************
    *** 284,289 ****
    --- 276,289 ----
         type indicated by the TypeCode, and also free any internal pointers it holds */
      
      /* CORBA any operations */
    + 
    + typedef struct CORBA_any_s {
    +   CORBA_TypeCode _type;
    +   void *_value;
    +   ilu_Pickle _pickle;
    + } CORBA_any;
    + 
    + #define ilu_any CORBA_any
      
      ILU_RUNTIME_PUBLIC CORBA_any *			/* OPTIONAL, PASS */
        ILU_C_Any_Create (CORBA_TypeCode,	/* RETAIN */
    *** runtime/c/ilu.c	1997/04/26 07:29:15
    --- 1.170	1997/05/14 00:53:05
    ***************
    *** 572,583 ****
      }
      
      #ifdef ADD_VARIANT_SUPPORT
    - 
    - struct CORBA_any_s {
    -   CORBA_TypeCode _type;		/* NIL to indicate valid pickle instead of any */
    -   void * _value;		/* if _type is non-NIL, points to LSR value; otherwise undefined */
    -   ilu_Pickle _pickle;		/* if _type is NIL, contains ILU pickle; otherwise undefined */
    - };
      
      ilu_string CORBA_TypeCode_id (CORBA_TypeCode tc, ILU_C_ENVIRONMENT *env)
      {
    --- 572,577 ----
    

  • Jody Winston points out that there's an extra debugging message in the Python code that should be removed, and supplies this patch:

    *** runtime/python/iluPrmodule.c       1997/05/13 19:58:17     1.2
    --- iluPrmodule.c       1997/05/15 13:25:31
    ***************
    *** 22,27 ****
    --- 22,29 ----
      
      /* from ILU */
      #include 
    + #include 
    + 
      /* local */
      #include "python.h"
      #include "ilualobject.h"
    ***************
    *** 2253,2259 ****
          return ilu_FALSE;
        stat = BOOLEAN((result != Py_None));
        Py_DECREF(result);
    !   printf ("registerHandler, refcount on arg is %d\n", arg->ob_refcnt);
        return stat;
      }
      
    --- 2255,2262 ----
          return ilu_FALSE;
        stat = BOOLEAN((result != Py_None));
        Py_DECREF(result);
    !   /* ILU_NOTE(OBJECT_DEBUG,
    !            ("registerHandler, refcount on arg is %d\n", arg->ob_refcnt)); */
        return stat;
      }
      
    

  • The C runtime has bugs in both the sizing of exception values (only important in IIOP), and in sending string-valued exceptions. This patch fixes both problems.

    *** runtime/c/ilu.c	1997/05/14 00:53:05
    --- 1.172	1997/05/17 03:57:40
    ***************
    *** 4051,4057 ****
        
      found:
      
    ! #define GENERIC_ESIZE(type,fn) argSize = fn (call, *((type *) status->ptr), err); break
      
        if (ilu_CallNeedsSizing(call)) {
          argSize = ilu_BeginSizingException(call, eindex+1, err);
    --- 4051,4057 ----
        
      found:
      
    ! #define GENERIC_ESIZE(type,fn) argSize += fn (call, *((type *) status->ptr), err); break
      
        if (ilu_CallNeedsSizing(call)) {
          argSize = ilu_BeginSizingException(call, eindex+1, err);
    ***************
    *** 4114,4134 ****
      	/* Objects */
      
            case 'p':
    ! 	argSize = _ILU_C_SizeOfObject (call, (ILU_C_Object *) status->ptr, *(evec[eindex].ed_class), ilu_FALSE, err);
      	break;
      
      	/* C String */
            case 'q':
    ! 	argSize = ilu_SizeOfString (call, *((ilu_string *)(status->ptr)),
      				    strlen(*((ilu_string *)(status->ptr))),
      				    0xFFFF, err);
      
            case 'z':
    ! 	argSize = (*evec[eindex].sizeFn)(call, status->ptr, err);
      	break;
      
            default:
    ! 	argSize = 0;
            }
          if (ILU_ERRNOK(*err)) return;
        }
    --- 4114,4135 ----
      	/* Objects */
      
            case 'p':
    ! 	argSize += _ILU_C_SizeOfObject (call, (ILU_C_Object *) status->ptr, *(evec[eindex].ed_class), ilu_FALSE, err);
      	break;
      
      	/* C String */
            case 'q':
    ! 	argSize += ilu_SizeOfString (call, *((ilu_string *)(status->ptr)),
      				    strlen(*((ilu_string *)(status->ptr))),
      				    0xFFFF, err);
    + 	break;
      
            case 'z':
    ! 	argSize += (*evec[eindex].sizeFn)(call, status->ptr, err);
      	break;
      
            default:
    ! 	argSize += 0;
            }
          if (ILU_ERRNOK(*err)) return;
        }
    ***************
    *** 4202,4207 ****
    --- 4203,4209 ----
            ilu_OutputString (call, *((ilu_string *) (status->ptr)),
      			strlen(*((ilu_string *) (status->ptr))),
      			0xFFFF, err);
    +       break;
      
          case 'z':
            (*evec[eindex].outFn)(call, status->ptr, err);
    

  • Lennart Staflin points out that the following patch allows ILU Lisp support to work with Franz ACL 4.3 on Linux 2.0.

    *** runtime/lisp/ilu-lisp-skin.c	1997/05/18 06:56:35
    --- 1.5	1997/05/18 23:21:19
    ***************
    *** 947,953 ****
      
      /* make sure all modules from libilu.a are included by referencing some routines */
      
    ! #if !(defined(WIN32) || defined(linux))
      void ______ilulisp_NeverCalled(void)
      {
        ilu_MXAClear(NULL, NULL);		/* alarmux.c */
    --- 947,953 ----
      
      /* make sure all modules from libilu.a are included by referencing some routines */
      
    ! #if !(defined(WIN32))
      void ______ilulisp_NeverCalled(void)
      {
        ilu_MXAClear(NULL, NULL);		/* alarmux.c */
    

  • The following patch contains changes to the java runtime necessary to use WIN32 (with jdk-1.1). Brave souls only, as this has been minimally tested and does not include changes to the build process. The patch for IluJava_selectwt.c has only one line of context because otherwise patched lines would contain a character sequence which would be interpreted as html command :-(

    *** runtime/java/IluJava_JMon.h.alter	Thu May  8 14:26:15 1997
    --- 	Fri May 16 16:04:45 1997
    ***************
    *** 191,198 ****
    --- 191,204 ----
      typedef struct sys_thread java_sys_thread_t;
      typedef java_sys_thread_t* ILUJAVA_SYSTHREAD_stPtr;
      
    + #ifdef WIN32
    + #include 
      #define ILUJAVA_SYSTHREAD_sysThreadSelf() \
    +     (ILUJAVA_SYSTHREAD_stPtr) threadSelf()
    + #else
    + #define ILUJAVA_SYSTHREAD_sysThreadSelf() \
          (ILUJAVA_SYSTHREAD_stPtr) java_lang_Thread_currentThread(0)
    + #endif
          
      #define ILUJAVA_SYSTHREAD_javaThreadFromSysThread(sysThread) \
          (void *) (sysThread)
    *** runtime/java/IluJava_IluInit.c	Thu May  8 14:26:09 1997
    --- 	Fri May 16 16:06:10 1997
    ***************
    *** 79,84 ****
    --- 79,85 ----
      }
      
      #else
    + #ifndef WIN32
      
      extern int _read(int,char*,int);
      extern int _write(int,const char*,int);
    ***************
    *** 102,107 ****
    --- 103,109 ----
      }
      
      #endif
    + #endif
      
      
      EXPORTJAVA void
    ***************
    *** 109,115 ****
    --- 111,119 ----
      	struct Hxerox_ilu_IluInit2 * unused
      	)
      {
    + #ifndef WIN32
          fixIO();
    + #endif
          DEBUGPRINT("start");
          _ilujava_LockTechInit(); /*ilu wants this early*/
          DEBUGPRINT("did LT");
    *** runtime/java/IluJava_JOps.c	Thu May  8 14:26:07 1997
    --- 	Fri May 16 16:06:20 1997
    ***************
    *** 151,157 ****
       */
      {
          while (len) {
    !         *dst++ = *src++;
              len--;
          }
      }
    --- 151,157 ----
       */
      {
          while (len) {
    !         *dst++ = (char) *src++;
              len--;
          }
      }
    *** runtime/java/IluJava_selectwt.c	Thu May  8 14:26:09 1997
    --- 	Fri May 16 16:06:24 1997
    ***************
    *** 58,59 ****
    --- 58,60 ----
          {
    + #ifndef WIN32
              if (fd >= FD_SETSIZE) {
    ***************
    *** 61,62 ****
    --- 62,64 ----
              }
    + #endif
              if (debug) {
    

  • Win32 'Release' build of idl2isl needs /opt:noicf switch to run properly (wierd).

    *** stubbers/idl2isl/idl2isl.mak	Thu May 15 09:03:21 1997
    --- Mon May 19 14:43:30 1997
    ***************
    *** 145,151 ****
      # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"$(ILUHOME)\bin\idl2isl.exe"
      LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
       advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
    !  odbccp32.lib /nologo /subsystem:console /incremental:no\
       /pdb:"$(OUTDIR)/idl2isl.pdb" /machine:I386 /out:"$(ILUHOME)\bin\idl2isl.exe" 
      LINK32_OBJS= \
      	"$(INTDIR)\ast_argument.obj" \
    --- 145,151 ----
      # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"$(ILUHOME)\bin\idl2isl.exe"
      LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
       advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
    !  odbccp32.lib /nologo /subsystem:console /incremental:no /opt:noicf\
       /pdb:"$(OUTDIR)/idl2isl.pdb" /machine:I386 /out:"$(ILUHOME)\bin\idl2isl.exe" 
      LINK32_OBJS= \
      	"$(INTDIR)\ast_argument.obj" \
    
    

  • Stubbers on Win32 not automatically invoking idl2isl on idl files

    *** runtime/kernel/iluwin.h	Thu May  8 14:25:57 1997
    --- Thu May 22 10:29:33 1997
    ***************
    *** 265,269 ****
    --- 265,272 ----
      /* boost default winsock number of fds from the default of 64 */
      #define FD_SETSIZE 256
      
    + /* Define this if the idl2isl parser has been built */
    + #define ADD_IDL_SUPPORT 1
      
    + 
      #endif	/* _ilu_win_h_ */
    
    

  • Bob Jackson points out that the Lisp support sizes the discriminant of a method after sizing the other arguments, which can in obscure cases, and only when using the IIOP protocol, cause the indicated size of a request message to be wrong, due to getting the padding wrong. Here's a patch:

    *** 1.1	1997/05/29 01:37:46
    --- runtime/lisp/ilu-macros.lisp	1997/05/29 01:38:35
    ***************
    *** 896,911 ****
      		     (watch-outgoing-connection ,new-conn))
      		   (ilu_start-request
      		    ,call
    ! 		    (+ ,@(remove-nils
      			  (mapcar #'(lambda (dir type name)
      				      (if (or (eq dir :in) (eq dir :inout))
      					  (make-size-form call type name)))
      				  other-arg-dirs other-arg-types
      				  other-arg-names))
    ! 		       ,(if singleton-p
    ! 			    0
    ! 			  `(object-id-size
    ! 			    ,call (kernel-obj ,self) 1 ,class-record nil))))
      		   ,@(unless singleton-p
      		       ;; At this point we are Inside the server of the
      	               ;; object, so we can just use the cached kernel object,
    --- 896,912 ----
      		     (watch-outgoing-connection ,new-conn))
      		   (ilu_start-request
      		    ,call
    ! 		    (+ ,(if singleton-p
    ! 			    0
    ! 			  `(object-id-size
    ! 			    ,call (kernel-obj ,self) 1 ,class-record nil))
    ! 		       ,@(remove-nils
      			  (mapcar #'(lambda (dir type name)
      				      (if (or (eq dir :in) (eq dir :inout))
      					  (make-size-form call type name)))
      				  other-arg-dirs other-arg-types
      				  other-arg-names))
    ! 		       ))
      		   ,@(unless singleton-p
      		       ;; At this point we are Inside the server of the
      	               ;; object, so we can just use the cached kernel object,
    

  • The C stubber can generate bad header files from certain ISL definitions, typically those using OPTIONAL to implement a linked list, because of the difference in sorting restrictions between the typedef phase and the type declaration phase. This patch fixes that by introducing two different sorts.

    *** 1.108	1997/05/14 01:09:12
    --- stubbers/c/cheaders.c	1997/05/23 07:56:58
    ***************
    *** 967,972 ****
    --- 967,974 ----
        list_enumerate (m->arguments, (iluparser_EnumProc) sortArgTypes, sorted);
      }
      
    + static boolean sortingForTypedef;
    + 
      static void sortTypesForDeclaration (Type type, list sorted)
      {
        enum PrimitiveTypes t;
    ***************
    *** 1001,1007 ****
            switch (t) {
      
            case record_Type:
    ! 	list_enumerate (type_description (type)->structuredDes.record, (iluparser_EnumProc) sortArgTypes, sorted);
      	break;
      
            case alias_Type:
    --- 1003,1010 ----
            switch (t) {
      
            case record_Type:
    ! 	if (!sortingForTypedef)
    ! 	  list_enumerate (type_description (type)->structuredDes.record, (iluparser_EnumProc) sortArgTypes, sorted);
      	break;
      
            case alias_Type:
    ***************
    *** 1046,1051 ****
    --- 1049,1058 ----
        }
      }
      
    + static void printSortedTypes (Type t, void * junk)
    + {
    +   fprintf (stderr, "%s\n", type_name(t));
    + }
      
      void generateCHeaders (Interface interface, FILE *file)
      {
    ***************
    *** 1101,1117 ****
          }
      
        SortContextInterface = interface;
        list_enumerate (interface->types, (iluparser_EnumProc) sortTypesForDeclaration, sorted);
    ! /*
        list_enumerate (sorted, (iluparser_EnumProc) printSortedTypes, NULL);
        fprintf (file, "\n");
    - */
        if (list_size(sorted) > 0) {
          fprintf (file, "/*======================================================================*/\n");
          fprintf (file, "/*========================= typedefs ===================================*/\n\n");
          list_enumerate (sorted, (iluparser_EnumProc) typedefType, &context);
          fprintf (file, "\n\n");
      
          fprintf (file, "/*======================================================================*/\n");
          fprintf (file, "/*=============== non-object type declarations =========================*/\n\n");
          list_enumerate (sorted, (iluparser_EnumProc) declareType, &context);
    --- 1108,1135 ----
          }
      
        SortContextInterface = interface;
    +   sortingForTypedef = 1;
        list_enumerate (interface->types, (iluparser_EnumProc) sortTypesForDeclaration, sorted);
    !   /*
        list_enumerate (sorted, (iluparser_EnumProc) printSortedTypes, NULL);
    +   */
        fprintf (file, "\n");
        if (list_size(sorted) > 0) {
          fprintf (file, "/*======================================================================*/\n");
          fprintf (file, "/*========================= typedefs ===================================*/\n\n");
          list_enumerate (sorted, (iluparser_EnumProc) typedefType, &context);
          fprintf (file, "\n\n");
    +     list_clear(sorted, FALSE);
    +   };
      
    +   SortContextInterface = interface;
    +   sortingForTypedef = 0;
    +   list_enumerate (interface->types, (iluparser_EnumProc) sortTypesForDeclaration, sorted);
    +   /*
    +   list_enumerate (sorted, (iluparser_EnumProc) printSortedTypes, NULL);
    +   */
    +   fprintf (file, "\n");
    +   if (list_size(sorted) > 0) {
          fprintf (file, "/*======================================================================*/\n");
          fprintf (file, "/*=============== non-object type declarations =========================*/\n\n");
          list_enumerate (sorted, (iluparser_EnumProc) declareType, &context);
    

  • Certain kinds of union types can have "default" arms; that is, arms with no selector values. However, on systems that return NIL for malloc(0), this causes problems with ILU, as it interprets this as an "out-of-memory" error. Here's a workaround that shouldn't harm systems that don't have this property.

    *** 2.0alpha10	Thu May  8 14:25:59 1997
    --- runtime/kernel/types.c	Thu May 22 15:57:16 1997
    ***************
    *** 675,682 ****
        n->desc.Union.arms[arm_index].base.name = ilu_StrdupE(arm_name, err);
        if (ILU_ERRNOK(*err)) return ilu_FALSE;
        n->desc.Union.arms[arm_index].n_values = n_values;
    !   n->desc.Union.arms[arm_index].values =
    !     (ilu_ConstantValue_s *) ilu_MallocE(sizeof(ilu_ConstantValue_s) * n_values, err);
        if (ILU_ERRNOK(*err)) { ilu_free(n->desc.Union.arms[arm_index].base.name); return ilu_FALSE; };
        AssignTypeForUID (arm_type_uid, &(n->desc.Union.arms[arm_index].base.type), err);
        if (ILU_ERRNOK(*err)) {
    --- 675,685 ----
        n->desc.Union.arms[arm_index].base.name = ilu_StrdupE(arm_name, err);
        if (ILU_ERRNOK(*err)) return ilu_FALSE;
        n->desc.Union.arms[arm_index].n_values = n_values;
    !   if (n_values > 0)
    !     n->desc.Union.arms[arm_index].values =
    !       (ilu_ConstantValue_s *) ilu_MallocE(sizeof(ilu_ConstantValue_s) * n_values, err);
    !   else
    !     n->desc.Union.arms[arm_index].values = NIL;
        if (ILU_ERRNOK(*err)) { ilu_free(n->desc.Union.arms[arm_index].base.name); return ilu_FALSE; };
        AssignTypeForUID (arm_type_uid, &(n->desc.Union.arms[arm_index].base.type), err);
        if (ILU_ERRNOK(*err)) {
    

  • When forming an OMG IDL repository ID in idl2isl, you don't want to change the underscores to hyphens. So don't. Here's a patch:

    *** 2.22	1997/05/20 22:37:30
    --- stubbers/idl2isl/isl_be/be_gen_isl.cc	1997/07/01 03:45:03
    ***************
    *** 2639,2643 ****
      		dst = stringCopy(dst, iterator.item()->get_string());
      	}
      	*dst = 0;
    ! 	return translatedName(newString(buffer));
      }
    --- 2639,2643 ----
      		dst = stringCopy(dst, iterator.item()->get_string());
      	}
      	*dst = 0;
    ! 	return newString(buffer);
      }
    

  • The default code in iluRt.py to print out unexpected exceptions on the server side doesn't work (though we still think it should); so comment it out and let the built-in code work instead.

    *** runtime/python/iluRt.py	Tue Jul  1 20:24:53 1997
    --- new	Tue Jul  1 20:26:40 1997
    ***************
    *** 304,310 ****
      	print "ILU runtime caught exception in `" + where + "':"
      	traceback.print_exc()
      
    ! SetCalloutExceptionHandler (DefaultCalloutExceptionHandler)
      
      # define the built-in class ilu.CORBA-Object for OMG IDL support
      
    --- 304,310 ----
      	print "ILU runtime caught exception in `" + where + "':"
      	traceback.print_exc()
      
    ! # SetCalloutExceptionHandler (DefaultCalloutExceptionHandler)
      
      # define the built-in class ilu.CORBA-Object for OMG IDL support
      
    

  • Passports created in accepting a new connection may be accidentally deleted twice. This patch fixes that problem.

    *** 1.63	1997/04/26 07:30:00
    --- runtime/kernel/port.c	1997/07/10 01:10:39
    ***************
    *** 189,195 ****
        ilu_Error       lerr;
        ilu_string      peerinfo = NIL;
        ilu_Passport    pp;
    -   ilu_boolean     keepPP = FALSE;
      
        *closed = FALSE;
        pp = ilu_CreatePassport(NIL, err);
    --- 189,194 ----
    ***************
    *** 219,224 ****
    --- 218,225 ----
            ILU_NOTE(CONNECTION_DEBUG,
      	    ("HandleNewConnection: FD budget exhausted.\n"));
            _ilu_ReleaseMutex(ilu_cmu);
    +       ilu_DestroyPassport(pp,&lerr);
    +       ILU_HANDLED(lerr);
            return NIL;
          }
          _ilu_AcquireServerMutex(s);
    ***************
    *** 240,251 ****
            transport_close(t, &cdfd, err);
            ilu_DeltaFD(-cdfd);
          }
    !     if (ILU_ERROK(*err))
    !       ilu_DestroyPassport(pp, err);
    !   } else if (t == NIL) {
    !     ilu_DestroyPassport(pp, err);
    !   } else {
    !     keepPP = TRUE;
          c = _ilu_CreateConnection(t, NIL, peerinfo, port_protocol(port),
      			      port->po_pinfo, port,
      			      port_server(port), pp, err);
    --- 241,247 ----
            transport_close(t, &cdfd, err);
            ilu_DeltaFD(-cdfd);
          }
    !   } else if (t != NIL) {
          c = _ilu_CreateConnection(t, NIL, peerinfo, port_protocol(port),
      			      port->po_pinfo, port,
      			      port_server(port), pp, err);
    ***************
    *** 255,260 ****
    --- 251,258 ----
      	      port, c,
      	      (peerinfo == NIL) ? "NIL peerinfo!" : peerinfo,
      	      server_id(s)));
    +     if (ILU_ERRNOK(*err))
    +       c = NIL;
        }
      dun4:
        ilu_free(peerinfo);
    ***************
    *** 265,272 ****
        _ilu_ReleaseServerMutex(s);
      dun1:
        _ilu_ReleaseMutex(ilu_cmu);
    !   if (pp && !keepPP) {
    !     ilu_Error       lerr;
          ilu_DestroyPassport(pp, &lerr);
          ILU_HANDLED(lerr);
        }
    --- 263,269 ----
        _ilu_ReleaseServerMutex(s);
      dun1:
        _ilu_ReleaseMutex(ilu_cmu);
    !   if ((pp != NIL) && (c == NIL)) {
          ilu_DestroyPassport(pp, &lerr);
          ILU_HANDLED(lerr);
        }
    

  • The WriteBytes method in the TCP transport object doesn't guarantee that there are always 16 bytes free in the output buffer, which can cause connection failures when odd-sized parameter lists are marshalled. Here's a fix:

    *** runtime/kernel/newtcp.c	1997/04/26 07:30:00
    --- 1.68	1997/06/11 07:56:58
    ***************
    *** 362,373 ****
      		ILU_ERRS((IoErrs)) * err)
      {
        ilu_cardinal    rem = self->tr_outLimit - self->tr_outNext;
    -   ilu_boolean direct;
      
    !   direct = (bufferSize >= DIRECT_THRESHOLD || flush && bufferSize > rem
    ! 	    || self->tr_outBuff == NIL);
      
    !   if (direct) {
          if (self->tr_outNext > 0) {
            if (!Write(self, self->tr_outBuff, self->tr_outNext, err))
      	return FALSE;
    --- 362,378 ----
      		ILU_ERRS((IoErrs)) * err)
      {
        ilu_cardinal    rem = self->tr_outLimit - self->tr_outNext;
      
    !   if ((bufferSize >= DIRECT_THRESHOLD)
    !       /* big enough that copy would take longer than write() system call */
      
    !       || (flush && (bufferSize > rem))
    !       || (!flush && (bufferSize > (rem + self->tr_outLimit - 16)))
    !       /* going to need two writes anyway, so avoid copy */
    ! 
    !       || (self->tr_outBuff == NIL)
    !       /* no internal buffer to copy into, so can't copy */
    !       ) {
          if (self->tr_outNext > 0) {
            if (!Write(self, self->tr_outBuff, self->tr_outNext, err))
      	return FALSE;
    ***************
    *** 375,387 ****
          }
          if (!Write(self, b, bufferSize, err))
            return FALSE;
        } else {
          ilu_cardinal    l1 = MIN(rem, bufferSize);
          memcpy((void*)(self->tr_outBuff + self->tr_outNext), (void*)b, l1);
          b += l1;
          bufferSize -= l1;
          self->tr_outNext += l1;
    !     if (flush || self->tr_outNext == self->tr_outLimit) {
            if (!Write(self, self->tr_outBuff, self->tr_outNext, err))
      	return FALSE;
            self->tr_outNext = 0;
    --- 380,393 ----
          }
          if (!Write(self, b, bufferSize, err))
            return FALSE;
    +     /* empty exposed buffer, so at least 16 bytes */
        } else {
          ilu_cardinal    l1 = MIN(rem, bufferSize);
          memcpy((void*)(self->tr_outBuff + self->tr_outNext), (void*)b, l1);
          b += l1;
          bufferSize -= l1;
          self->tr_outNext += l1;
    !     if (flush || ((self->tr_outNext + 16) > self->tr_outLimit)) {
            if (!Write(self, self->tr_outBuff, self->tr_outNext, err))
      	return FALSE;
            self->tr_outNext = 0;
    ***************
    *** 391,396 ****
    --- 397,405 ----
            self->tr_outNext += bufferSize;
          }
        }
    +   _ilu_Assert(((self->tr_outBuff == ILU_NIL)||
    + 	       ((self->tr_outLimit - self->tr_outNext) >= 16)),
    + 	      "_tcp_WriteBytes returns with fewer than 16 free bytes in buffer");
        return ILU_CLER(*err);
      }
      
    

  • From Ian Lance Taylor: ``The ilu_PingObject function fails to set *new_conn when it is called for a true object. It may seem odd to want to ping a true object, but the case arose for me when dealing with an object that normally lives in another process but may also live locally. The ILU_C_PingObject function calls ilu_PingObject and assumes that the value returned in newconn is valid. Unfortunately, when pinging a true object, this is not the case. The appended patch fixes the bug.''

    *** runtime/kernel/object.c	Tue Jul 15 12:07:29 1997
    --- 	Tue Jul 15 11:55:12 1997
    ***************
    *** 1175,1180 ****
    --- 1175,1182 ----
        ilu_boolean     status = FALSE;
        ILU_ERRS((IoErrs, bad_locks, inv_objref, no_resources)) lerr;
      
    +   *new_conn = NIL;
    + 
        if (class_singleton(pclass))
          return (ilu_FALSE);
    
    

  • Jon Curry points out that the typedefs for unions and arrays that contain record types don't work properly in the C expression of those types. This is due to a bug in the C stubber. Here's a patch:

    *** stubbers/c/cheaders.c	Wed Jul 16 12:52:04 1997
    --- new	Wed Jul 16 12:50:50 1997
    ***************
    *** 623,631 ****
      static void generateArrayTypedef (Type t, Context context, boolean slice)
      {
        TypeDescription d = type_description (t);
    !   Type et = d->structuredDes.array.type;
        fprintf (context->file, "typedef ");
    !   switch (type_ur_kind(et)) {
        case void_Type:
        case integer_Type:
        case cardinal_Type:
    --- 623,631 ----
      static void generateArrayTypedef (Type t, Context context, boolean slice)
      {
        TypeDescription d = type_description (t);
    !   Type et = ur_type(d->structuredDes.array.type);
        fprintf (context->file, "typedef ");
    !   switch (type_kind(et)) {
        case void_Type:
        case integer_Type:
        case cardinal_Type:
    

  • Output of array elements in C stubber did not take possible aliasing into account.

    *** stubbers/c/code.c	Wed Jul 16 15:21:11 1997
    --- 	Wed Jul 16 15:23:23 1997
    ***************
    *** 401,414 ****
      	  DimStop = -1;
      	}
            else
    ! 	{
      	  fprintf (context->file, "  ilu_OutputArray (_call, %lu, _err);  if (ILU_ERRNOK(*_err)) return;\n", size);
      	  DimStop = -1;
      	  DimCount = 0;
      	  list_enumerate(dims, dimHeader, context);
      	  sprintf(buf, "%s_val",
    ! 		  ((etk == record_Type || etk == union_Type || etk == pickle_Type ||
    ! 		    (etk == sequence_Type && !TypeIsEitherString(et))))
      		  ? "&" : "");
      	  DimCount = 0;
      	  list_enumerate (dims, dimRef, buf);
    --- 401,415 ----
      	  DimStop = -1;
      	}
            else
    ! 	{ 
    ! 	  TypeKind eurtk = type_ur_kind(et);
      	  fprintf (context->file, "  ilu_OutputArray (_call, %lu, _err);  if (ILU_ERRNOK(*_err)) return;\n", size);
      	  DimStop = -1;
      	  DimCount = 0;
      	  list_enumerate(dims, dimHeader, context);
      	  sprintf(buf, "%s_val",
    ! 		  ((eurtk == record_Type || eurtk == union_Type || eurtk == pickle_Type ||
    ! 		    (eurtk == sequence_Type && !TypeIsEitherString(et))))
      		  ? "&" : "");
      	  DimCount = 0;
      	  list_enumerate (dims, dimRef, buf);
    

  • C stubber was not treating records with Object members as variable.

    *** stubbers/c/common.c	Wed Jul 16 15:29:40 1997
    --- Wed Jul 16 15:33:44 1997
    ***************
    *** 62,67 ****
    --- 62,68 ----
        TypeDescription d = type_description(type);
      
        return (t == sequence_Type || (t == pickle_Type) ||
    + 	  (t == object_Type) ||
      	  (t == array_Type && VariableLength(d->structuredDes.array.type)) ||
      	  (t == record_Type && HasVarField(d->structuredDes.record)) ||
      	  (t == union_Type && HasVarField(d->structuredDes.uniond.types)));
    

  • Java runtime guessed ilu-class wrong when registering true objects. This patch fixes that

    *** runtime/java/IluCall.java	Thu May  8 14:26:07 1997
    --- Mon Jul 21 22:17:55 1997
    ***************
    *** 176,182 ****
                      //a true object...
                      IluClassRep iluClass = 
                          IluClassAccess.iluClassFromJavaClass(obj.getClass());
    !                 if (iluClass != null & staticClass.isA(iluClass)) {
                          IluRT0.registerTrueObject(
                              null, //ih
                              obj, 
    --- 176,182 ----
                      //a true object...
                      IluClassRep iluClass = 
                          IluClassAccess.iluClassFromJavaClass(obj.getClass());
    !                 if (iluClass != null & iluClass.isA(staticClass)) {
                          IluRT0.registerTrueObject(
                              null, //ih
                              obj, 
    *** runtime/java/IluClassRep.java    Thu May  8 14:26:08 1997
    --- Mon Jul 21 22:22:55 1997
    ***************
    *** 347,353 ****
              if (this == a) return true;
              if (a == IluRootClassObjects_stub.rootClass) return true;
              for (int i = 0; i
    
  • Joachim Achtzehnter notes bug in sbilu.c PublishObject().

    *** runtime/kernel/sbilu.c	1997/06/13 17:06:52
    --- 	1997/08/22 03:49:03
    ***************
    *** 694,700 ****
      /*  ILU_C_ENVIRONMENT       env; */
        char                   *proof;
        char                   *sbh;
    !   char                   *mstid;
        ilu_Error err;
      
        if (!InitializeSimpleBinding(obj))
    --- 694,701 ----
      /*  ILU_C_ENVIRONMENT       env; */
        char                   *proof;
        char                   *sbh;
    !   ilu_Server		 server;
    !   ilu_Class		 type;
        ilu_Error err;
      
        if (!InitializeSimpleBinding(obj))
    ***************
    *** 707,715 ****
      	   obj));
          return (NIL);
        } else {
    !     ilu_ReleaseMutex(ilu_cmu);  /* necessary for BeginCall */
          proof = _ilu_Publish_stub(_sb, sbh, &err);
    -     ilu_AcquireMutex(ilu_cmu);
          
          if (ILU_ERRNOK(err)) {
            ILU_NOTE(BINDING_DEBUG | EXPORT_DEBUG,
    --- 708,718 ----
      	   obj));
          return (NIL);
        } else {
    !     server = object_server(obj);
    !     type = object_class(obj);
    !     ilu_DHolds(obj, +1);
    !     ilu_ExitServer(server, type);
          proof = _ilu_Publish_stub(_sb, sbh, &err);
          
          if (ILU_ERRNOK(err)) {
            ILU_NOTE(BINDING_DEBUG | EXPORT_DEBUG,
    ***************
    *** 717,729 ****
      	     sbh, ILU_ERR_NAME(err)));
            ILU_HANDLED(err);
          }
    !     ilu_ExitServer(object_server(obj), object_class(obj));
          return (proof);
        }
      }
      
    - 
    - 
      /*before: Inside(s, cl)
        after:				 L1 disjoint {cmu, s};
        after: cl collectible		      => L1  not >=  {gcmu};
    --- 720,732 ----
      	     sbh, ILU_ERR_NAME(err)));
            ILU_HANDLED(err);
          }
    !     ilu_EnterServer(server, type);
    !     ilu_DeltaHolds(obj, -1);
    !     ilu_ExitServer(server, type);
          return (proof);
        }
      }
      
      /*before: Inside(s, cl)
        after:				 L1 disjoint {cmu, s};
        after: cl collectible		      => L1  not >=  {gcmu};
    ***************
    *** 732,746 ****
        (We don't really need to hold cmu for surrogate or non-collectible
         objects, but this is convenient because ilu_Enter/ExitServer can
         be used.)*/
    - /* To make the stub call, cmu is released and reacquired.
    -    (Out of order.  Exit obj's server after getting the sbh, instead?)
    -  */
      ilu_boolean
      ilu_WithdrawObject(ilu_Object obj, PASS(char *) ownership_proof)
      {
        char                   *sbh;
    -   char                   *oid;
        ilu_boolean             result = ilu_FALSE;
        ilu_Error		 err;
      
        /* Get oid of published obj */
    --- 735,747 ----
        (We don't really need to hold cmu for surrogate or non-collectible
         objects, but this is convenient because ilu_Enter/ExitServer can
         be used.)*/
      ilu_boolean
      ilu_WithdrawObject(ilu_Object obj, PASS(char *) ownership_proof)
      {
        char                   *sbh;
        ilu_boolean             result = ilu_FALSE;
    +   ilu_Server		 server;
    +   ilu_Class		 type;
        ilu_Error		 err;
      
        /* Get oid of published obj */
    ***************
    *** 750,759 ****
      	   obj));
          return (ilu_FALSE);
        } else {
    ! 
    !     ilu_ReleaseMutex(ilu_cmu);  /* necessary for BeginCall */ 
          result = _ilu_Withdraw_stub(_sb, sbh, ownership_proof, &err);
    -     ilu_AcquireMutex(ilu_cmu);
      
          if (ILU_ERRNOK(err)) {
            ILU_NOTE(BINDING_DEBUG | EXPORT_DEBUG,
    --- 751,761 ----
      	   obj));
          return (ilu_FALSE);
        } else {
    !     server = object_server(obj);
    !     type = object_class(obj);
    !     ilu_DHolds(obj, +1);
    !     ilu_ExitServer(server, type);
          result = _ilu_Withdraw_stub(_sb, sbh, ownership_proof, &err);
      
          if (ILU_ERRNOK(err)) {
            ILU_NOTE(BINDING_DEBUG | EXPORT_DEBUG,
    ***************
    *** 763,769 ****
            return ilu_FALSE;
          }
          ilu_free(ownership_proof);
    !     ilu_ExitServer(object_server(obj), object_class(obj));
          return result;
        }
      }
    --- 765,773 ----
            return ilu_FALSE;
          }
          ilu_free(ownership_proof);
    !     ilu_EnterServer(server, type);
    !     ilu_DeltaHolds(obj, -1);
    !     ilu_ExitServer(server, type);
          return result;
        }
      }