Re: Strange machine-level exception

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

Derek Parnell wrote:

> Juergen Luethje wrote:
>> 
>> Hi all,
>> 
>> I've changed my private create_set() function a little, in order to take
>> advantage of find_from(). Then I encountered a strange machine-level
>> exception.
>> 
>> I've tested it on Windows XP Pro and Euphoria 3.1. The following code runs
>> fine when interpreted by EX.exe, EXW.exe and EXWC.exe. When I uncomment
>> the denoted line near the end, the program still runs fine with EX.exe but
>> crashes reliably with EXW.exe and EXWC.exe. Renaming "safe.e" to "machine.e"
>> and including it in the program didn't provide any hints.
> 
> 
>> Can someone please confirm the problem?
> 
> Yes I can confirm it.

Thanks, Derek.

> There does appear to be a problem with find_from(). I
> tried to get around it by not assigning back to the 's' sequence and that
> worked
> for small sequence size but it failed for large ones.

A strange point IMHO is, that the problem does not only depend on the size
of s but also on its content. With s = repeat(1000, {0,0,0}) there is no
problem, with other content (when the line at the end of the program is
uncommented) the program crashes.

> If you don't use find_from()
> it works ...
> 
> eg.
> 
> function create_set (sequence s)
>    -- create a set (= remove duplicate entries)
>    sequence t
>    object x
> 
>    if length(s) < 2 then
>       return s
>    end if
> 
>    t = {s[1]}
>    for i = 2 to length(s) - 1 do
>       x = s[i]
>       if find(x, t) = 0 then
>          t = append(t,x)
>       end if
>    end for
>    return t
> end function

Yep.

Regards,
   Juergen

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

Search



Quick Links

User menu

Not signed in.

Misc Menu