Compilation succeeded, but crashes at loading screen.

Support for running, installing or compiling OpenMW

Before you submit a bug report for the first time, please read: Bug reporting guidelines
Locked
User avatar
rainChu
Posts: 28
Joined: 20 Dec 2012, 17:04
Location: USA

Compilation succeeded, but crashes at loading screen.

Post by rainChu »

First off, let me say hello! I'm hoping to contribute to this project, I consider myself of moderate skill. Not a wizard, but I know my way around C++. 7 or 8 years of it as a weekend hobby sort of thing.

Edit: After a short coffee break I found the problem. On lines 228 and 229 of worldimp.cpp, the shared section of mStore was being populated after the call to remove it. I think this is tiny for a pull request, though, isn't it? I've never actually used Git before, so I'm not sure. If you could walk me through the procedure I'll show you what changed, or use GitHub's pull request feature, whichever you prefer.

Original Post:
I've compiled it successfully (I think), under Windows using MSVC 2012, but the game crashes on the loading screen. I've run it through the debugger of course, and it seems to fail here:

Code: Select all

// apps/openmw/mwworld/store.hpp : line 256
if (it != mStatic.end() && Misc::StringUtils::ciEqual(it->second.mId, id)) {
                // delete from the static part of mShared
                typename std::vector<T *>::iterator sharedIter = mShared.begin();
                typename std::vector<T *>::iterator end = sharedIter + mStatic.size(); // Fails here: Can't increment shared Iter since sharedIter == mShared.end()

                while (sharedIter != mShared.end() && sharedIter != end) { 
Do you know the reason why the shared records might be empty there? Do you think I might have forgotten to copy something over to the game executable's directory? Or possibly is having no shared records not an error state, and simply patching this code would fix it?

I'm eager to help with some of the stuff piling up on the tracker, so I hope I can get my environment ready soon! :D
Xethik
Posts: 22
Joined: 17 Sep 2013, 22:35

Re: Compilation succeeded, but crashes at loading screen.

Post by Xethik »

Hey there!
I ran into an almost uncountable number of issues with my VS2010 regarding iterators. So hopefully, I can help!

When you run it in debug, do you get a callstack? Can you put that into a text file and upload it? I remember having issues in this file in particular, I just don't remember in what way exactly. Hopefully that will refresh my memory.

OH RIGHT! I just put a mShared.size() > 0 at the beginning of the if statement. I didn't have to do this on my laptop running VS2010SP1, though. Not sure!
User avatar
rainChu
Posts: 28
Joined: 20 Dec 2012, 17:04
Location: USA

Re: Compilation succeeded, but crashes at loading screen.

Post by rainChu »

Thank you very much for your reply! However, I already have solved the problem... I appended an edit to the post about 15 minutes ago I think, I hope I didn't cause you any trouble!

The callstack showed that it was caused by apps/openmw/mwworld/worldimp.cpp in line 228 (in master).

Code: Select all

mStore.movePlayerRecord();
mStore.setUp();
setUp() will populate the shared records, but movePlayerRecord() expects the shared record to be there when it performs the move.

I simply swapped them and I got it to run fine! I coc'd to Seyda Neen, and it was a bit slow due to debugger :P But I got it! Are you going to patch master yourself? This would actaully be a good excuse to teach me how to use a Pull Request. Also, there was an unrelated problem in the main.cpp of the launcher, it wanted WinMain and setting it to SubSystem:Console disagreed with my libs. So I had to put a WinMain in there as well.
Xethik
Posts: 22
Joined: 17 Sep 2013, 22:35

Re: Compilation succeeded, but crashes at loading screen.

Post by Xethik »

Whoops! My mistake. I started my reply when getting into a game and wrote it here and there, my bad.

You should send a patch in. It's a bit strange that it was only occurring on a few systems, here and there, but go ahead. A bit of help to get you started.

Once you commit to your fork and push to it, you go to your GitHub fork of the repo. Then, you click pull requests. It should automatically set the master upstream as your target, hit New Pull Request, and wala. Should be nice and filled out from there, with some comments that can be added.

I personally didn't patch because I was all too curious why it was happening to me, but not everyone. Haven't had the time to look into it too much more, though. Perhaps some sort of Visual Studio issue? Not sure.

Also, make sure you compile into release and get no errors there. I had an extra crash in release, so always good to check that, too.

If you need more help with Git, I'd be happy to lend a hand. Just lemme know.
User avatar
rainChu
Posts: 28
Joined: 20 Dec 2012, 17:04
Location: USA

Re: Compilation succeeded, but crashes at loading screen.

Post by rainChu »

Thanks a million! I'd love to have just a tiny bit of help. I'll send a pull request, since it's obviously not going to just go away if it happened to us both. One question, though: If I send a pull request, must I leave my own repo alone, and not push to it at all, while I wait for it to be accepted/rejected?

Sorry for this, I come from SVN.
Xethik
Posts: 22
Joined: 17 Sep 2013, 22:35

Re: Compilation succeeded, but crashes at loading screen.

Post by Xethik »

Nope, you actually wanna update your repo first. So you commit to your master, and then push to your master. Then, you go on the GitHub website for your repo and do a pull request from there. That's how I always do it, at least.

Do you use TortoiseGit or anything like that?
User avatar
rainChu
Posts: 28
Joined: 20 Dec 2012, 17:04
Location: USA

Re: Compilation succeeded, but crashes at loading screen.

Post by rainChu »

I'm using GitHub's client for Windows. I'm familiar with general concepts involved in VCS, and I understand the difference between pushing and committing. What I'm asking I think is once I've pushed to my online fork at GitHub, and sent a pull request, I can't push to it again until the request is accepted, right?
Xethik
Posts: 22
Joined: 17 Sep 2013, 22:35

Re: Compilation succeeded, but crashes at loading screen.

Post by Xethik »

Oh, I'm sorry. Misunderstood.

I believe that if you do push to it again, it will be included in the pull request. I'm not sure how to get around that, to be honest. I guess you could push to a new branch and work on that in the mean time. I'm personally not hugely familiar with doing that, though.
User avatar
rainChu
Posts: 28
Joined: 20 Dec 2012, 17:04
Location: USA

Re: Compilation succeeded, but crashes at loading screen.

Post by rainChu »

Thank you very much, that's all I need :)
Now, all I have to do is recompile Ogre's release version and I'll be set!
Xethik
Posts: 22
Joined: 17 Sep 2013, 22:35

Re: Compilation succeeded, but crashes at loading screen.

Post by Xethik »

Yup! I definitely recommend checking out the IRC if you have questions in the future. I think the response time is generally better there. I haven't been too active on it lately, so maybe I've just missed you.
Locked