carlos@deervax.concordia.CDN (Carlos Perez) (03/03/88)
HELP !, Has anybody port 'mextra' (1983 VLSI tools UCB) from a VAX11/780 running 4.3BSD to a Sun3/160 running UNIX3.5?. I'm working on that and I got stuck. 1. I'm able to compile mextra but when I run it I get a 'segmentation violation ' fault. 2. Using dbx... (dbx) running mextra nor2 signal SEGV (segmentation violation) in strlen at 0x184c8 strlen+8: tstb a1@+ 3. Checking my stack... (dbx)where strlen(0ffffffff, 0x0, 0x9582, 0x0) at 0x184c8 CleanUp(), ReadCif(FileName=0x40f48 "nor2.cif") main(argc=2, argv = 0xefffc7c, 0xefffc88) 4. CleanUp calls EnumerateSymbol with the following arguments : EnumerateSymbol(-1,NIL,check,NIL); 5. EnumerateSymbols is defined as : EnumerateSymbol(n,trans,f,path) int n; transform *trans; int (* f)(); char *path; { int len; /*other local variables*/ len = strlen(path) + 1; ^^^^ Here is where my program crashes ^^^^ 6. I tried len = (int)strlen(path) + 1; but doesn't do anything. Does anybody have any idea of what is going on or how to tackle this problem? Any info will be appreciated. Carlos Perez Concordia University 1455 de Maisonneuve Montreal, Que. H3G 1M8 (514)848-3107 CSNET: carlos%deervax.concordia.cdn@ubc.CSNET UUCP: mit-eddie!musocs!deervax!carlos
spp@zabriskie.uucp (Steve Pope) (03/04/88)
The fix here is simple; on a SUN strlen(path) crashes if path is a null pointer. Try something like if (path==NIL) len=1; else len = strlen(path) + 1; and you should get around your immediate problem. steve
owens@psuvax1.psu.edu (Robert Michael Owens) (03/04/88)
In article <974*carlos@deervax.concordia.cdn>, carlos@deervax.concordia.CDN (Carlos Perez) writes: > HELP !, > > len = strlen(path) + 1; > ^^^^ Here is where my program crashes ^^^^ > path has value of zero. works on vax *(char *)0 is zero but doesn't elsewhere. owens