1. Return misplacing values?

Hello All,

I am having a fairly strange bug. I have a multiple file program that 
keeps crashing out on the return values from functions.  

Example Code:
----------------------------------------------
File 1:  (dogprog.exw)
---------------
include walkthedog.ew

integer dog

dog = 1 

dog = sniffhydrant(dog)

...


File 2: (walkthedog.ew)
---------------
global function sniffhydrant(integer doggie)

  doggie += 1

  return doggie

end function
----------------------------------------

In this example it would crash on "return doggie" saying that doggie
has no value.  At least, thats what ex.err is telling me.  The strange 
part is that it isn't consistently doing this.  Only after a few hundred 
iterations or so.  I am using Eu 2.5

Now obviously if this was a euphoria bug someone else would have to of 
noticed this by now.  What are some directions I can look to find the 
cause of this bug? 

I am using a timer in this program.  Could it be ticking and dropping 
the value?  (Shot from left field!)

Thanks in advance!

Steve A.

new topic     » topic index » view message » categorize

2. Re: Return misplacing values?

Could you please post us your ex.err and your timmer code. Your example works
fine as a single core/thread application.


n.b. this problem is probably not related but sniffhydrant() may need to check
     the bounds of 'doogie' before returning ie try...
    global function sniffhydrant(integer doggie)
        
        if doggie < #7FFFFFFF then
            doggie += 1
        else
            -- catch the type check failure and
            -- allow the thread to continue (-:
            puts(1, "unable to increment 'doggie'")
        end if

        return doggie

    end function


try your code useing this version of sniffhydrant() and see what happens.
an ex.err might produce a better analisis.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu