#bitfighter IRC Log

Index Search ←Prev date Next date→

IRC Log for 2012-11-24

Timestamps are in GMT/BST.

01:03:02raptorhi
01:03:04raptornothing new
01:03:09raptorwatusimoto, where are you?
01:14:13sam686hi
01:23:16raptorhi
01:23:24sam686hi
01:29:39raptorsam686: did you see my e-mail about the memory leaks?
01:29:51raptorit may help with the cause of the crash...
01:50:59sam686how does it crash now? I can't get it to crash on me as of the newest pushed changes..
01:55:49sam686Found a bug, using my map gen 6357 Capture, loaded in editor, press ctrl+R several times, then test level in editor produces junk forcefields that you go through them
02:56:37raptorwatusimoto says it still crashes for him, i can't duplicate in Linux..
02:57:10BFLogBot Commit: 1a164ac464d2 | Author: sam8641 | Message: Check if bitfighter.ini already exists locally and can be modified.
02:59:17sam686I can't seem to crash at all, the one thing I found is a non-crashing problem with ctrl+r adding buggy forcefield in "test level"
03:00:16sam686could be 2 things why wasusimoto is still crashing: unpushed changes, or forgot to update to latest changes..
03:01:24sam686or a third thing: we don't know how to crash
03:05:38sam686I think I see the memory leak, by adding thousands of loadout zones or goals, and repeatedly rotating them (hold down or keep pressing R), memory usage slowly climbs.
03:06:00raptor Quit (Ping timeout: 244 seconds)
03:08:30sam686broken F7's input strings pressing multiple buttons?
03:31:37raptor has joined
03:31:37ChanServ sets mode +o raptor
04:09:31raptorhi again sam686
04:09:36raptorwhat about f7?
04:09:49raptorwith joystick?
04:10:23raptorhaha
04:10:32raptorthey're all the same!
04:13:54BFLogBot Commit: a610c5ad8358 | Author: buckyballreaction | Message: Remove now-unneeded #define
04:18:54raptorok, well, there is a real memory leak with the walls (see my e-mail attachement); stuff is being allocated with 'new' but not released
04:19:00raptorbut i'm going to bed
04:19:03raptorgood night!
04:19:04koda Quit (Quit: you can't say 'hello' without saying 'hell')
04:21:52raptor Quit ()
06:05:59amgine123 Quit (Quit: Page closed)
06:31:05CrazyLinuxNerd Quit (Quit: Leaving)
06:31:24CrazyLinuxNerd has joined
06:38:19amgine1234567890 has joined
06:38:27amgine1234567890sam?
06:38:40amgine1234567890 Quit (Client Quit)
07:10:11Watusimoto has joined
07:51:59CrazyLinuxNerd Quit (Remote host closed the connection)
07:52:18CrazyLinuxNerd has joined
08:02:01Watusimoto Quit (Ping timeout: 252 seconds)
09:03:41Watusimoto has joined
11:07:54LordDVG has joined
13:01:15Wuzzy has joined
13:46:47raptor has joined
13:46:47ChanServ sets mode +o raptor
13:49:20raptorgood morning
14:14:38Watusimotohi
14:15:02WatusimotoI checked out the memory leaks you sent, and I don;t think they are real
14:15:12Watusimotoat least not the ones related to walls
14:18:59raptorreally?
14:19:17raptorbecause i don't ever remember seeing them in previous valgrind reports
14:27:42raptori'm not very good at solving memory leak problems, admittedly..
14:29:15Watusimotowell, take wallEdges, for example
14:29:31Watusimotooh heck, here are my notes
14:29:35Watusimoto ==16327== 9,936 bytes in 138 blocks are definitely lost in loss record 380 of 383
14:29:35Watusimoto ==16327== at 0x4C2A6E7: operator new(unsigned long) (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
14:29:35Watusimoto ==16327== by 0x6AE86B: Zap::WallSegmentManager::rebuildEdges() (WallSegmentManager.cpp:170)
14:29:35Watusimoto ==16327== by 0x6AE7AA: Zap::WallSegmentManager::recomputeAllWallGeometry(Zap::GridDatabase*) (WallSegmentManager.cpp:146)
14:29:35Watusimoto ==16327== by 0x45F148: Zap::EditorUserInterface::rebuildEverything(Zap::GridDatabase*) (UIEditor.cpp:455)
14:29:37Watusimoto ==16327== by 0x45EDEB: Zap::EditorUserInterface::undo(bool) (UIEditor.cpp:383)
14:29:39Watusimoto ==16327== by 0x46BA7D: Zap::EditorUserInterface::onKeyDown(Zap::InputCode) (UIEditor.cpp:3789)
14:29:41Watusimoto ==16327== by 0x420BD6: Zap::Event::inputCodeDown(Zap::UserInterface*, Zap::InputCode) (Event.cpp:156)
14:29:43Watusimoto ==16327== by 0x4210E2: Zap::Event::onKeyDown(Zap::ClientGame*, SDL_Event*) (Event.cpp:352)
14:29:46Watusimoto ==16327== by 0x420C51: Zap::Event::onEvent(Zap::ClientGame*, SDL_Event*) (Event.cpp:170)
14:29:48Watusimoto ==16327== by 0x61AF53: Zap::idle() (main.cpp:658)
14:29:50Watusimoto ==16327== by 0x61AFD6: Zap::dedicatedServerLoop() (main.cpp:680)
14:29:52Watusimoto ==16327== by 0x61D00A: main (main.cpp:1437)
14:29:54Watusimoto This "new" refers to a new WallEdge, which is immdiately added to a database after it has been created. All objects
14:29:57Watusimoto in databases are properly deleted when the database is deleted (if not before), and all databases are properly deleted when the program is shutdown. Therefore, I do not believe that this memory leak is real.
14:30:01Watusimotothe top bit is the stack trace, the bottom is my analysis
14:30:19Watusimotosimilar analysis can be done for wallSegments, which are the other reported memory leak
14:30:53raptorhmm
14:31:08raptorso are they deleted when exiting the editor?
14:31:20raptoror just upon program exit?
14:31:29Watusimotoa bit of both
14:31:59Watusimotosome critical cleanup happens as part of editorUserInterface destruction
14:32:04Watusimotowhich happens at program exit
14:32:37WatusimotoI can guarantee that each instance of new with a wallSegment or WallEdge gets inserted in a database
14:33:35Watusimotowell... hold on a sec
14:33:43raptorhttp://valgrind.org/docs/manual/mc-manual.html#mc-manual.leaks
14:34:00raptor"This means that no pointer to the block can be found. The block is classified as "lost", because the programmer could not possibly have freed it at program exit, since no pointer to it exists"
14:34:11raptorunder "definitely lost"
14:34:14WatusimotoThere is this one little statement int he editor I may have overlooked
14:34:16WatusimotoGridDatabase *newDB = new GridDatabase();
14:34:29Watusimotoit may be possible that a database created here is never deleted
14:34:44Watusimotowhich would result in objects contained therein to be never deleted
14:35:13Watusimotoah, but no
14:35:15WatusimotoGridDatabase *newDB = new GridDatabase(); // Make a copy
14:35:15Watusimoto newDB->copyObjects(getDatabase());
14:35:15Watusimoto mUndoItems[mLastUndoIndex % UNDO_STATES] = boost::shared_ptr<GridDatabase>(newDB);
14:35:20Watusimotoit is handed over to boos
14:35:21Watusimotot
14:40:33raptori wish i could get it to crash...
14:42:50raptorthere were 383 loss records in the report
14:52:28raptoroh look, found a leak in my code..
14:53:23Watusimoto:-)
14:53:33Watusimotothere are lots of small leaks, some of which we can fix, many not
14:53:59raptorloads in the sound libraries... none of which we really have control over
14:55:40BFLogBot Commit: 12dd575544d3 | Author: buckyballreaction | Message: Fix small memory leak in Linux
14:58:08raptorlook at record 260
14:58:43raptor(and 261)
15:01:22WatusimotoMy notes on those:
15:01:24WatusimotoThis "new" refers to a new WallSegment, which is added to a database during construction. All objects
15:01:24Watusimoto in databases are properly deleted when the database is deleted (if not before), and all databases are properly deleted when the program is shutdown. Therefore, I do not believe that this memory leak is real.
15:02:01raptorwell, according to valgrind's "definitely lost" definition, it seems to me that they are not properly deleted
15:02:51raptorbesides, i don't see where that 'WallSegment *newSegment' is actually added to anything that is deleted
15:02:57WatusimotoWhen I started looking for the error I'm still hunting, I logged every create and delete of wall segments and wall edges... all were accounted for
15:03:19WatusimotowallSegment is added to a database in the constructor... see the initialize() function
15:04:22raptorah ok, i see it
15:04:37raptorso i believe you, but i also believe valgrind...
15:05:08Watusimotoyes
15:05:11WatusimotoI understand
15:05:23Watusimotoone possibility is that a database isn't being deleted
15:05:54Watusimoto+but like I said... creates and deletes were balanced
15:06:17raptorvalgrind keeps a database of every memory block, and for it to be considered 'definitely lost' it means that no pointer to the memory block exists at program exit
15:08:20raptorbut we may be chasing a wild good anyways...
15:08:23raptor*goose
15:08:27raptorgood goose
15:08:35raptorsick of turkey..
15:13:21Watusimotoyes... but if I create 10 objects and delete 10, where is the leak?
15:13:30Watusimotoit's easy to test
15:13:54Watusimotocreate a static counter, increment on create, decrement on delete, and logprintf on every delete
15:14:47raptordo you have notes on records 274/275?
15:15:46Watusimotono
15:15:55Watusimotobut that one led me on a wild goose chase
15:16:40Watusimotothough not directly related to the report at hand
15:19:19raptorha!
15:19:25raptori did the static counter
15:19:52raptorWatusimoto: http://pastie.org/5427858
15:19:57Watusimotouh oh
15:20:05raptori loaded a level with a U-shaped wall
15:20:06Watusimotodon't need a pastie to reoprt everything is fine
15:20:27raptori put it in the constructor and destructor of WallEdge
15:20:55Watusimoto42?!?
15:20:59Watusimotothat sounds familliar
15:21:05raptorafter levwel load, i resized 5x, undo, redo, undo, redo
15:21:15raptormaybe undo,redo 2 or 3 times more..
15:21:18raptorthen exited
15:22:40Watusimotook, only one constructor and destructor...
15:27:48raptori feel your disbelief... i think
15:28:46Watusimotook, well my guess is that a database isn't being deleted
15:28:57Watusimotocould you try the same thing with the databases?
15:28:57raptormaybe a problem is gridDB.cpp:689
15:29:10raptorthere's an if statement there
15:29:21raptorit should probably do a delete in an else block?
15:29:22Watusimotovoid DatabaseObject::addToDatabase(GridDatabase *database) ??
15:29:37raptorwhat happens when the if statement fails?
15:29:38Watusimotono I don't think so
15:29:55Watusimotoitem is not added to database
15:30:03Watusimotobut what is not databasable/
15:30:04Watusimoto>
15:30:06Watusimoto?
15:30:08Watusimotothere we go!
15:30:18Watusimotomostly things like gameTypes and the like
15:30:29Watusimotoif we delete those... well kapow!
15:30:57raptoryes, i see your point
15:31:14raptorok, counter in databases...
15:31:24raptorwhere would i put that?
15:32:32raptorhmm, already a counter in the constructor/destructor...
15:32:38raptormaybe i'll just logprint that..
15:34:31raptorWatusimoto: results: http://pastie.org/5427912
15:35:15Watusimotook, well, there is our problem
15:35:32Watusimotodo the databases have any sort of unique id we could print? figure out which are not being deleted?
15:35:39raptorhmmm
15:35:45Watusimoto17 databases?!??!?
15:35:58Watusimotowhen I started on bf, there was just 1
15:36:02raptoryeah, so i put the logprint in the destructor
15:36:06raptorthen
15:36:10raptori loaded the level
15:36:12raptorno print yet
15:36:19raptori did one resize, no print
15:36:27raptorundo: it printed 17, 16, 15
15:36:53raptorthen it didn't print any more no matter how may redo / undos i did
15:37:10raptorthen it printed 14... 3 when i exited the game (not the editor)
15:37:32Watusimotook, well it's somthing to look into, but not really a serious problem, probably
15:38:03Watusimotomeanwhile, I may have fixed the crash
15:38:09Watusimotobut only via bad means
15:38:14Watusimotobut maybe its a clue
15:41:47Watusimotook, for my next test, I probably need to get the database issue sorted
15:41:55Watusimotoare you doing anything on that at the moment?
15:48:32raptori'm trying to print a runtime stacktrace of each database construction..
15:49:23Watusimotook, I'm trying a different approach
15:49:42WatusimotoI've assiegned each a unique id, so we can see which don't get destructed
15:49:49raptorahh...
15:54:04Watusimotofirst and second created are never deleted
15:54:14Watusimotoso which are those?
15:55:13raptorheh
15:58:35Watusimotofirst 3, actually
15:58:50Watusimoto mWallSegmentDatabase = new GridDatabase(false);
15:58:50Watusimoto mWallEdgeDatabase = new GridDatabase(false);
15:58:53Watusimotothose are two
15:59:06Watusimotoeven though I see them deleted down below
15:59:57Watusimotoand this oen
15:59:58Watusimotostatic GridDatabase mBotZoneDatabase;
16:00:09Watusimotowhich should be deleted automatically, as it is a reference
16:01:24Watusimotoodd
16:01:41Watusimotodelete mWallSegmentDatabase; gets called, but I can't step into it, and it looks like th destructor isn't being run
16:05:42raptorha! it works!
16:05:45raptorwant traces?
16:06:55Watusimotoah, ok
16:07:00WatusimotoI got it figured out
16:07:04Watusimotosorry :-)
16:07:16raptorrats
16:07:17Watusimotook, so it's the mBotZoneDatabase
16:07:57Watusimotothe constructor in there creates a wallsegmentmanager, which creates two further databases
16:08:12Watusimotosince mBotZoneDatabase isn't being deleted, neither are its children
16:08:20Watusimotoso this is an utter non-issue
16:08:30Watusimotoas the lifetime of that object is an entire game
16:08:43raptorok,
16:09:06raptorif you've fixed it, i can run another valgrind against it just to compare
16:09:10Watusimotothe only question is... why or how are edges/segments getting in that database
16:09:25Watusimototechnically, I'm not sure it needs fiixing, but I probably should anyway
16:09:37Watusimotoas it's rathr easy
16:14:47raptorplease do :)
16:18:13Watusimotook, I've added a slightly klunky pair of methods to create and delete the database from the game init code
16:18:19Watusimotojust testing to make sure it works
16:18:26Watusimotothen I'll check in for a valgrind run
16:18:29raptorok
16:26:18koda has joined
16:26:56kodalo
16:28:25raptorhi
16:28:36kodahi raptor
16:28:57raptorWatusimoto: Linux and Mac packaging changes are pretty much complete as of yesterday
16:29:00kodahey Watusimoto in the did you submit any gci task?
16:29:38Watusimotoah... no I didn't
16:30:06WatusimotoI asked Arc about it, and didn;t get a response, then I left for my trip
16:30:13Watusimotoand it completely dropped from my mind
16:30:25kodaack
16:30:36kodawell you are still on time if you like
16:30:44Watusimotoso I do have a probably good task, which would be easy enough to write up
16:31:27koda nods
16:32:07sam686I hate abbreviation, searching for GCI only gives be several things completely different.
16:33:31Watusimotohi sam686
16:35:49raptorhi sam686
16:37:06sam686Thousands of memory leaks: http://sam6.25u.com/upload/bitfighter_visual_leak_detector.log
16:38:39raptorthat log is huge!
16:39:03Watusimotook, made the database be deleted
16:40:15raptori can run valgrind as soon as you push..
16:41:48Watusimotomergng
16:42:35BFLogBot Commit: 44a2aced3cc5 | Author: watusimoto | Message: Test build, with all sorts of debugging code include. Checking in so raptor can test again with valgrind.
16:42:37BFLogBot Commit: a6286b687e71 | Author: watusimoto | Message: Merge
16:43:46Watusimotook, turning this machine over to the kids for a bit
16:43:48Watusimotoback later
16:44:11Watusimotobtw, this build does not crash
16:44:25WatusimotoI'd be very interested to see if my fix makes it leak
16:44:29Watusimotoas I suspect it will
16:44:43Watusimotobut if not, that will be an important clue, alsmost certainly signifying a double delete
16:45:06Watusimotoin fact, if you still have your edge/segment counting code in, it would be great if you wuold test with that again, too.
16:45:08Watusimotook, back later
16:46:18raptorokey ok
16:46:25raptori'll do it all
16:54:41BFLogBot Commit: 53376128be15 | Author: buckyballreaction | Message: Add dummy checkHeap() to TNL for Linux/Mac
16:58:39raptorWatusimoto: new leak check: http://sam6.25u.com/upload/memcheck-018-after-database-cleanup.log.zip
16:58:48raptornow for the segment counting...
17:03:06raptorWatusimoto: interesting output: http://pastie.org/5428226
17:03:16raptormy counter went back to zero, which is good
17:03:24raptornot sure how to interpret your debug stuff..
17:22:49BFLogBot Commit: 86ef0c69975c | Author: buckyballreaction | Message: Initialize some buffers to quiet valgrind
17:41:18BFLogBot Commit: 629da5af033c | Author: buckyballreaction | Message: Fix another memory leak. Go valgrind!
17:53:51raptorhere's the latest after my latest commits: http://sam6.25u.com/upload/memcheck-018-after-more-cleanup.log.zip
17:57:16raptorThere are a few other SDL leaks that are specific to SDL 1.2 - so I'm going to ignore them..
17:58:44Watusimoto Quit (Ping timeout: 264 seconds)
18:06:45BFLogBot Commit: 518f029e0f41 | Author: buckyballreaction | Message: Allow a '.standalone' file in the installed data directory specify that it is a standalone installation
18:41:27BFLogBot Commit: 759a78fe7e86 | Author: buckyballreaction | Message: Determine executable directory on each platform and change to that instead upon program launch. Should aid with detecting standalone a little better.
18:48:46BFLogBot Commit: 2025a1b175f0 | Author: buckyballreaction | Message: Forgot the Xcode pieces...
19:00:50Watusimoto has joined
19:07:54Watusimotook, reviewd the valgrind stuff
19:08:00raptorlooks much better
19:08:09Watusimotolooks like we're in the clear memory leak wise
19:08:14raptoryes
19:08:21Watusimotoso now I ned to figure out why there isn;t a leak
19:08:28Watusimotoas I expected there to be one
19:08:42Watusimotounless we were doing a double delete
19:08:47Watusimotoand I just removed one of them
19:08:57Watusimotothanks for valgrinding away!
19:08:59raptorsure
19:09:13raptoractually i'm glad i did - made me more confident in memory debugging
19:09:15Watusimotoso what I was printing was the id of each database as it was deleted
19:09:20raptorok
19:09:32Watusimotoso no gaps in the numbering suggests all being deleted
19:20:26raptorso did you basically revert the construction adding/removing?
19:20:45raptorback to the old method of manually calling it afterwards, it looks like
19:22:51Watusimotowhat do you mean by the the construction adding/removing?
19:22:59Watusimotoyou mean adding to the db during construction?
19:23:17WatusimotoI did that for wallEdges, at least, because I thought it was clearer what was happening
19:23:38Watusimotofor wallSegements, it would have produced a bit of repeated code, so I added comments instead
19:24:43Watusimotoodd
19:25:01WatusimotoI put a breakpoint in WallSegment::~WallSegment() and it never got called
19:25:08Watusimotovery odd
19:25:13Watusimotobut no memory leaks
19:25:23raptoroh, i didn't do wallsegments in my counter - just the edges...
19:25:41Watusimotosegments are the problem, I think
19:26:04Watusimotosearch for this:
19:26:05Watusimotofor(U32 i = 0; i < mAllObjects.size(); i++) // Always crashes with type number 32, WallSegment
19:26:17Watusimotoin gridDb line 181
19:26:36Watusimotoyou'll see the crapola I used to fix the crash
19:26:42WatusimotoI added the if(xxx) bit
19:26:47Watusimotoand voila... no more crash
19:27:49Watusimotoso I just started the editor, added a U shaped wall, then quit
19:28:00Watusimoto3 wall segments were creaetd, destructor was never called
19:28:36Watusimotobut why didn;t you see a memory leak? oh, probably because the memory wasn;t lost; it could have been deleted at any time
19:28:43Watusimotono, that;s not true
19:28:49Watusimotothere was a memory leak
19:28:51raptorok, my counter in the destructor never got called..
19:29:09Watusimotoin gridDb, mAllObjects.clear(); is called for segments
19:29:25Watusimotoso the pointers are erased, but the objects themselves are never deleted
19:29:27Watusimotowtf?
19:29:36Watusimotoyou should haev seen memory leaks!
19:29:46raptorthat's weird...
19:29:49raptorwait
19:29:50Watusimotovery
19:29:59raptormaybe that last report i didn't open up the editor...
19:30:03raptorlet me redo it
19:30:11Watusimotobut when I delete those objects, I get a crash from funky memory issues
19:30:24Watusimotocreate a wall then exit
19:31:38raptorthat's all you want me to do?
19:32:39Watusimotodo at least that
19:33:55Watusimotobrb
19:35:26raptorok Watusimoto, found a leak: http://sam6.25u.com/upload/memcheck-018-wallsegment-hunt.log.zip
19:35:53raptori added a barrier, then resized everything, undo, redo, etc... , quit
19:41:59sam686Looks like there is some memory leaks of DatabaseObject with type 32 (WallSegmentTypeNumber)
19:44:25sam686http://sam6.25u.com/upload/visual_leak_editor_create_a_wall_then_exit2.txt - What I did is add a "TYPE" char[4] right before the type number, to easily identify some memory contents..
19:45:56sam686oh and one memory leak of type 30 (hex 0x1E) (WallItemTypeNumber)?
19:51:24raptorWatusimoto is working on it...
19:52:43WatusimotoI'm really trying to work on the memory corruption issue
19:53:45raptorwhat i think: if we're going to add stuff to the database from a constructor and delete it elsewhere, then if there is any if statement in the flow of adding it to the database, it should be properly cleaned up somehow
19:53:57sam686does the memory corruption happen on non-debug compile too?
19:55:32raptorbecause when calling addToDatabase in WallSegment::init() we hit a number of if statements: if(mDatabase) return;
19:55:38raptorif(isDatabasable())
19:56:03raptorif a new WallSegment is called, but mDatabase is NULL... memory leak!
20:02:18sam686you know what? there is removeEverythingFromDatabase that DELETES objects, but there is also an individual removeFromDatabase that does not delete objects ... that may be part of memory leak
20:05:04sam686before revision c000c91e9e3b, it was mostly fine, now it seem to delete when it shouldn't or don't delete when it should..
20:10:39sam686How about just don't delete from inside the "removeEverthingFromDatabase", but elsewhere? Client side of ghostable objects auto delete already..
20:13:20Watusimotosam, the question is where should those items be deleted? I can;t see how there is a double delete going on, and I can;t see what else would cause the current problems
20:15:23Watusimotook, well at least valgrind is more understandable now
20:15:29Watusimotoloss record 233 of 343 is what I expected
20:15:38raptorWatusimoto: WallSegmentManager.cpp:242
20:15:50raptorthat new WallSegment
20:15:56Watusimotoyes
20:16:02raptorhave you tried tracking to see if they actually get added to a database?
20:16:25WatusimotoI'm pretty sure it does, but I haven;t done that; I can
20:19:00Watusimotoit does
20:19:03Watusimotoconfirmed
20:21:15raptorhmm
20:21:20raptorwell, now i'm out of ideas
20:23:02Watusimotothat's where I was last weekend ;-(
20:24:00Watusimotomy best theory is that there is something interacting with clipper
20:24:06raptorbut hte crash is gone?
20:24:17Watusimotoyes, and the memory leak is in its place
20:24:37WatusimotoI think that clipper and something might be sharing a chunk of memory
20:24:54sam686I stuck in a RtfPtr<GridDatabase> mDatabase in DatabaseObject, now I an getting "Object deleted with non-zero reference count"
20:25:01Watusimotomaybe a point is added somehow via pointer instead of via reference (and hence a copy)
20:25:50sam686let me try SafePtr instead..
20:25:57raptorlooks like all clipper stuff was moved to GeomUtils
20:25:59Watusimotobecause when I traced it earlier, it looked like it was dying on clearing a vector of points
20:27:41raptormergePolys(const Vector<const Vector<Point> *> &inputPolygons
20:27:43raptoryuk
20:28:17WatusimotoI moved as much stuff as I could out of barrier to try to make it clearer what was going on. a lot ended up in mergePolys
20:28:29Watusimotosorry... in geomutils
20:30:44raptorwell, it looks like all the inputPolygons are passing through upscaleClipperPoints first
20:30:51raptorand everything is copied...
20:31:47Watusimotonow I think that theory is wrong
20:32:02Watusimotoargh!!
20:32:44raptorhow did you verify that every wallsegment was being added to a database?
20:35:33Watusimotoit happens in the constructor
20:35:38WatusimotoI traced one through to verify
20:36:11Watusimotoplus, the crash happens when the database tries to delete the segments, and that only happens to segments in the db
20:40:53raptorquestion: if i load a level
20:41:02raptorare wallsegments supposed to be added to a database?
20:42:41Watusimotoyes
20:42:45Watusimotowell, sort of
20:42:54Watusimotowall is added to the database
20:43:01Watusimotobut the database also has a wallsegmentmanagr
20:43:06Watusimotothat has the segments
20:43:07WatusimotoI think
20:43:31Watusimotothe idea was to keep junk like segments segregated from regular objects, keeping db access cleaner
20:45:33Watusimotothe WSM (wallsegmentmanager) has a database called mWallSegmentDatabase where it stores the segments
20:46:14Watusimotoit also has mWallEdgeDatabase for edges
20:46:40Watusimotosegments should only end up in mWallSegmentDatabase
20:47:15WatusimotoI wonder if I should enforce that somehow
20:49:58raptorok i confirmed that *every* wallsegment is added to a database
20:50:09Watusimotoexcellent!
20:50:41raptorso, can you give me a diff of what would remove the leak but create your crash?
20:53:01Watusimotono need; one line only
20:53:36Watusimotochange:
20:53:42Watusimotoif(xxx)
20:53:43Watusimoto mAllObjects.deleteAndClear();
20:53:45Watusimototo
20:53:47Watusimotoif(true || xxx)
20:53:47Watusimoto mAllObjects.deleteAndClear();
20:53:51Watusimotoboom
20:54:02raptorgreat!
20:54:03raptorthanks
20:54:07Watusimoto(griddb.cpp)
20:55:26raptorand to crash, i just resize a barrier, correct?
20:57:08WatusimotoI create a U shaped barrier, plunk a repair item in the U, then select the wall, ctrl-shift x to make wall 2x, then undo/redo a couple of times
20:59:11raptorhuh
20:59:23raptori found this:
20:59:31raptor==13706== 424 (400 direct, 24 indirect) bytes in 1 blocks are definitely lost in loss record 248 of 338
20:59:33raptor==13706== at 0x4C2A6E7: operator new(unsigned long) (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
20:59:34raptor==13706== by 0x644F28: Zap::RepairItem::clone() const (PickupItem.cpp:363)
20:59:36raptor==13706== by 0x5F07F7: Zap::GridDatabase::copyObjects(Zap::GridDatabase const*) (gridDB.cpp:133)
20:59:37raptor==13706== by 0x45EAD3: Zap::EditorUserInterface::saveUndoState(bool) (UIEditor.cpp:308)
21:00:23Watusimotosaw that before
21:00:29raptornotes?
21:00:54Watusimotoalso crashes with asteroid/flag/resource/teleport/textitem/gofast
21:01:25Watusimotobut didn;t track it down further than than
21:02:02Watusimotoso clone does this:
21:02:03Watusimotoreturn new RepairItem(*this);
21:02:11Watusimotoso whatever calls clone needs to take care
21:03:04Watusimotoclone called when dragging item from dock
21:03:20raptorZap::EditorUserInterface::scaleSelection
21:03:27raptorwas the next line of that trace
21:05:40Watusimotoso the repair item created in the clone is added to a database
21:08:35raptorwell the wallsegments still leak
21:09:57raptorso there are basically still two types of leaks: 1 with the clone() of each object, and one with the wall segments
21:10:11raptorand this since adding the true || xxx
21:11:34Watusimotowall segments leak....
21:11:36Watusimotohmmm....
21:11:48Watusimotowell, I left the database ids in place
21:12:06Watusimotomaybe you could print out which database a wallsegment is added to, and see if that db is deleted
21:12:14Watusimotothough we already know it is
21:12:28Watusimotoso i'm not sure what that would accomplish, actually
21:12:37raptorwhat do each of these mean:
21:12:38raptorgridDb: 2, 0xfe0dd60, 31
21:13:14Watusimotooh, those
21:13:16Watusimotook
21:13:24WatusimotogridDb reminds me where to delete the line
21:13:31Watusimoto(which I've done on my own copy now)
21:13:35LordDVG Quit (Remote host closed the connection)
21:13:53Watusimoto0x... is the address of teh segment
21:14:14WatusimotoI think I was dumping the addrs of all teh segments before deleting
21:14:25Watusimoto2 would be the 2nd item in the database
21:14:34Watusimotoand 31 is the objecttypenumber of that obj
21:14:40raptorahh
21:14:43Watusimoto31 = wall edge, 32 = wall segment, I think
21:15:12WatusimotoI concluded it always crashed when deleting type 32, hence my xxx check
21:15:42Watusimotowith my U walls, there are always 3 segments
21:16:06Watusimotoit crashes inside this loop:
21:16:07Watusimoto for(U32 i = 0; i < this->innerVector.size(); i++)
21:16:07Watusimoto delete this->innerVector[i];
21:16:17Watusimotoinside Vector<T>::deleteAndClear()
21:16:25Watusimotoand always when i == 2
21:17:32Watusimotoand that called from here:
21:17:33Watusimotoif(true || xxx)
21:17:33Watusimoto mAllObjects.deleteAndClear();
21:18:05Watusimotothat's where the idea of the xxx thing came from
21:18:12Watusimotowhich seems to fix the crashes
21:29:12raptorhere are the relevant leaks: http://pastie.org/5429090
21:29:24raptori think if we fix them (somehow) then things may work better...
21:30:28raptorso all the clone()'s are called from Zap::GridDatabase::copyObjects(
21:31:32Watusimotovoid GridDatabase::copyObjects(const GridDatabase *source)
21:31:32Watusimoto{
21:31:32Watusimoto // Fill copy with objects from existing database
21:31:32Watusimoto mAllObjects.reserve(source->mAllObjects.size());
21:31:32Watusimoto for(S32 i = 0; i < source->mAllObjects.size(); i++)
21:31:34Watusimoto addToDatabase(source->mAllObjects[i]->clone(), source->mAllObjects[i]->getExtent());
21:31:36Watusimoto sortObjects(mAllObjects);
21:31:38Watusimoto}
21:31:54Watusimotoare they not all added to a database?
21:32:07raptorthe for loop
21:32:11raptoradded to the same database?
21:33:08Watusimotoadded to the "this" database
21:33:33Watusimotothough it hardly matters -- databases take care of their objects, and all databases are accounted for
21:34:27raptorisn't clone() already exist for any c++ object?
21:34:42Watusimotobut if you doubted that, you could print the database' id, then dump ides of the destructors as the dbs are closed down
21:35:01Watusimotoclone()? no
21:39:14Watusimotoyou know..
21:39:34WatusimotowallSegements seem to have null geometry
21:39:41WatusimotoI wonder if that is the problem
21:42:40WatusimotoI'll set the geom of a segment and see if that fixes anything
21:46:55Watusimotonope
21:49:21Watusimototrying an unrelated, random fix... hasn;t crashed 2x in a row
21:49:47Watusimoto3x
21:50:25Watusimoto4x
21:51:03Watusimoto5x
21:51:06Watusimotomaybe this is it
21:51:33Watusimototook out onMouseMoved(); in UIEditor redo()
21:51:44raptorwhat
21:53:01Watusimotodidn't crash 5x in a row
21:53:10Watusimotothat's all I've got right now
21:53:39raptorthere was this in valgrind that i didn't paya ttention to:
21:53:48raptor==13706== Conditional jump or move depends on uninitialised value(s)
21:53:49raptor==13706== at 0x46851B: Zap::EditorUserInterface::onMouseMoved() (UIEditor.cpp:2779)
21:54:50raptorwait
21:55:06raptorthat just comes from normal mouse movement in Event::onMouseMoved
21:58:04Watusimotomaybe that explains the random crash I saw in setCursor
21:59:16raptornow this is interesting (i've been tracking down the clone() leaks): http://pastie.org/5429196
21:59:35raptorthere is a copy to database 14, but no output from removeEverythingInDatabase()
22:03:18Watusimotoeh?
22:03:30WatusimotoI see copy to 14
22:03:35raptoryes
22:03:46raptorbut do you see debug output from it?
22:03:53Watusimotoah, you've modified my debug code
22:03:58Watusimotowhere would I see it?
22:03:59raptori altered the dbeug... yes
22:04:13Watusimotois that first param a db number?
22:04:13raptorseee copy from: 11 to: 17
22:04:26raptorthen lower down gridDb: 17, 0, 0x2ee04d0, 21
22:04:34raptorthe first number is the database ID
22:04:50raptorsecond is object count, last is type number
22:04:54Watusimotook
22:05:01Watusimotoyes, I see that
22:05:11raptorbut it doesn't exist for database with id 14
22:05:20raptorwhich would explain the leaks for the 4 objects...
22:05:59Watusimotoand yet db 14 is deleted
22:06:03raptoryes
22:06:05raptorso
22:06:10raptorit isn't being added?
22:06:32Watusimotouh... I think it has to be
22:06:39Watusimotowhat do you do to add it?
22:06:42Watusimotodrag item off dock?
22:06:52raptori'm just rescaling, undo, redo, etc
22:07:03raptorand that method copyObjects is called
22:07:10raptorbut it failed in one instance..
22:07:10Watusimotofrom saved level?
22:07:12raptoryes
22:07:25Watusimotoyou know, all my crashes are when I start with blank canvas
22:07:35raptorwhat!
22:07:45Watusimotohaven't tried a saved level
22:07:54raptori saved a u-shaped level with a repair item to test...
22:07:59Watusimotoah
22:08:06WatusimotoI recreated every time
22:08:24Watusimototry from scratch a few times
22:09:01raptorok
22:10:38raptorhmm didn't crash once..
22:12:00raptorstill no crash...
22:13:25raptorand again, no crash
22:13:33raptorbut same missing cleanup of a database..
22:20:59Watusimotomaybe it's this line:
22:20:59WatusimotofindSnapVertex();
22:21:29raptorummm
22:21:31raptorhmmm
22:21:39raptoractually
22:22:23raptorit looks like items are being deleted from multiple databases, but i need to confirm somehow..
22:22:23Watusimotowhy? no idea. not even sure it's the problm. but it seems to not crash when that line is omitted from redo
22:23:28Watusimototrying to home in further
22:24:57raptorquestion
22:25:55raptorcan the same obejct be in more than one database at once?
22:26:29raptorbecause: http://pastie.org/5429310
22:26:36raptorfollow #14
22:26:38raptordb 14
22:33:34raptortime to track object pointers...
22:43:28raptorWatusimoto: found the leak for clone() objects
22:43:35raptori'm not sure what to do about it
22:44:21raptora different removeFromDatabase is being called on the objects: http://pastie.org/5429357
22:44:50raptorand in that one there is no delete anywhere
22:45:53raptorwould you understand why this is being called from cleanUp() in the UIEditor before the destructor can properly handle it?
22:55:07Watusimotogood!
22:55:14Watusimotolet me look
22:57:53raptoroh, and look at that, the same removeFromDatabase() with no delete is being called from the WallSegment destructor!
22:58:06raptorthat must be our memory leak, too
22:59:26raptoroh wow, it's called from several spots
23:01:33Watusimotowould you understand why this is being called from cleanUp() in the UIEditor before the destructor can properly handle it?
23:01:35Watusimotono
23:01:55raptorso that removeFromDatabase() method is called from many places
23:02:03raptorand there is no delete in it..
23:03:34Watusimotothe clearDatabase(mLoadTarget); method must be trying to free up some memory, in case you are quitting to play or something
23:04:28Watusimotoprobably that clearDatabase should become a removeEverythingFromDatabase like call
23:05:31WatusimotoremoveFromDatabase() --> mAllObjects.erase(i) should probably be deleteAndErase
23:05:39Watusimotothat's likely the memory leak
23:05:54raptorwell, that is what is being called in the destructor of wallsegment
23:06:07Watusimotook.
23:06:24Watusimotochange it to deleteAndErase and see if the leak goes awat
23:06:26amgine1234567890 has joined
23:06:28raptorok
23:06:37amgine1234567890hi
23:06:45raptori'm worried though, that method is called from lots of places
23:06:56amgine1234567890 so hany luck on the recalse crash bug
23:07:14Watusimotonot much
23:07:18Watusimotojust lots of frsutration!
23:07:20raptorhi amgine1234567890, still working on it
23:07:50raptoralso amgine1234567890, i deleted your post in announcements about upcoming 018 - i'd rather the actual announcement be made when it's really time
23:11:22raptorleak gone!
23:11:32raptorWatusimoto: try that simple change and see if it crashes...
23:11:56Watusimotoerase to deleteAndErase?
23:12:05raptoryes
23:12:08Watusimotodone
23:12:08raptorin that one method
23:12:09Watusimotocrash
23:12:30raptoryay wild goose found, now onto the real chase!
23:12:47Watusimotobut if the memory leak gets fixed, that;s progress
23:12:52raptoryes
23:12:56raptorwant me to commit it?
23:13:01Watusimotosure
23:15:52CrazyLinuxNerd Quit (Quit: Leaving)
23:16:06BFLogBot Commit: 3032471fd8ef | Author: buckyballreaction | Message: Finally fix the remaining memory leaks with the GridDatabase
23:16:08raptorok done
23:16:13CrazyLinuxNerd has joined
23:16:15amgine1234567890olnce you solve teh bug do you want me to do once last sweep for bugs or will we publish it soon
23:16:42amgine1234567890lol i need to stop finding bugs or BF18 will never come out Xd
23:19:01raptorsam686: memory leaks are fixed now, but Watusimoto still gets the crash; do you?
23:30:05amgine1234567890hmm the rescle worked in the ealer verison but couldnt unout numbers maybe backtrack to that one and try somthing different?
23:41:24amgine1234567890btw would it be possilbe to add 2 new game play modes by verion 20
23:44:28Watusimotook, I am having difficulty crashing when I load a level; only seems to work when I start a new one
23:44:40Watusimotowonder if the act of dragging an item from the dock is related?
23:45:55raptorok, let me try that..
23:46:46raptorwell, here is the full trace on that valgrind error: http://pastie.org/5429508
23:51:07raptoroooo
23:51:50raptorWatusimoto: i did a bunch of various editor actions with valgrind, and i found these: http://pastie.org/5429525
23:53:41Watusimotothose look bad
23:53:57Watusimotois the text color yours, or just pastie?
23:54:01raptorpastie
23:54:09raptori chose c++ highlighting

Index Search ←Prev date Next date→

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