[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Bug reports
. . -> [Subject]  default lists for utils.multilistbox don't work properly
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

default lists for utils.multilistbox don't work properly

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page


Pages: 1 2  

Posted by Fiendish   USA  (939 posts)  [Biography] bio   Global Moderator
Date Thu 21 Jul 2011 10:48 PM (UTC)  quote  ]
Message
If I do

utils.multilistbox ("", "", {a="a", b="b", c="c", d="d", e="e", f="f", g="g", h="h", i="i", j="j", k="k", l="l", m="m", n="n"}, {a=true, b=true, c=true, d=true, i=true, m=true, n=true})

then e, f, g, and h are not active (good), but j, k, and l are active even though I don't want them to be (bad).

http://aardwolfclientpackage.googlecode.com/
https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

Posted by Nick Gammon   Australia  (19,180 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Fri 22 Jul 2011 01:30 AM (UTC)  quote  ]
Message
Seems OK to me under Windows XP:


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (19,180 posts)  [Biography] bio   Forum Administrator
Date Reply #2 on Fri 22 Jul 2011 01:40 AM (UTC)  quote  ]
Message
Also under Wine on the Mac:


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Fiendish   USA  (939 posts)  [Biography] bio   Global Moderator
Date Reply #3 on Fri 22 Jul 2011 01:46 AM (UTC)  quote  ]

Amended on Fri 22 Jul 2011 01:59 AM (UTC) by Fiendish

Message
Well, damn. I get this:
http://i.imgur.com/ifgIw.png

I'll try rooting around WINE for possible other issues :\

http://aardwolfclientpackage.googlecode.com/
https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

Posted by Fiendish   USA  (939 posts)  [Biography] bio   Global Moderator
Date Reply #4 on Mon 25 Jul 2011 07:18 PM (UTC)  quote  ]

Amended on Mon 25 Jul 2011 07:22 PM (UTC) by Fiendish

Message
Well it looks like there's something in one of the luajit updates that causes this (I bisected to http://repo.or.cz/w/luajit-2.0.git/commit/420124372b7643410a1cdd6f80b9cc8aa6ec1302), but it only breaks in Linux/WINE and not in Windows 7 for me. I'm going to write an email to Mike Pall about this. Nick, am I correct in thinking that the only relevant MUSHclient code here should be the creation of m_iDefaults in

static int multilistbox (lua_State *L)  {...}

in scripting/lua_utils.cpp?

I wish I had a way to build mushclient here so that I could properly track this down. :\

http://aardwolfclientpackage.googlecode.com/
https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

Posted by Nick Gammon   Australia  (19,180 posts)  [Biography] bio   Forum Administrator
Date Reply #5 on Mon 25 Jul 2011 10:03 PM (UTC)  quote  ]
Message
Yes that looks like the relevant code. Glancing over it again I can't see anything obviously wrong with it.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Fiendish   USA  (939 posts)  [Biography] bio   Global Moderator
Date Reply #6 on Mon 25 Jul 2011 11:38 PM (UTC)  quote  ]
Message
Yeah, me neither. Is it possible to make me a custom build that spits out the size/contents of msg.m_iDefaults after it's populated in that function?

http://aardwolfclientpackage.googlecode.com/
https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

Posted by Nick Gammon   Australia  (19,180 posts)  [Biography] bio   Forum Administrator
Date Reply #7 on Tue 26 Jul 2011 01:27 AM (UTC)  quote  ]
Message
Yeah OK, I emailed it to you. I got the number 7 from your test data, which is what I expect.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (19,180 posts)  [Biography] bio   Forum Administrator
Date Reply #8 on Tue 26 Jul 2011 01:42 AM (UTC)  quote  ]
Message
Looks like I can't email you files. I uploaded it and emailed you the link. I changed it to actually display the contents.

In case I want to do it again the source is:


  for (set<int>::const_iterator iter = msg.m_iDefaults.begin ();
       iter != msg.m_iDefaults.end ();
       iter++)
         {
          CKeyValuePair kv = msg.m_data [*iter];
          AfxMessageBox ((LPCTSTR) CFormat ("item %i of msg.m_iDefaults (key %s, value %s) exists", 
                         *iter, kv.sKey_.c_str (), kv.sValue_.c_str ()));
         }


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Fiendish   USA  (939 posts)  [Biography] bio   Global Moderator
Date Reply #9 on Tue 26 Jul 2011 02:45 AM (UTC)  quote  ]

