#bitfighter IRC Log

Index Search ←Prev date Next date→

IRC Log for 2013-06-23

Timestamps are in GMT/BST.

00:53:48Watusimoto has joined
01:07:25bobdaduck Quit (Remote host closed the connection)
05:39:25Watusimotofunny... I updated and got a whole log of recompiling...
05:40:07BFLogBot Commit: 57602b0acc91 | Author: watusimoto | Message: Found the path forward for ClientGame in our test rig. Needs further refinement, but we can now build tests using ClientGame.
05:40:09BFLogBot Commit: 81ca449a2591 | Author: watusimoto | Message: Merge
05:40:10BFLogBot Commit: 91e94874948a | Author: watusimoto | Message: Clean up our ClientGame-in-test solution a little
06:38:19ozbitfighter has joined
07:27:40BFLogBot Commit: 15a144f8e2ad | Author: watusimoto | Message: Comments
07:27:42BFLogBot Commit: a580ef1654e7 | Author: watusimoto | Message: Add assert that identifies source of our editor crash
07:27:43BFLogBot Commit: 861d2e0905c0 | Author: watusimoto | Message: Fix crash in editor. Not sure why this worked at all in Linux... but hey, it's a magical operating system!
07:27:45BFLogBot Commit: 88a6775c2bf3 | Author: watusimoto | Message: Rename kind of useless test, leaving a little nub in place to help guide the way for ClientGame testing
08:13:02Watusimoto Quit (Remote host closed the connection)
08:25:38ozbitfighter Quit (Quit: Page closed)
09:19:35Watusimoto has joined
09:42:20BFLogBot Commit: 2b1589fe0da8 | Author: watusimoto | Message: Totally unnecessary fix: manually delete menu items when we close a QuickMenu. This does have the advantage of reclaiming a tiny amount of memory that would otherwise be tied up in some useless menu items until the next menu was created.
09:42:22BFLogBot Commit: ac9c2d224618 | Author: watusimoto | Message: Whitespace
09:45:59BFLogBot Commit: 74b113ffea30 | Author: watusimoto | Message: Whitespace
09:51:44SolumnMushroom has joined
10:03:27Watusimoto Quit (Remote host closed the connection)
10:04:23BFLogBot Commit: 58323acd2cd7 | Author: watusimoto | Message: Show joystick control help when in joystick mode
10:26:27bobdaduck has joined
10:55:06Watusimoto has joined
11:33:25Watusimoto Quit (Ping timeout: 255 seconds)
12:07:08bobdaduck Quit (Remote host closed the connection)
12:15:11Watusimoto has joined
12:18:31raptor has joined
12:18:31ChanServ sets mode +o raptor
12:19:17raptorhello!
12:19:55raptorlet it me known that the editor crash (according to your assert) was not my code... :)
12:20:37raptorbut i'm sure my changes exacerbated the problem..
12:22:58raptorthere, i got my very intricate and important commit done for the day
12:23:49BFLogBot Commit: 780e24055199 | Author: buckyballreaction | Message: Spelling
12:35:53raptorWatusimoto: I know this is crazy, but the memory leak is still there, even after your changes...
12:38:30raptorhere are our current memory leaks (and 1 error - the invalid write - ignore this for now): http://pastie.org/pastes/8072733/text
12:41:38Watusimotohi
12:41:45raptorhi
12:42:13WatusimotoI don't think there is a memory leak
12:42:32Watusimotoat least not in the menuitems code
12:42:35raptorthat report is from valgrind i just ran on a clean compile of latest
12:42:58Watusimotoare you refering to the last section?
12:43:04Watusimotothe ToggleMenuItems
12:43:15raptorall three of the last that have LuaW in them
12:43:21Watusimotooh, there are teh CounterMenuItems as well
12:43:26raptorthe last 3 sections, i mean
12:43:36WatusimotoI only tested using the curve tool; is that sufficient to reproduce?
12:43:39raptori think one is a subclass of the other...
12:43:41raptoryes
12:43:47raptoreven jsut opening/closing the curve tool
12:43:47Watusimotook
12:43:59Watusimotoyes, that is enough to create the menu items
12:44:16raptorthat invalid write has something to do with LuaW... which I'm tracking down..
12:44:20Watusimotobut when I put a breakpoint in the CounterMenuitem destructor, I see them destructing just as I would expect
12:44:32raptormaybe more than one is being created?
12:44:59WatusimotoI have not done this, but I would assert that if you put a counter in during construction, and decremented it during desstruction, you would be at 0 after each menu close
12:45:23raptori can test that real fast...
12:45:55Watusimotogo for it. I have done it manually, so am confident of the result
12:46:04WatusimotoI did it a while ago, and again today
12:46:11Watusimotoboth before and after my code modifications
12:46:21Watusimotoand all those modifications changed was the timing
12:46:38Watusimoto(admittedly for the better)
12:47:13raptorputting the static counter in both constructors of CounterMenuItem
12:49:36raptorok, i have 11 constructor hits when i get to the editor...
12:49:48raptorrun plugin, up to 18
12:50:10raptorclose window... back to 11
12:50:23raptorhuh
12:51:19raptormaybe... it has something else to do with the plugin system?
12:55:50Watusimotoyeah, maybe
12:57:11raptorthat invalid write...
12:57:19raptorhmm
12:59:44raptormoral of the day - don't feed a brownie to a 1.8-year-old
13:03:45raptorhmm... the invalid write only happens when you 'undo' a created barrier with a plugin
13:03:55raptor(or loadoutzone)
13:18:28raptori keep thinking we should work to get rid of our proxies somehow
13:18:36raptorthen I keep finding evidence that they're needed..
13:22:13WatusimotoI don't think we can get rid fo them
13:26:37Watusimotothat valgrind item seems to clearly show that the item at issue is the ToggleMenuItem. It points to line 92, where the item is new'ed
13:28:01WatusimotoI don't see any way for the constructor iteself to be leaking
13:29:00raptornew clue: no matter how many different plugins i run, or how many times i open them, i get those same 3 blocks only on exit
13:29:09raptorin the valgrind report
13:29:24WatusimotoI remain unconvinced it's an actual leak
13:29:47raptorI'm starting to think that myself...
13:29:51kaenI remember some wonkiness with toggle items when I was writing those plugins
13:30:13Watusimototry it in release mode?
13:30:16kaenspecifically the game would crash when opening a plugin menu with a toggle item multiple times
13:30:46kaenbut that was before all of this lua work so I don't know if it's relevant anymore
13:30:47raptoroh yeah.. i remember that. in fact, didn't i fix that?
13:30:56kaenquite possible
13:31:07Watusimotofrom the valgrind docs
13:31:09WatusimotoWhen fixing errors, it is a good idea to start at the top; fixing an error that occurs earlier is likely to eliminate a lot of later errors as well.
13:31:09WatusimotoOnce in a great while you may encounter a false positive -- an error even though there is nothing wrong with your program. However, in the vast majority of cases, any error reported is real and you should fix it. Be very wary about dismissing an error as a "false positive," since it is much more likely that you have made a mistake.
13:32:42Watusimotosince we aer seeing reports in a number of different menu items, the problem (if it exists) is probably with a common anscestor
13:33:15raptorso if i discover a bool has value of '48', something is wrong?
13:34:11raptorthat invalid write is occurring like so: 1. run plugin 2. undo wall created 3. shutdown
13:34:40raptorand on undo, the wall is removed from the database (and destructor hit), but on shutdown, it is being hit again
13:34:47raptoranyone have an idea as to why?
13:36:53Watusimotowhere do you get the 48?
13:36:58Watusimotothat's clearly a bug
13:37:02Watusimotoit should be 42
13:39:42raptorha
13:40:04raptorthe WallItem (or LoadoutZone, whatever) is destructing twice
13:40:21raptoronce with the 'undo' after plugin run, once when closing the game
13:46:29raptorthere is a bug somewhere between these two traces: http://pastie.org/pastes/8072867/text
13:46:38raptorthe destructor should only be called once, right?
13:53:02raptoroops, i meant these: http://pastie.org/pastes/8072884/text
13:56:37raptorWatusimoto: in UIEditor.cpp:169, do you know why this boost::dynamic_pointer_cast class was used?: mEditorDatabase = boost::dynamic_pointer_cast<GridDatabase>(database);
13:57:42Watusimotono, I don't know
13:58:03raptorbecause that line is calling the destructor for the objects..
13:59:11raptorwhihc makes sense, but there is still a pointer to the object when we close the editor
14:02:47raptorwe have multiple GridDatabases with the undo system, each wrapped in a shared_ptr.. ohhhh
14:02:59WatusimotoI can't even find any docs about what dynamic_pointer_cast is suppsed to do
14:03:09Watusimotoyes
14:03:13raptorthe GridDatabases themselves hold pointers to objects, yes?
14:03:15Watusimotoit was a very lazy way to do undo
14:03:21Watusimotoyes
14:03:41raptorwhat happens if two GridDB hold the same pointer to an object? and they both are destructed?
14:03:54WatusimotoI do have a design for a much more compact and efficient undo system
14:04:02Watusimotothey don't
14:04:12Watusimotothey hold pointers to copies of objects
14:04:21raptorwell... in this case they don't
14:04:21Watusimotowhen you copy a database, everything inside gets copied as well
14:04:25raptorheh
14:04:28raptornot happening!
14:04:41Watusimotono?
14:04:46raptorthe *exact* same object is being deleted from two databases
14:05:10Watusimotowell, that could be a problem
14:05:54raptoryes - granted the second delete is only happening when we shut down
14:06:37raptorwere is this database copy supposedly happening?
14:08:32Watusimotoprobably in the undo sectino of the editor
14:08:44Watusimotothat's the only reason we copy databases, to give us an undo capacity
14:09:08raptoroh interesting... i just got the menu item leaks without running a plugin
14:10:23raptortwinkies are coming back!
14:16:52raptori think menu items are leaking when running plugin.runGetArgsMenu to fill up kaen's plugin dock
14:21:02raptormaybe it's a bad plugin of mine?
14:23:17Watusimotoplugins shouldn't be able to be bad... unless they create a menu item they never add to a menu
14:23:24Watusimotoin which case... naughty!
14:23:37raptoryes... i just checked that and all of mine are added in a menu..
14:23:54Watusimototry removing all your plugins and see if that fixes the problem
14:24:38raptori'm bisecting it
14:24:40raptorha
14:24:41raptorok
14:24:43raptorso
14:24:58raptorany menuitem you instantiate in a plugin
14:25:09raptorleave behind *one* of its kind as a leak
14:25:26raptorso if i have 2 plugins, each with 5 ToggleMenuItems
14:25:32raptorone TMI is leaking
14:26:08raptorbut if I have 5,4,3, of Toggle, Counter, YesNo; it leaves behind 1 of each as a leak
14:26:17raptoracross all scripts
14:27:08Watusimotooff-by-one bug?
14:27:33raptorperhaps... looking deeper - all these are being called in EditorUserInterface::findPlugins()
14:27:35Watusimotoor maybe it creates an extra item somehow that never gets added anywhere?
14:27:42raptorthat could be, too..
14:29:09raptoruh oh... we're using a Vector<MenuItem*> menu;
14:29:47raptorlet me convert that to a shared_ptr...
14:29:56Watusimotoah, maybe that's it
14:30:07Watusimotogood catch -- I read right past that
14:31:02raptoryep.. i see it being created, but not cleaned up..
14:32:39raptorah... ok, when a plugin is run, it is actually added to a menu which keeps track of them with a shared_ptr
14:33:10raptorbut on start up, when the plugin is run to grab information, the menuitems are not added anywhere...
14:33:58Watusimotoah, interesting
14:34:05Watusimotoso those ones are never cleaned up
14:34:10raptorcorrect
14:34:17Watusimotomaybe create them as shared_ptrs from the outset?
14:34:47raptori'm thinking that, too
14:35:02Watusimotowe might as well... then we don't need to worry about them
14:45:58raptoris there a difference between shared_ptr<MenuItem*> and shared_ptr<MenuItem> ?
14:46:05raptori mean at the implementation level?
14:46:29Watusimoto Quit (Read error: Connection reset by peer)
14:48:09Watusimoto has joined
14:50:35raptortesting fix..
14:51:52raptorladies and gentlemen, the leak is fixed!
14:55:00BFLogBot Commit: c86f18f1d2c0 | Author: buckyballreaction | Message: Fix memory leak with editor plugin menus when being scanned for inclusion into the plugin dock
15:01:54Watusimotoexcellent!!
15:05:58raptorok
15:06:13raptorthe invalid write only occurs if undoing from a plugin created item
15:12:44raptorprobably an issue with copying from mLevelGenDatabase
15:25:53raptorWatusimoto: anything in here seem odd to you that would indicate a double addition to databases in this methog?: void EditorUserInterface::copyScriptItemsToEditor()
15:26:04raptorI'm asking because I'm not sure (not because I think there is..)
15:26:18raptor*method
15:27:28Watusimotothe only real possibility is the saveUndoState line
15:29:07raptor Quit ()
15:29:17raptor has joined
15:29:18ChanServ sets mode +o raptor
15:29:30raptoras in, you think it is unneeded?
15:30:39WatusimotoI think it's needed, but it's the only place I can see extra objects being creaetd
15:30:59raptoroh.. maybe I move it below the loop..
15:31:11raptorno, that would be bad..
15:32:00Watusimotocomment out the saveUndoState and see if that fixes things
15:32:10raptorok
15:32:48Watusimotobut actually, if it doesn't cause a problem elsewhere, it won't here, either
15:33:26raptorstill invalid write..
15:33:40raptoroh
15:33:42raptorwhat about
15:33:45raptorhmm
15:33:46Watusimotoso no, actually, I don't see anything in this method
15:34:03raptorwe're adding the object to the editor database in addToEditor()
15:34:04Watusimotobut I could be missing something
15:34:10Watusimotoyes
15:34:21raptorbut we call the mLevelGenDatabase.removeEverythingFromDatabase()
15:34:31Watusimotoyes
15:34:47Watusimotowe're moving objects from the lvelgen database to the main editor database
15:34:54raptorbut that does delete the items from the GridDB despite the comment...
15:35:51raptorhuh.. but it seems to work..
15:36:30Watusimotoas in mAllObjects.deleteAndClear();
15:37:14raptorfor whatever reason the line on UIEditor.cpp:169 triggers the object clean-up
15:39:00Watusimotowell... this should be a problem... we add an object to the main database, then delete it
15:40:06Watusimotoso what does boost::dynamic_pointer_cast do?
15:40:09Watusimotodo you know?
15:40:15raptorit basically just calls dynamic_cast
15:40:20raptorin a platform-agnostic way...
15:41:27Watusimotowell, now I'm confused about how that code could work
15:42:33raptorthis has the best info about dynamic_pointer_cast I could find: http://stackoverflow.com/questions/9391863/difference-between-shared-dynamic-cast-and-dynamic-pointer-cast
15:43:00raptorif only the docs could provide info like that..
15:44:28raptoris it not a real copy from the levelgen database to the editor database?
15:49:16Watusimotowhere do you see the copy happening?
15:49:51raptoractually it's not a copy... just making the object point to the new database?
15:50:10raptorin that copyScriptItemsToEditor...
15:50:45WatusimotoI think so
15:50:46Watusimotoyes
15:52:23raptorok, i think that mehtod is working OK...
15:53:38raptorso I'm now in undo(), right before the setDatabase call that makes the single WallItem (created from the lua script) destruct
15:57:54raptorI have one WallItem in the current mEditorDatabase
15:58:13raptornothing in the mUndoItem[1] database that is going to be set..
16:03:47raptorWatusimoto: I think the undo system is working fine...
16:04:41Watusimotothat's good, I think :-)
16:05:30raptorok yes, it's working as expected
16:05:37raptori think... hmmm
16:05:58raptorthere's a pointer to the WallItem in some other object that is left around..
16:09:59raptori have an idea!
16:46:43raptori mistakenly thought that items created via plugins were added to the mLevelgenDatabase
16:47:03raptorand since they are not, that means they are added elsewhere..
16:47:13raptornow to determine this 'elsewhere'
17:00:04raptorfound it lurking in mUndoItems
17:05:25Watusimoto???
17:05:28Watusimotoreally??
17:05:41raptoractually.. give em a few... i'm onto something
17:05:49raptori think the duplicate objects are sharing proxies
17:07:23Watusimotoreally??
17:08:27WatusimotoI'm slipping off to sleep... trying to hang on...
17:11:19BFLogBot Commit: 463d7c7f05bf | Author: watusimoto | Message: Improvements to inline help system
17:11:20BFLogBot Commit: 800c4b048092 | Author: watusimoto | Message: Merge
17:23:31raptorhi
17:23:35raptorsorry had dinner
17:24:04raptoryou can go to sleep, but yes, the copied objects in the undo databases share the same LuaW proxy
17:45:03raptori'm not sure how to resolve that..
17:56:38raptorso it looks like cloning will keep the same memory address
17:57:05raptorso mLuaProxy will point to the same proxy when saving an undo state
17:57:12raptoris there a way to prevent this?
17:57:54raptoror some other model of how to handle?
18:08:46Watusimotowe'll have to discuss tomorrow
18:08:49Watusimotowhen I can think
18:08:53raptorhi
18:08:54raptorok
18:08:57raptorto bed!
18:08:58Watusimotosorry!
18:09:01Watusimototo bed!
18:09:05Watusimotoand beyond!
18:09:10raptornight
18:13:07raptori'm deep into learning the scary inner workings of c++ again... I do not wish to be here
18:13:47Watusimoto Quit (Ping timeout: 256 seconds)
18:16:08raptor'dangling pointer' <-- that's the term
18:17:44raptorlooks the the solution is to create a deep-copy copy constructor for each item OR use a smart pointer
18:18:17raptoror even just reference counting..
18:39:39bobdaduck has joined
18:42:31raptorok, well, i'm not getting anywhere else on this tonight...
19:04:24bobdaduck Quit (Remote host closed the connection)
21:54:12Nothing_Much Quit (Quit: l8r)
23:16:19SolumnMushroom Quit (Ping timeout: 255 seconds)
23:21:52raptor Quit ()

Index Search ←Prev date Next date→

These logs were automatically created by BFLogBot on irc.freenode.net.