Volumes Of Fun
http://www.volumesoffun.com/phpBB3/

PolyVox::LargeVolume
http://www.volumesoffun.com/phpBB3/viewtopic.php?f=14&t=538
Page 3 of 4

Author:  David Williams [ Fri Nov 22, 2013 10:45 pm ]
Post subject:  Re: PolyVox::LargeVolume

Interesting... it would be useful to have some knowledge of how it is getting to this state. Are you running a debug build when executing it on your own? If so, you should get the option to launch the debugger when it crashes. Or perhaps you can run it yourself, attach the debugger while it runs, and then it should drop into it when it crashes. The debugger should give much more useful information than the assert.

Author:  kklouzal [ Sat Nov 23, 2013 7:53 am ]
Post subject:  Re: PolyVox::LargeVolume

I'm running in release mode, I compiled the static library and compiled it in release mode. The only thing I changed was Runtime Library-Multithreaded (/MT) so it would compile in the project making use of polyvox, which uses a library I purchased that comes pre compiled with a /MT version..it does work executing it through msvc2012 unfortunately only I can run the program

Author:  David Williams [ Mon Nov 25, 2013 10:33 am ]
Post subject:  Re: PolyVox::LargeVolume

What happens if you make a debug build but run it from outside the IDE? I.e. is the crash a result of debug vs. release or a result of 'in IDE' vs. 'not in IDE'? Also be aware that when running in the IDE you have the option of whether or not the debugger should actually be attached to the process.

Something else you can try is to comment out the relevant assert and set 'm_pLastAccessedBlock' to '0' instead. That is:

Code:
// POLYVOX_ASSERT(pUncompressedBlock != m_pLastAccessedBlock, "Attempted to delete last accessed block.");
m_pLastAccessedBlock = 0;


Does that help or does it just crash elsewhere?

Author:  kklouzal [ Mon Nov 25, 2013 3:51 pm ]
Post subject:  Re: PolyVox::LargeVolume

It's a result of IDE vs no IDE, adding that piece of code didn't help. :( I wish we could get this taken care of :D

Author:  David Williams [ Mon Nov 25, 2013 6:24 pm ]
Post subject:  Re: PolyVox::LargeVolume

kklouzal wrote:
It's a result of IDE vs no IDE...


So in this case it still crashes if you run a debug version outside of the IDE? I think it should be possible to attach the debugger after it has crashed... or it should pop up a dialog where one of the options is to launch the debugger. Does this not happen?

kklouzal wrote:
...adding that piece of code didn't help.


Did you comment out the assert as well? What is the new behaviour - does it give a different assert or just crash somewhere else?

Author:  kklouzal [ Tue Nov 26, 2013 2:53 pm ]
Post subject:  Re: PolyVox::LargeVolume

I'm sorry, after commenting out the code it crashes with this every time:
Image
And still runs fine through the debugger, previously before modifying the LargeVolume.inl I would notice the same error displayed in this screenshot although it was a very rare occurrence.

Author:  David Williams [ Tue Nov 26, 2013 9:41 pm ]
Post subject:  Re: PolyVox::LargeVolume

The error message which is being printed to the console suggests that there is a problem writing to the filesystem. It's coming from this point in PolyVox:

Code:
FILE* pFile = fopen(filename.c_str(), "wb");
if(!pFile)
{
   POLYVOX_THROW(std::runtime_error, "Unable to open file to write out block data.");
}


I guess you don't have any exception handling in your application? It's not clear why this problem occurs, but perhaps you don't have write permoission in the current folder? Maybe you need to adjust the relevant part of the code to print out the name of the file it is trying to run? Or what if you run the program as an administrator?

But overall you do need to handle exceptions, or the program is just going to crash whenever an exception is thrown.

Author:  kklouzal [ Wed Nov 27, 2013 3:59 pm ]
Post subject:  Re: PolyVox::LargeVolume

Running it as administrator has no effect, I've changed the output directory PolyVox writes to a few times and have made sure there is write access to that directory.

Author:  David Williams [ Thu Nov 28, 2013 11:34 am ]
Post subject:  Re: PolyVox::LargeVolume

Maybe you can try and do some further tests to narrow down the problem? Unfortunately it's very hard for me to say what is wrong when it is failing in such a specific scenario. If I were you I would modify PolyVox to print out extra information for debugging purposes, and/or try reproducing the problem in a simpler program. It appears to be a standard call to fopen() so there's only a limited number of things which can be going wrong. You could consider:

  • Am I right about where it is crashing (add some printf()'s to see)?
  • Is the filename valid (try printing it out)?
  • Does it already exist?
  • Is it already open?
  • Can you create the file manually in the specified directory?
  • Can you write a simple C program in a few lines which reproduces the problem?

These are just examples though... the point is that trying a number of tests like this might help give some insight into what is going on.

Author:  kklouzal [ Thu Nov 28, 2013 7:52 pm ]
Post subject:  Re: PolyVox::LargeVolume

Thanks I appreciate you taking the time to help here :) I'll try to narrow it down for you.

Page 3 of 4 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/