Subject: RE: [Vim-vms] Vim: Caught deadly signal BUS

From: "Groen Norbert" <[email-masked]>
Date: Tue, 26 Oct 2004 17:40:56 +0200

Hi everybody,

I'm giving up it for now. I've got some work to catch up. ;-(

I tried to work out the problem with a small test. (see the final source (without the procs from the vim-src) at the end of this mail)

The problem seems to be in the decc$translate_vms, which makes a unix filespec out of a vms filespec. It's beeing fed with the wrong wildcards. (unix instead of vms)

$ test_unix vim:[doc]ta%%
VMS filespec to be translated: "vim:[doc]ta%%"
Translation to unix filespec:  "/vim/doc/ta??"
Using the unix filespec to search vms-files:

file:           SMS_DSK:[DEVSMS.USR.ALGEMEEN.VIM.VIM63.DOC]TAGS..1

1 files found.

----->Thats OK!

$ test_unix vim:[doc]ta??
VMS filespec to be translated: "vim:[doc]ta??"
%SYSTEM-F-ACCVIO, access violation, reason mask=00, virtual address=0000000000000000, PC=FFFFFFFF8055C6A8, PS=0000001B
%TRACE-F-TRACEBACK, symbolic stack dump follows
  image    module    routine             line      rel PC           abs PC
                                            0 0000000000000000 FFFFFFFF8055C6A8
 TEST_UNIX  TEST_UNIX  main              2945 0000000000000818 0000000000030818
 TEST_UNIX  TEST_UNIX  __main               0 0000000000000070 0000000000030070
                                            0 FFFFFFFF9A9DB474 FFFFFFFF9A9DB474

----->This not! The Problem should be tackled by "vms_fixfilename",
----->so I changed it(with a edited copy of the source in my
----->standalone test_unix.c).

$ test_unix vim:[doc]ta??
VMS filespec to be translated: "vim:[doc]ta??"
VMS filespec fixed           : "vim:[doc]ta??"
%SYSTEM-F-ACCVIO, access violation, reason mask=00, virtual address=0000000000000000, PC=FFFFFFFF8055C6A8, PS=0000001B
%TRACE-F-TRACEBACK, symbolic stack dump follows
  image    module    routine             line      rel PC           abs PC
                                            0 0000000000000000 FFFFFFFF8055C6A8
 TEST_UNIX  TEST_UNIX  main              2948 0000000000000880 0000000000030880
 TEST_UNIX  TEST_UNIX  __main               0 0000000000000070 0000000000030070
                                            0 FFFFFFFF9A9DB474 FFFFFFFF9A9DB474

----->So vms_fixfilename, doesn't fix it!
----->Well add a fix to that then.

$ test_unix vim:[doc]ta??
VMS filespec to be translated: "vim:[doc]ta??"
VMS filespec fixed           : "vim:[doc]ta%%"
Translation to unix filespec:  "/vim/doc/ta??"
Using the unix filespec to search vms-files:

file:           SMS_DSK:[DEVSMS.USR.ALGEMEEN.VIM.VIM63.DOC]TAGS..1

1 files found.

----->That Works!!!
----->So ad the fix to the vim-source:

************
File SMS_DSK:[DEVSMS.USR.ALGEMEEN.VIM.BUILD.SRC]OS_VMS.C;1
  616       if ( strchr(instring,'/') == NULL )
******
File SMS_DSK:[DEVSMS.USR.ALGEMEEN.VIM.BUILD.SRC]OS_VMS.C;7
  616       while ( strchr(instring,'?') != NULL )  /* Unix wildcards in VMS filespec */
  617           *strchr(instring,'?') = '%';
  618
  619       if ( strchr(instring,'/') == NULL )
************

----->Then compile and try it.........

Vim: Caught deadly signal BUS
Vim: Finished.

----->That doesn't do the job !!!

I'm totally lost now. The problem lays in the use of mixed unix/vms wildcards, but I can't see where it goes wrong.
I'm setting the patch Zoltan offered, that is the only thing that works for now.

Bye,

Norbert.

==================test source====================
#include <unixlib.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int print_name(char * name, int type)
{ if ( type == DECC$K_DIRECTORY )
      printf("directory:      %s\n",name);
  else
    if ( type == DECC$K_FOREIGN)
      printf("remote non-VMS: %s\n", name);
    else
      printf("file:           %s\n", name);
  return(1);
}

  char  output[250];
  char  input[250];
void main(int argc, char * argv[])
{ int number_found;
  if (argc >1)
  { strcpy(input,argv[1]);
    printf("VMS filespec to be translated: \"%s\"\n", input);

    strcpy(output , vms_fixfilename(input));
    printf("VMS filespec fixed           : \"%s\"\n", output);

    strcpy(input,output);
    strcpy(output , decc$translate_vms(input));
    printf("Translation to unix filespec:  \"%s\"\n", output);

    printf("Using the unix filespec to search vms-files:\n\n");
    number_found = decc$to_vms (output, print_name, 1, 0);
    printf( "\n%d files found.\n", number_found);

  }
  else
    fprintf(stderr,"  Usage: \"%s <Unix-pad>\"\n",argv[0]);
}
==================test source====================

---

From: "Zoltan Arpadffy" <[email-masked]>
Date: Wed, 27 Oct 2004 05:50:41 +0200

Norbert,

Your investigation is very valuable.
Probably it would be the best solution, indeed, to add some control in
vms_fixfilename but it needs some more investigation - specially that
the problem is not reproducible on every system - seems it depends of
ECO patch level.

I released new binaries - since old binaries are kind of "unusable" with
dirty fix proposed.

... and we should concentrate in future on final solution regarding this
issue. 

Regards, 
Z