axiom-developer
[Top][All Lists]
Advanced

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

RE: [Axiom-developer] Broken hypertex


From: Bill Page
Subject: RE: [Axiom-developer] Broken hypertex
Date: Sat, 14 Oct 2006 12:12:42 -0400

On October 13, 2006 8:55 PM Gabriel Dos Reis wrote:
> 
> Waldek Hebisch <address@hidden> writes:
> 
> | Gabriel Dos Reis wrote:
> | > Waldek Hebisch <address@hidden> writes:
> | > 
> | > | Gabriel Dos Reis wrote:
> | > | > Waldek Hebisch <address@hidden> writes:
> | > | > 
> | > | > | Playing with build-improvements I have noticed that 
> | > | > | hypertex is broken:
> | > | > 
> | > | > Is that reproducible with silver?
> | > | > 
> | > | 
> | > | Probably no: when I tried build-improvements with 
> | > | gcl-2.6.7 the problem went away.
> | > 
> | > Interesting.
> | > 
> | > We have a case to investigate.  I seem to remember, but 
> | > I'm not sure, that the socket interface may have changed
> | > from 2.6.7 to 2.6.8pre. Bill?

The change in the socket interface is due only to the better
treatment of data types in 2.6.8pre and should not be the
source of any functional changes.

> | 
> | As I wrote in original message the problem seem to be with
> | passing strings from Lisp to C functions.  AFAICS sockio.lisp.
> | pamphlet assumes that it will pass pointer to original string
> | buffer. But apparently gcl passes pointer to a copy.  Code to
> | pass strings (in lsp/gcl-2.6.8pre/o/cmpaux.c) changed slightly
> | compared to gcl-2.6.7, so maybe this is the reason.

I think the change has been quite substantial. See the diff output
below.

> 
> I understand your description.  I was trying to relate it to a
> much bigger picture.  I was asking Bill whether that is the
> incompatible changes in GCL-2.6.8pre's socket stuff he told me
> about at the last  Axiom conference call.

No.

> 
> It is important that as we work on "fixing" things, we do
> clearly understand what we are fixing.
> 

I agree. I think this thread could benefit by a more explicit
reference to the source code. See below.

On October 14, 2006 6:53 AM Vanuxem Grégory wrote:
> 
> Le samedi 14 octobre 2006 à 03:09 +0200, Waldek Hebisch a écrit :
> [...] 
> > >  
> > > The output of ? "NAG link" and then on "Browser pages for 
> > > individualroutines" ? is 
> > > 
> > > There is no constructor matching pattern  "Nag*"
> > >
> > 
> > This I consider as "normal" output.  For me the browser 
> > just freezes. I should add that I chose this page because it
> > is the shortest path to freeze the browser -- I can freeze it
> > an another pages (which in earlier versions work fine). 
> > 
> > Investigating further I have noticed that gcl-2.6.8pre2 in 
> > silver is different then gcl-2.6.8pre in build improvements.
> > In particular the function object_to_string in gcl-2.6.8pre2/o/
> > cmpaux.c is like gcl-2.6.7 while the version in gcl-2.6.8pre
> > is different.
> 
> Exactly, a typo (& instead of %), no ? I think Camm read this
> mailing list but writing directly to him would be a good idea.
> 

I agree. The following line in the diff output below

+  if (x->st.st_dim == leng && leng & sizeof(object)

should actually read

+  if (x->st.st_dim == leng && leng % sizeof(object)

Regards,
Bill Page.

Note: axiom--main--1 is "Axiom Gold".

$ diff -au ~/repository/axiom--main--1/lsp/gcl-2.6.8pre/o/cmpaux.c \
  ~/axiom.silver/build-improvements/lsp/gcl-2.6.8pre/o/cmpaux.c
--- /home/page/repository/axiom--main--1/lsp/gcl-2.6.8pre/o/cmpaux.c
2005-12-01 16:18:23.000000000 -0600
+++ /home/page/axiom.silver/build-improvements/lsp/gcl-2.6.8pre/o/cmpaux.c
2006-08-25 14:08:41.000000000 -0500
@@ -34,6 +34,8 @@
 #include "include.h"
 #define dcheck_type(a,b) check_type(a,b)

+#include "page.h"
+
 DEFUNO_NEW("SPECIALP",object,fSspecialp,SI
        ,1,1,NONE,OO,OO,OO,OO,void,siLspecialp,(object sym),"")
 {
@@ -205,6 +207,31 @@
        return(i);
 }

+fixnum
+object_to_fixnum(object x)
+{
+       fixnum i=0;
+
+       switch (type_of(x)) {
+       case t_character:
+         i = char_code(x);  break;
+       case t_fixnum:
+         i = fix(x);  break;
+       case t_bignum:
+         i = number_to_double(x);
+         break;
+       case t_ratio:
+         i = number_to_double(x);  break;
+       case t_shortfloat:
+         i = sf(x);  break;
+       case t_longfloat:
+         i = lf(x);  break;
+       default:
+         FEerror("~S cannot be coerce to a C int.", 1, x);
+       }
+       return(i);
+}
+
 float
 object_to_float(object x)
 {
@@ -256,26 +283,31 @@
    have a null character in the fillpointer position. */

 char *
-object_to_string(object x)
-{ unsigned int leng;
+object_to_string(object x) {
+
+  unsigned int leng;
+  long np;
+  char *res;
+
   if (type_of(x)!=t_string) FEwrong_type_argument(sLstring,x);
   leng= x->st.st_fillp;
   /* user has thoughtfully provided a null terminated string ! */
-    if (leng > 0 && leng < x->st.st_dim && x->st.st_self[leng]==0)
+  if (leng > 0 && leng < x->st.st_dim && x->st.st_self[leng]==0)
     return x->st.st_self;
-  if (x->st.st_dim == leng
-      && ( leng % sizeof(object))
-     )
-    { x->st.st_self[leng] = 0;
-      return x->st.st_self;
-    }
-  else
-    {char *res=malloc(leng+1);
-     bcopy(x->st.st_self,res,leng);
-     res[leng]=0;
-     return res;
-   }}

+  np=page(x->st.st_self);
+  if (x->st.st_dim == leng && leng & sizeof(object)
+      && np<MAXPAGE && (type_map[np]==t_relocatable ||
type_map[np]==t_contiguous)) {
+    x->st.st_self[leng] = 0;
+    return x->st.st_self;
+  }
+
+  res=malloc(leng+1);
+  bcopy(x->st.st_self,res,leng);
+  res[leng]=0;
+  return res;
+
+}

 /*  typedef int (*FUNC)(); */

address@hidden o]$






reply via email to

[Prev in Thread] Current Thread [Next in Thread]