[Download-List] segmentation fault

Don Prezioso dprez at ashland.edu
Fri Nov 4 10:44:23 EST 2005


Dave,
 
That was the problem. Too much time in perl I guess. I didn't even remember that you don't return a variable in UniBasic subroutines.
 
Thanks
 
--
Don Prezioso
Director of Administrative Systems
Ashland University
Ashland, Ohio

>>> rotmand at cedarville.edu 11/04/05 10:13 AM >>>

Don--

On our system, running DOWNLOAD using your subroutine
abends but not with a segmentation fault.  I was able to get
it to run by changing the line:
    RETURN RESULT
to
    RETURN

I'm suspecting UniBASIC (being called by DOWNLOAD
invoking ITYPE) was confused about a subroutine returning
a function value.

Let me know if this change doesn't fix the problem.



Dave Rotman
Director of Computer Services
Cedarville University
251 N. Main Street
Cedarville, OH 45314
rotmand at cedarville.edu
voice 937-766-7905
fax 937-766-8819

>>> dprez at ashland.edu 11/3/2005 11:34:29 am >>>
O.K., I'm really puzzled on this one. 

I have a virtual field that calls a subroutine. In LIST statements it works fine, but DOWNLOAD gives a segmentation fault.

First the error:

:GET.LIST TEST.DVP
10 records retrieved to list 0.
>DOWNLOAD STUDENTS STU.DMD.CREDITS FORMAT FIXED
DOWNLOAD version 7.12
Using input file STUDENTS
Output to screen

Segmentation fault
ibmp630:/datatel/live/collive $

The virtual field code is:

SUBR("DELTA.MU.DELTA.CREDITS",STUDENTS.ID)

And the DELTA.MU.DELTA.CREDITS subroutine code is:

SUBROUTINE DELTA.MU.DELTA.CREDITS(RESULT,ID.NO)
*  TAKES AN ID NUMBER AND RETURNS A TOTAL NUMBER CREDITS EARNED FOR
*  DELTA MU DELTA REPORT
COMMON /DMDCRED/ OPENED, F.TRANS.GROUP, F.STUD.ACAD.CRED, F.STU.ACAD.LEVEL, ACAD.LEVELS
IF NOT(OPENED) THEN
  OPEN '','TRANSCRIPT.GROUPINGS' TO F.TRANS.GROUP
     ELSE STOP "UNABLE TO OPEN TRANSCRIPT GROUPING FILE"
  OPEN '','STUDENT.ACAD.CRED' TO F.STUD.ACAD.CRED
     ELSE STOP "UNABLE TO OPEN STUDENT.ACAD.CRED FILE"
  OPEN '','STUDENT.ACAD.LEVELS' TO F.STU.ACAD.LEVEL
     ELSE STOP "UNABLE TO OPEN STUDENT.ACAD.LEVELS FILE"
  READ TG.REC FROM F.TRANS.GROUP, 'MB'
    ELSE TG.REC = ''
  ACAD.LEVELS = TG.REC<2>
  OPENED = 1
END
*
X.TOTAL = 0
RESULT = 0
ACAD.LEVEL.COUNT = DCOUNT(ACAD.LEVELS, at VM)
FOR LEVEL = 1 TO ACAD.LEVEL.COUNT
  READ STA.REC FROM F.STU.ACAD.LEVEL,ID.NO:'*':ACAD.LEVELS<1,LEVEL> THEN
    STUDENT.ACAD.CRED = STA.REC<10>
    CRED.COUNT = DCOUNT(STUDENT.ACAD.CRED, at VM)
    FOR I = 1 TO CRED.COUNT
      READ STC.REC FROM F.STUD.ACAD.CRED,STUDENT.ACAD.CRED<1,I> THEN 
        IF STC.REC<13> GT 0 THEN
          X.TOTAL += STC.REC<13>
        END
      END
    NEXT I
  END
NEXT LEVEL
*
IF X.TOTAL THEN 
  RESULT = OCONV(X.TOTAL,"MD05") 
END
*
RETURN RESULT
END

If I try to do a DOWNLOAD using an EVAL, instead of the virtual field, I get:

:GET.LIST TEST.DVP
10 records retrieved to list 0.
>DOWNLOAD STUDENTS EVAL 'SUBR("DELTA.MU.DELTA.CREDITS",STUDENTS.ID)'
DOWNLOAD version 7.12
Creating temporary list DLDPREZ40567
10 key(s) saved to 1 record(s).
10 records retrieved to list 1.
Overwriting existing select list.
10 records retrieved to list 1.
Using input file STUDENTS
Output to screen

""
""
""
""
""
""
""
""
""
""

10 records processed.
Deleting temporary list DLDPREZ40567
'DLDPREZ40567' deleted.
:

It should be returning some number (if only 0) instead of the null strings.  If I do a LIST statement I get:

:GET.LIST TEST.DVP
10 records retrieved to list 0.
>LIST STUDENTS STU.DMD.CREDITS

LIST STUDENTS STU.DMD.CREDITS 11:31:21 Nov 03 2005 1
STUDENTS.. STU.D

0936711       27
0816629       16
0896532       18
0936713       12
0936719       18
0736451       18
0976714        6
0616439       28
0896540       17
0556488       12
10 records listed

I have messed around with the subroutine code (there didn't used to be common, and it didn't used to verify the presence of data) to no avail. Any ideas?

Thanks

Don


--
Don Prezioso
Director of Administrative Systems
Ashland University
Ashland, Ohio



_______________________________________________
download-list mailing list
download-list at cedarville.edu
http://mail.cedarville.edu/mailman/listinfo/download-list


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.cedarville.edu/pipermail/download-list/attachments/20051104/b588ccc0/attachment.html>


More information about the download-list mailing list