RE: J. Brown, Pete Eberlein or Irv Mullins - socketlib.eu

new topic     » goto parent     » topic index » view thread      » older message » newer message

This looks like common problem that some programs have linking to the 
errno variable on RedHat 9.  The problem is that reading errno as 
variable is unsafe in threaded programs, so they took it out altogether, 
and have a function to read errno instead.  It is interesting that the 
comments indicate that the author was aware (poke, poke... jbrown?  blink 
of this and coded the errno interface to the function incorrectly.  To 
fix it, comment out line 71, and add these lines immediately after it.

errno_var = define_c_var(lib,"errno"),
errno_location = define_c_func(lib,"__errno_location",{},C_INT)

function errno () 
    if errno_var != -1 then
    	return peek4s(errno_var)
    else
    	return c_func(errno_location, {})
    end if
end function


And then at what used to be line 120 

if peek4s(errno) != EAGAIN then

change the whole if statement to:

	    if errno() != EAGAIN then
		if DEBUG then
		    puts(DEBUG,"READ: errno is "&sprint(errno())&'\n')
		end if
	    end if

I haven't really tested this though.  If it doesn't work, let me know.

Pete E

Jonas Temple wrote:
> 
> 
> Irv,
> 
> Thanks for being willing to test this out!  You're getting the exact 
> same error I was.  Peter thought it might be something in socketlib.eu 
> or his misunderstanding of how the library works.
> 
> At a glance, would you know why this error is happening?  I traced it 
> down to a routine where single characters were being read from a socket 
> (don't have the source with me right now).
> 
> Jonas
> 
> I Mullins wrote:
> > 
> > 
> > Jonas Temple wrote:
> > > 
> > > 
> > > Gentleman,
> > > 
> > > Peter Blue thought I might want to ask you guys about socketlib.eu and 
> > > his smtp-lib.e.
> > > 
> > > I'm running RedHat 9 and am running into problems when using his 
> > > smtp-lib.e.  If any of you have RH could you please try his library on 
> > > your machine and see if you get the same results?
> > 
> > I get:
> > socketlib.eu:120 in function SockRead()
> > A machine-level exception occurred during execution of this statement
> > ... called from smtp-lib.e:18 in function smtpRead()
> > ... called from smtp-lib.e:34 in function smtpReadCode()
> > ... called from smtp-lib.e:94 in function PostMail()
> > ... called from smtp-lib.exu:14
> > --> see ex.err
> > 
> > Irv
> > 
>

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu