Possible bug with socket code

Alex S. Crain alex at umbc3.UMBC.EDU
Fri Oct 20 02:16:04 AEST 1989


In article <1989Oct16.032605.279 at hybrid.UUCP> mdapoz at hybrid.UUCP (Mark Dapoz) writes:
>I think I may have stumbled across a bug in the ipc code recently posted.  I
>was working on trying to write a program which uses the locking(3C) facilities
>and I kept running into problems.  Whenever I would call the locking() routine,
>it would always return with an error, which perror indicates is invalid address.

	I got a bug report on this awhile back, which I shelved until I 
could verify it, but it looks like you just did that (I gotta get a 
machine!). The problem was discovered by Brad Bosch, who sent mail to 
me which I promptly forgot all about until today, when I recognised it.
Suggestions that I don't have it together will should be mailed to me so that
I can lose them promptly :-).

	In any case, the problem is that instead of trapping through 
syslocal(), the code traps through locking(). The fix is to change the trap
number from 67 to 68. Below are the diffs to accomplish this.

	I've put up a new version (1.3.1) for ftp from umbc3 taht has this 
patch already.

#################################		:alex.
#Disclamer: Anyone who agrees   #    University of Maryland Baltimore County
#with me deserves what they get.#	alex at umbc3.umbc.edu
#################################	

*** sysconfig.m4~       Thu Oct 19 11:48:30 1989
--- sysconfig.m4        Thu Oct 19 11:53:06 1989
***************
*** 10,16
  #
  # the syscall number for syslocal()
  #
! define(SYSL_SYSCALL, 67)
  #
  # the offset of the last known local system call.
  #

--- 10,16 -----
  #
  # the syscall number for syslocal()
  #
! define(SYSL_SYSCALL, 68)
  #
  # the offset of the last known local system call.
  #

*** lib/generic.m4~     Thu Oct 19 12:12:02 1989
--- lib/generic.m4      Thu Oct 19 12:12:50 1989
***************
*** 11,17
  SYSCALL_NAME:
        mov.l   (%sp),-(%sp)                    # move the return address
        mov.l   &SYSCALL_NUMBER,4(%sp)                  # insert the first argum
ent
!       mov.w   &67,%d0                         #
        trap    &0                              # trap to syslocal()
        bcc     noerror                         # return if status = 0
        jmp     __cerror                        # otherwise __cerror()

--- 11,17 -----
  SYSCALL_NAME:
        mov.l   (%sp),-(%sp)                    # move the return address
        mov.l   &SYSCALL_NUMBER,4(%sp)                  # insert the first argum
ent
!       mov.w   &SYSL_SYSCALL,%d0                               #
        trap    &0                              # trap to syslocal()
        bcc     noerror                         # return if status = 0
        jmp     __cerror                        # otherwise __cerror()
-- 
#################################		:alex.
#Disclamer: Anyone who agrees   #    University of Maryland Baltimore County
#with me deserves what they get.#	alex at umbc3.umbc.edu
#################################	



More information about the Unix-pc.general mailing list