1. ok, tell me THIS isn't a bug!
- Posted by useless Aug 10, 2010
- 1748 views
http://designerthinking.com/eufail.html
I kept stepping thru the program, and got_data had no data, so i aborted the run, and kept adding trace(1) back up thru it until i got to that highlighted line, where got_data was changed when the line was executed.
Note when the bottom blue debug window was finally correctly showing got_data's values, it was also pushed down one line. No idea why, just saying.
useless
2. Re: ok, tell me THIS isn't a bug!
- Posted by mattlewis (admin) Aug 10, 2010
- 1710 views
http://designerthinking.com/eufail.html
I kept stepping thru the program, and got_data had no data, so i aborted the run, and kept adding trace(1) back up thru it until i got to that highlighted line, where got_data was changed when the line was executed.
Note when the bottom blue debug window was finally correctly showing got_data's values, it was also pushed down one line. No idea why, just saying.
Yes, that's a bug. I wasn't able to exactly reproduce this, but I think it's likely the same underlying issue: ticket:178.
Matt
3. Re: ok, tell me THIS isn't a bug!
- Posted by ChrisB (moderator) Aug 10, 2010
- 1712 views
Hi
If got_data had a value before line 119, then there is a problem with trim().
Try after the trace on line 118 tmp = got_data (where you've already declared tmp as an object).
Or have you already tried this?
Chris
4. Re: ok, tell me THIS isn't a bug!
- Posted by useless Aug 10, 2010
- 1684 views
I already tried that. In the debugger, there is no value to that variable unless i hit a line that assigns it a value.
For another instance, it shows <no value> prior to the trim line, unless i insert line
got_data = got_data
and then after executing that line, got_data got value. Same as the pics showing it got value upon executing the trim() line.
useless
5. Re: ok, tell me THIS isn't a bug!
- Posted by DerekParnell (admin) Aug 10, 2010
- 1677 views
What you're seeing is definitely a bug. Which revision of Euphoria 4 are you using? I can't reproduce it on my Windows system using SVN 3336.
6. Re: ok, tell me THIS isn't a bug!
- Posted by useless Aug 10, 2010
- 1706 views
What you're seeing is definitely a bug. Which revision of Euphoria 4 are you using? I can't reproduce it on my Windows system using SVN 3336.
Euphoria Interpreter 4.0.0 beta 2 (r2670) for Windows
It's what the demos will run on. Even tho the windows installer was last updated 6 months ago, the demos with it won't run on it.
useless
7. Re: ok, tell me THIS isn't a bug!
- Posted by DerekParnell (admin) Aug 10, 2010
- 1698 views
Euphoria Interpreter 4.0.0 beta 2 (r2670) for Windows ...
Does the following program give you the same effect?
--------- with trace object got_data = 0 trace(1) got_data &= 0 ? got_data ---------
8. Re: ok, tell me THIS isn't a bug!
- Posted by mattlewis (admin) Aug 10, 2010
- 1699 views
What you're seeing is definitely a bug. Which revision of Euphoria 4 are you using? I can't reproduce it on my Windows system using SVN 3336.
Euphoria Interpreter 4.0.0 beta 2 (r2670) for Windows
It's what the demos will run on. Even tho the windows installer was last updated 6 months ago, the demos with it won't run on it.
The issue I described in ticket:178 is reproduced for me on Linux, r3340.
Matt
9. Re: ok, tell me THIS isn't a bug!
- Posted by useless Aug 10, 2010
- 1666 views
What you're seeing is definitely a bug. Which revision of Euphoria 4 are you using? I can't reproduce it on my Windows system using SVN 3336.
Euphoria Interpreter 4.0.0 beta 2 (r2670) for Windows
It's what the demos will run on. Even tho the windows installer was last updated 6 months ago, the demos with it won't run on it.
The issue I described in ticket:178 is reproduced for me on Linux, r3340.
Matt
The version available to mere mortals is
Euphoria Interpreter 4.0.0 beta 3 (r3116) for Windows
useless
10. Re: ok, tell me THIS isn't a bug!
- Posted by mattlewis (admin) Aug 10, 2010
- 1736 views
The issue I described in ticket:178 is reproduced for me on Linux, r3340.
The version available to mere mortals is
Euphoria Interpreter 4.0.0 beta 3 (r3116) for Windows
Actually, for windows users, the latest available is svn:3221 via the eubins site:
http://jeremy.cowgar.com/eubins
I think the Windows eubins might be a more manual process than the Linux version, which is up to svn:3441. That was just committed a little while ago, and fixed the issue I reported with the debugger, and, unfortunately, was a slightly different issue than what you were reporting. I'm having trouble reproducing your issue. Is there any way you can reduce it to a simple, smaller example?
Matt
11. Re: ok, tell me THIS isn't a bug!
- Posted by useless Aug 10, 2010
- 1711 views
The issue I described in ticket:178 is reproduced for me on Linux, r3340.
The version available to mere mortals is
Euphoria Interpreter 4.0.0 beta 3 (r3116) for Windows
Actually, for windows users, the latest available is svn:3221 via the eubins site:
http://jeremy.cowgar.com/eubins
I think the Windows eubins might be a more manual process than the Linux version, which is up to svn:3441. That was just committed a little while ago, and fixed the issue I reported with the debugger, and, unfortunately, was a slightly different issue than what you were reporting. I'm having trouble reproducing your issue. Is there any way you can reduce it to a simple, smaller example?
Matt
I've tried to shrink it, and even giving you the whole code to play with is a problem, because you are on a nix box, and the only interface i have working across the lan for this application is the hub (which is experiencing the bug), a slave client, and mirc. You cannot run mirc, which is where the text is coming from.
The problem is right at:
object got_data = sock:receive(sock_data[i][SELECT_SOCKET], 0)
in chat_server.ew . Previous to that line, got_data is undefined. It's assigned the correct value when that line is executed. But after that, doing a "? got_data" in the debugger returns <no value>.
However, in chat_server.ew, there's no problem.
useless
12. Re: ok, tell me THIS isn't a bug!
- Posted by useless Aug 10, 2010
- 1636 views
I found the bug, and the fix. It is a combination of bad coding style by whoever wrote chat_server.ew, and the interpreter not catching that each loop thru (essentially) "while 1 do" defined/created a new variable of the same name, which the interpreter should have noticed and chastised the programmer about.
I moved all these:
object got_data
object sock_data
object client
up to under the start of the procedure main() where all good var declarations go, and the bug absolutely disappeared.
I didn't/don't complain about the declaration of vars down in the code, but praps it shouldn't be released like that into the wild, in mature-ish code? And the interpreter should be smart enough to know "hey, we already have this variable".
useless
13. Re: ok, tell me THIS isn't a bug!
- Posted by mattlewis (admin) Aug 10, 2010
- 1652 views
The problem is right at:
object got_data = sock:receive(sock_data[i][SELECT_SOCKET], 0)
in chat_server.ew . Previous to that line, got_data is undefined. It's assigned the correct value when that line is executed. But after that, doing a "? got_data" in the debugger returns <no value>.
OK, looking at sock:receive():
public function receive(socket sock, atom flags=0) return machine_func(M_SOCK_RECV, { sock, flags }) end function
...that's probably being inlined. I suspect this may be affected by what was fixed by svn:3125 (or possibly another change to inline.e). In your file, try putting without inline and see if it's still happening. Alternatively, try replacing the call to receive() with the 'raw' machine_func() call:
got_data = machine_func( 86, { sock_data[i][SELECT_SOCKET], 0 } )
Matt
14. Re: ok, tell me THIS isn't a bug!
- Posted by mattlewis (admin) Aug 10, 2010
- 1642 views
I didn't/don't complain about the declaration of vars down in the code, but praps it shouldn't be released like that into the wild, in mature-ish code? And the interpreter should be smart enough to know "hey, we already have this variable".
I guess this is more of a style issue, but either way, the debugger should handle it correctly. Some prefer to have variables scoped as minimally as possible, and declared as close to where they are used as possible. Eu4 allows this.
Technically, it doesn't create a new variable each loop iteration. Whenever one iteration is finished, the variable goes out of scope and is garbage collected (sequences and double precision atoms). Each iteration uses the same variable. It's a bit of a change, and I'd be happy to talk about the hows and whys if anyone is interested. :)
Matt
15. Re: ok, tell me THIS isn't a bug!
- Posted by jimcbrown (admin) Aug 10, 2010
- 1674 views
Actually, for windows users, the latest available is svn:3221 via the eubins site:
http://jeremy.cowgar.com/eubins
I think the Windows eubins might be a more manual process than the Linux version
The obvious solution would be to have automatic Windows eubin builds as well.
16. Re: ok, tell me THIS isn't a bug!
- Posted by useless Aug 10, 2010
- 1635 views
"without inline" shot cpu use to 100%. Way unacceptable. In fact, i could no longer run tests on it.
But i believe i fixed the problem of redeclaring the variables inside a loop, now may i suggest the interpreter catch that sorta occurance and forbid it in the future?
useless
17. Re: ok, tell me THIS isn't a bug!
- Posted by mattlewis (admin) Aug 10, 2010
- 1677 views
"without inline" shot cpu use to 100%. Way unacceptable. In fact, i could no longer run tests on it.
Ouch...that's...surprising...
But i believe i fixed the problem of redeclaring the variables inside a loop, now may i suggest the interpreter catch that sorta occurance and forbid it in the future?
You may suggest it, but I'm pretty sure it won't be done. This was a very purposeful and useful feature addition. Were variables actually redeclared in the same scope (or in a scope contained in the original scope)? That would be a bug. Declaring variables inside a loop is not redeclaring, and isn't a bug.
Matt
18. Re: ok, tell me THIS isn't a bug!
- Posted by useless Aug 10, 2010
- 1615 views
"without inline" shot cpu use to 100%. Way unacceptable. In fact, i could no longer run tests on it.
Ouch...that's...surprising...
But i believe i fixed the problem of redeclaring the variables inside a loop, now may i suggest the interpreter catch that sorta occurance and forbid it in the future?
You may suggest it, but I'm pretty sure it won't be done. This was a very purposeful and useful feature addition. Were variables actually redeclared in the same scope (or in a scope contained in the original scope)? That would be a bug. Declaring variables inside a loop is not redeclaring, and isn't a bug.
Matt
Ok, in chat_server, there is this nest (listing only the relavant stuff):
procedure main(sequence args) while sock:listen(server, 0) label "MAIN" do object sock_data = sock:select({ server } & clients, 0) if sock_data[1][SELECT_IS_READABLE] = 1 then object client = sock:accept(server) object got_data = sock:receive(client[1], 0) end if for i = 2 to length(sock_data) do if sock_data[i][SELECT_IS_READABLE] then object got_data = sock:receive(sock_data[i][SELECT_SOCKET], 0) end if end for end while end procedure
Are you saying each instance of "object whatever" isn't a problem in that code? Especially the two "object got_data", which is the variable i was having trouble with?
useless
19. Re: ok, tell me THIS isn't a bug!
- Posted by mattlewis (admin) Aug 10, 2010
- 1649 views
if sock_data[1][SELECT_IS_READABLE] = 1 then object client = sock:accept(server) object got_data = sock:receive(client[1], 0) end if for i = 2 to length(sock_data) do if sock_data[i][SELECT_IS_READABLE] then object got_data = sock:receive(sock_data[i][SELECT_SOCKET], 0) end if end for
Are you saying each instance of "object whatever" isn't a problem in that code? Especially the two "object got_data", which is the variable i was having trouble with?
It's not a problem for the execution of the interpreter. The first variable goes out of scope at the "end if" immediately following it. However, I think I understand why you're seeing the "no value" in the debugger. It looks like it's probably seeing the first one, and not looking at the second one. I guess the debugger hasn't gotten a lot of attention (really, RTLookup()), and doesn't understand the new scoping rules, which are actually important.
We added lots of scope levels, in addition to routines. So as far as the declarations are concerned, it's analogous to:
procedure foo() object data = 1 end procedure procedure bar() object data = 2 end procedure
I can definitely reproduce this. I'll open a ticket here shortly.
Matt
20. Re: ok, tell me THIS isn't a bug!
- Posted by mattlewis (admin) Aug 11, 2010
- 1605 views
Are you saying each instance of "object whatever" isn't a problem in that code? Especially the two "object got_data", which is the variable i was having trouble with?
I can definitely reproduce this. I'll open a ticket here shortly.
See ticket:180. Fixed in svn:3342.
Matt
21. Re: ok, tell me THIS isn't a bug!
- Posted by useless Aug 11, 2010
- 1593 views
Are you saying each instance of "object whatever" isn't a problem in that code? Especially the two "object got_data", which is the variable i was having trouble with?
I can definitely reproduce this. I'll open a ticket here shortly.
See ticket:180. Fixed in svn:3342.
Matt
Great! thanks!
I am looking forwards to downloading the newest v4 when it's all caught up for windoze (the demos too).
useless