Jump to content
The Dark Mod Forums

Itches, Glitches & Anything Else...


Recommended Posts

Oh yeah, I just go this on Linux, although I get a different error:

 

terminate called after throwing an instance of 'boost::bad_lexical_cast'
 what():  bad lexical cast: source type value could not be interpreted as target

 

I think I know where this comes from actually, I will investigate.

 

Edit: FIXED.

Link to comment
Share on other sites

Edit: just saw it in the logs, info_player_starts without angle seemed to throw an exception.

 

Yes, I replaced some legacy scanf/const char* garbage with a boost::lexical_cast, but failed to check whether the angle key was actually present before trying to cast it to a float.

Link to comment
Share on other sites

  • 3 weeks later...

Just to drop a note here: I messed something up with my recent brush changes. (I noticed too late that brushes aren't showing up anymore.) It has something to do with the brushmodule and I'm working on it, but it will take some time, because I'm too tired now. Sorry if this causes any problems, just be careful with revision 653.

 

I tried to revert the committed changes, but somehow this doesn't work for all the files, just for a part of them.

 

edit: Fixed. I confused min and max while copying and pasting...

Link to comment
Share on other sites

I noticed that the latest SVN build crashes on AI creation (tested with builder guard and undead_zombie and spider_queen). It works fine with DR 0.7.1, so this broke within the last few weeks. It does work fine as well with atdm:loot_xxxx stuff so perhaps this is something AI-related?

 

Can you reproduce this on your machine, Orbweaver?

Link to comment
Share on other sites

I noticed that the latest SVN build crashes on AI creation (tested with builder guard and undead_zombie and spider_queen). It works fine with DR 0.7.1, so this broke within the last few weeks. It does work fine as well with atdm:loot_xxxx stuff so perhaps this is something AI-related?

 

Can you reproduce this on your machine, Orbweaver?

 

I will investigate this evening.

 

Another thing: I removed the deprecated virtual capture() and release() methods from irender.h (those using const char*), I hope this is okay and you didn't left them there on purpose?

 

Fine, if they're deprecated they can go.

Link to comment
Share on other sites

I will investigate this evening.

 

I cannot reproduce this unfortunately -- I tried with all of the examples you gave and the AI was created fine (although the spider queen has some strange lines going off to infinity).

Link to comment
Share on other sites

May well be a Windows-only problem, I guess I should try to replicate it in Windows as well.

 

Do you have a functioning debugger at all? This makes finding segfaults almost trivial. I once managed to use GDB under Eclipse in Windows, but I'm pretty sure it is Permanently and Randomly Broken now, as Eclipse tends to do.

Link to comment
Share on other sites

So far I know that the crash is happening in TraversableNodeSet::insert().

 

Ah, that is familiar. There is some screwy system whereby a container can either hold a single child (TraversableNode) or multiple children (TraversableNodeSet), with the switch between them depending on the setting of the "model" key. It may be that the entity class system (which I totally refactored a while ago) is broken in some way which is causing this switch to be made incorrectly.

 

Really the whole TraversableNode/NodeSet nonsense needs to go -- a set can actually hold a single object too, y'know -- but I haven't yet mustered the courage to get stuck in to such a fundamental part of the codebase as yet.

Link to comment
Share on other sites

I stopped at this point in instancelib.h: InstanceSubGraphWalker::pre():

 

The statement

scene::Instance* instance = Node_getInstantiable(node)->create(m_path, m_parent.top());

in pre() crashes, but I haven't investigated yet what is wrong here, because I'm tired now.

 

The call order is something like this:

 

Entity_createFromSelection >> EclassModelNode::insert >> InstanceSet::insert() >> Node_traverseSubgraph >> InstanceSubGraphWalker::pre()

 

I won't have net access till friday evening, so I'll leave this for the moment being.

Link to comment
Share on other sites

I stopped at this point in instancelib.h: InstanceSubGraphWalker::pre():

The statement

scene::Instance* instance = Node_getInstantiable(node)->create(m_path, m_parent.top());

in pre() crashes, but I haven't investigated yet what is wrong here, because I'm tired now.

 

Hmm, that's actually unsafe because Node_getInstantiable() can return NULL and there is no check for this. I will try and recreate this tonight on my Windows partition.

Link to comment
Share on other sites

Well I can't reproduce any crash on Windows, with either debug or release builds. However, the spider queen model which displays lines going off to infinity in debug mode, causes a lockup in release mode, which I think could be related to the inline-sqrt() issue I encountered early on.

 

I don't see how this would cause a segfault, but it needs sorting anyway. I will try to get rid of the infinite lines on Linux, where I can debug properly, which should hopefully solve the lockup and might POSSIBLY solve the crash but I am not confident of this.

Link to comment
Share on other sites

I found a source of numerical errors last night, which I believe is responsible for the infinite lines -- the processing of weights in MD5Model_Parse() involves a repeated addition of possibly small numbers to a float value, leading to a Vector3 containing 3 NaNs. This probably should be corrected properly, although for the time being I may just add a check and discard the affected vertices (leading to some missing geometry but hopefully no NaN problems).

Link to comment
Share on other sites

Update: I couldn't track down the error to a distinct point, but this is what I could find out:

 

The problem seems to occur when trying to create an entity that has a md5mesh model. The crash occurs at this line in ModelResource_load() in referencecache.cpp:

model = loader->loadModel(*file);

I checked if the loader is NULL, but this is definitely not the case (this gets checked anyways). Strangely, the ModelLoader_forType function responsible for returning the pointer to the ModelLoader for a given type returns a non-NULL pointer, but it doesn't seem to point at one of the three candidates (NullModelLoader, MD5ModelLoader, PicoModelLoader, with MD5ModelLoader being the most probable candidate).

 

I implemented a virtual debug() method into these three classes that outputs a test string to std::cout to see which of these gets called, but the call loader->debug() crashes as well, so the pointer must be pointing at some crap.

 

I'm kind of stuck here, any advice what I could do to check the sanity of the ModelLoader* pointer?

Link to comment
Share on other sites

Gah! I found the error. There was an old dll file still residing in my install/modules folder that didn't get deleted by scons after the md5 module got renamed. The module system obviously couldn't handle the various model.dll, md5model.dll modules having the same type and returned some crap.

 

Another 4 hours wasted! At least I got some insight into the workings of the model loader stuff...

Link to comment
Share on other sites

Phew, so I didn't bugger up the entity class system then.

 

*relaxes*

 

That reminds me of the bug that took me 3 days to track down -- one of the config scripts for a Linux library (xml2 or something) inserted an --export-dynamic linker option which was causing the Model::Model() constructor in one of the model plugins to incorrectly link to a Model::Model() constructor somewhere in the main binary resulting in a crash due to incorrectly initialised data.

Link to comment
Share on other sites

The NaN issue is now fixed, I believe. It was caused by the calculation of the W value for a Joint's rotation performing a sqrt() but not checking the return value for NaN before adding to the data structure. I just set the W value to 0 if this happens, which seems to work although I don't actually know what it means in mathematical terms.

Link to comment
Share on other sites

I guess this could happen if you pass a negative value to sqrt()? As complex numbers are unsupported, it is most probably the best to set the value to zero, although there is something wrong with the model in the first place if this is happening.

Link to comment
Share on other sites

I got a compiler error on my windows box saying that isnan() is unknown. After a short search I found this: http://www.parashift.com/c++-faq-lite/newbie.html#faq-29.15

and implemented the suggested method in math/FloatTools.h named isNaN().

 

I hope this is ok, as I have no experience with cross-platform checks for NaN, so there may be a better solution. Feel free to correct me.

 

edit: Ok, just checked, and the spider queen produces a lock-up on my system, so I guess the problem is not resolved using the above method. I will try to find something else, maybe upgrading my compiler does help.

Link to comment
Share on other sites

I guess this could happen if you pass a negative value to sqrt()? As complex numbers are unsupported, it is most probably the best to set the value to zero, although there is something wrong with the model in the first place if this is happening.

 

Yes. sqrting a negative number and possible a -INF/+INF value (I think it was -INF in this case, the Vector3::getLengthSquared() was being called when one of the vector components was 1e-07 or something, which would probably have resulted in underflow.

 

I got a compiler error on my windows box saying that isnan() is unknown. After a short search I found this: http://www.parashift.com/c++-faq-lite/newbie.html#faq-29.15

and implemented the suggested method in math/FloatTools.h named isNaN().

I hope this is ok, as I have no experience with cross-platform checks for NaN, so there may be a better solution. Feel free to correct me.

 

I am surprised that it isn't available since it is the same compiler (GCC). Defining it yourself is OK, but it would be worth checking if there is some Windows-specific header you are supposed to include that defines the function.

 

edit: Ok, just checked, and the spider queen produces a lock-up on my system, so I guess the problem is not resolved using the above method. I will try to find something else, maybe upgrading my compiler does help.

 

Damn, that could be a really nasty bug to track down then, because it occurs only in Release mode (not that I have a functioning debugger on Windows anyway).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recent Status Updates

    • Petike the Taffer  »  DeTeEff

      I've updated the articles for your FMs and your author category at the wiki. Your newer nickname (DeTeEff) now comes first, and the one in parentheses is your older nickname (Fieldmedic). Just to avoid confusing people who played your FMs years ago and remember your older nickname. I've added a wiki article for your latest FM, Who Watches the Watcher?, as part of my current updating efforts. Unless I overlooked something, you have five different FMs so far.
      · 0 replies
    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 4 replies
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
    • OrbWeaver

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
×
×
  • Create New...