Amended on Tue 26 Jul 2011 03:07 AM (UTC) by Fiendish

Message
Thanks, I got the email.
Findings,

items that exist with regular lua:
0 (a), 1 (c), 2 (b), 4 (d), 7 (i), 11 (m), 13 (n)

items that exist with luajit b8:
0 (i), 2 (n), 3 (m), 4 (c), 6 (b), 10 (d), 12 (a)

So they're all there, just in different order and different locations, which I guess matters somehow, because this does work for me:

Quote:

utils.multilistbox ("", "", {[1]="a", [2]="b", [3]="c", [4]="d", [5]="e", [6]="f", [7]="g", [8]="h", [9]="i", [10]="j", [11]="k", [12]="l", [13]="m", [14]="n"}, {[1]=true, [2]=true, [3]=true, [4]=true, [9]=true, [13]=true, [14]=true})


and produces
0,1,2,3,8,12,13 (a,b,c,d,i,m,n)

http://aardwolfclientpackage.googlecode.com/
https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

Posted by Nick Gammon   Australia  (19,180 posts)  [Biography] bio   Forum Administrator
Date Reply #10 on Tue 26 Jul 2011 04:31 AM (UTC)  quote  ]
Message
This would be confirmed by running this test:


for k, v in pairs {a="a", b="b", c="c", d="d", e="e", 
                   f="f", g="g", h="h", i="i", j="j", 
                   k="k", l="l", m="m", n="n"} do
  print (k, v)
end -- for


On normal Lua I get:


a a
c c
b b
e e
d d
g g
f f
i i
h h
k k
j j
m m
l l
n n


Using the "Aardwolf Lua" I get:


i i
f f
n n
m m
c c
g g
b b
l l
j j
k k
d d
h h
a a
e e


But unless there is a big blunder in my code, I don't see how the order of getting the keys matters.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (19,180 posts)  [Biography] bio   Forum Administrator
Date Reply #11 on Tue 26 Jul 2011 04:48 AM (UTC)  quote  ]
Message
Let me put it this way ... using the Aardwolf Lua, this screenshot shows that the keys are being fetched in the order you showed, but the listbox looks fine:


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Fiendish   USA  (939 posts)  [Biography] bio   Global Moderator
Date Reply #12 on Tue 26 Jul 2011 05:17 AM (UTC)  quote  ]

Amended on Tue 26 Jul 2011 06:10 AM (UTC) by Fiendish

Message
This problem from the ordering only happens to me under Wine, though. It doesn't seem to happen in Windows. Under Windows I get the same result as you do in that last screenshot. It's very weird to me that a system-dependent problem would manifest in this way, which is why I thought it was a luajit problem, but then the result of the lua segment is the same on both ends. :\

http://aardwolfclientpackage.googlecode.com/
https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

Posted by Fiendish   USA  (939 posts)  [Biography] bio   Global Moderator
Date Reply #13 on Tue 26 Jul 2011 06:36 AM (UTC)  quote  ]
Message
Maybe this is actually a Wine bug after all and it only gets tickled because of the order change in luajit? I don't know.

http://aardwolfclientpackage.googlecode.com/
https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

Posted by Nick Gammon   Australia  (19,180 posts)  [Biography] bio   Forum Administrator
Date Reply #14 on Tue 26 Jul 2011 06:46 AM (UTC)  quote  ]
Message
Fiendish said:

Well it looks like there's something in one of the luajit updates that causes this (I bisected to http://repo.or.cz/w/luajit-2.0.git/commit/420124372b7643410a1cdd6f80b9cc8aa6ec1302), but it only breaks in Linux/WINE and not in Windows 7 for me.


I am at a bit of a loss to explain this. If it failed on all platforms I would say you have a LuaJIT problem. If it always failed on Wine I would say Wine is not handling the multi list box properly. But your combination puzzles me.

Certainly I can believe that the hashing algorithm that hashes table entries might work differently under the JIT version than the normal version, but we have seen that the table sequence doesn't seem to directly affect the problem.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


5,581 views.

This is page 1, subject is 2 pages long: 1 2  [Next page]

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]