xemacs bug

"Lambert, David W (S&T)" <[email protected]> Thu, 03 Feb 2005 16:24:57 -0500
Newsgroups gmane.emacs.xemacs.general
Message-ID <[email protected]>

xemacs hangs in c-mode.

[email protected]
  
Start xemacs from bash shell with these files:

  init.el as ~/.xemacs/init.el  (didn't test importance)
  local.c as ~/src/c/local.c.

    dired of this directory looks like:
  
      /home/lambertdw/src/c:
      used 21 available 26771752
      drwxrwxrwx+ 3 lambertdw mkpasswd     0 Feb  3 16:07 .
      drwxrwxrwx+ 3 lambertdw mkpasswd     0 Feb  1 14:10 ..
      -rw-r--r--  1 lambertdw mkpasswd   485 Feb  3 14:56 Makefile
      drwxrwxrwx+ 2 lambertdw mkpasswd     0 Feb  3 13:36 RCS
      -rw-rw-rw-  1 lambertdw mkpasswd  1878 Feb  3 15:47 local.c
      -rw-rw-rw-  1 lambertdw mkpasswd    90 Feb  3 14:57 localTest.c
      -rw-rw-rw-  1 lambertdw mkpasswd    91 Feb  3 14:31 localTest.c~
      -rwxrwxrwx  1 lambertdw mkpasswd 14043 Feb  3 14:57 localTest.exe

  dribble file shows (you) how to reproduce the error.
  version file is the result of the xemacs version command.

thanks,
[email protected]
init.el (application/octet-stream, 376 B) - not displayed
dribble (application/octet-stream, 3.1 KB) - not displayed
local.c (application/octet-stream, 1.8 KB)
#include "local.h"
#include <stdarg.h>

void notify(FILE*pf,int level,char*prefix,char*suffix,char*format,...) {
  va_list args;
  fprintf(pf,prefix);
  va_start(args,format);
  vfprintf(pf,format,args);
  va_end(args);
  fprintf(pf,suffix);
  if (1 < level)
    exit(level);
}

void*dwlcalloc(size_t num_of_elts,size_t elt_size) {
  void*rv = calloc(num_of_elts,elt_size);
  if (NULL == rv)
    fail("cannot allocate an additional %d bytes",num_of_elts*elt_size);
  return rv;
}

static void*setup_2d_array(void*start_location,
			   int number_of_pointers,
			   size_t element_size) {
  /* return pointer to the memory location following this entire space */
  int i;
  void*pv = (void*)((void**)start_location + number_of_pointers);
  for (i = 0; i < number_of_pointers; ++i, pv += element_size)
    ((void**)start_location)[i] = pv;
  return pv;
}
  void
    *rv;
  if (rank < 1)
    rv = dwlmalloc((size_t)1,element_size);
  if (rank < 2)
    rv = dwlmalloc((size_t)(*shape),element_size);
  else {
    void
      *start_location;
    size_t
      bytes_required;
    int
      i,j,
      cumulative_product[rank],
      pointer_count = 0;
    *cumulative_product = *shape;
    for (i = 1; i < rank; ++rank) {
      j = cumulative_product[i-1];
      pointer_count += j;
      cumulative_product[i] = j*shape[i];
    }
    bytes_required =
      sizeof(void*)*pointer_count +
      element_size*cumulative_product[i-1];
    start_location = rv = dwlmalloc(bytes_required,(size_t)1);
    for (i = 0; i < rank-2; ++i)
      start_location = setup_2d_array(start_location,
				      cumulative_product[i],
				      sizeof(void*)*shape[i+1]);
    setup_2d_array(start_location,cumulative_product[i],element_size);
  }
  return rv;
}
void*(*allocator[](
void*alloc_array(int rank,int*shape,size_t element_size) {
  return allocator[BIND(rank,0,2)](rank,shape,element_size);
}
version (application/octet-stream, 222 B) - not displayed