View Issue Details

IDProjectCategoryView StatusLast Update
0000392FSSCPgameplaypublic2006-05-29 04:43
Reporterfizz Assigned Totaylor  
PrioritynormalSeverityminorReproducibilitysometimes
Status resolvedResolutionfixed 
Summary0000392: Null vector/vec3d in vector/vec3d normalize
Description"Null vector/vec3d in vector/vec3d normalize. Trace out of vecmat.cpp and find offending code."

So I did. The first trace I get pretty regularly when the player ship is destroyed. I don't know what causes the second.
Additional InformationCVS build as of 2005/04/25.
TagsNo tags attached.

Activities

2005-04-28 05:42

 

nullvec.trace (3,122 bytes)

Bobboau

2005-05-31 23:28

developer   ~0002553

does this precede a crash or something, NULL vecs happen every once in a while.

fizz

2005-06-01 05:52

reporter   ~0002556

No, I didn't notice any problems related to the warning.

Goober5000

2005-07-22 04:29

administrator   ~0002842

Try with the newest build and see if it's still an issue.

taylor

2005-07-22 05:05

administrator   ~0002846

I know I still get it regularly. The warning only shows once per session, otherwise there would be more demand to fix this. You'll have to disable the been_warned check to see how annoying it really is and how often it will happen. It does always seem to be particular models though so I'm not sure if it's directly a code problem, some sort of model problem, or a mixture of the two.

Goober5000

2005-07-22 08:05

administrator   ~0002861

K, I disabled the check. This should be fixed properly, not hidden. Hopefully we'll be able to find some sort of pattern to it.

Fractux

2005-08-12 15:16

reporter   ~0002984

Last edited: 2005-08-12 15:20

I was playing though Trancendance, and I started receiving the following error everytime hecules MK2 fighter launch from an orion. My fighter and the others are about 5000 clicks away from the orion, on her port side.

This happens everytime the fighters launch.

"WARNING: "Null vec3d in vec3d normalize. Trace out of vecmat.cpp and find offending code." at math/vecmat.cpp:776"

This, ironically, happened in the mission entitled "Null Breath". TransE3M4.fs2

The error is different, but is this related?

Tested on linux, using the latest cvs build as of today.

edited on: 08-12-05 11:20

taylor

2005-08-12 17:22

administrator   ~0002985

It is the same error, we just renamed "vector" to "vec3d" to get rid of a C++ naming conflict.

Fractux

2005-08-18 19:29

reporter   ~0003019

Last edited: 2005-08-18 19:31

I was testing out the Fighter Departure Bug, and I found something that may be of interest, or may not.

In test the mission I uploaded (DepartureTest.fs2), WMC's 20050329 linux build will produce a null vector error for the first ship that launches, but not for the other 3 ships.

However the the most recent builds in August ( I just started to keep all of my old builds for debugging purposes so i can't say when this started, sorry ), I get a Null Vector error for all four ships that launch in the test mission.

Anyways, I doubt this helps pinpoint anything, but thought you should know.

edited on: 08-18-05 15:31

edited on: 08-18-05 15:31

2005-08-18 19:29

 

DepartTest.fs2 (7,584 bytes)

Goober5000

2005-08-18 19:59

administrator   ~0003020

Last edited: 2005-08-18 19:59

All of the old builds are still available at http://fs2source.warpcore.org/exes/latest/ , so if you could test your mission in those, it would help. :)

edited on: 08-18-05 15:59

Fractux

2005-08-18 20:07

reporter   ~0003022

My only problem is that I currently don't have a windows machine to test those builds on.

I would need older linux builds for an x86, if there are any.

taylor

2005-08-18 22:52

administrator   ~0003037

Remember that the warning message previously only got shown once. It's not actually happening more often now, it's that it gets reported more than just the once. It was set to show the message only once, I guess, to get away from actually having to fix it. If it's only showing that message once then it's a lot easier to ignore. That's why the one-time-only part of the message was removed, to encourage a real fix to the problem areas.

Goober5000

2005-08-18 23:11

administrator   ~0003039

Oh right. I guess that makes Fractux's observation a red herring then. :)

taylor

2005-10-21 10:53

administrator   ~0003608

The two main errors here should be fixed now. Those two were during model loading and when a ship emerges from a bay. The third I know about, first entry in the nullvec.trace file, I haven't been able to reproduce yet though I have seen it before. When I can reliably recreate that one it will be fixed as well.

Goober5000

2005-10-21 23:37

administrator   ~0003619

Okay... from what I saw of your commits, you just added an IS_VEC_NULL check in the appropriate places. It that a real fix, or is it going to hide the problem again? ;)

What I mean to ask is, basically, is there an underlying problem that IS_VEC_NULL might mask where null vectors are not supposed to be generated? Or, is it normal to encounter null vectors in those places?

taylor

2005-10-22 00:45

administrator   ~0003620

No, it's a real fix. I didn't like doing that at first (and kind don't still, see below) which is why I hadn't already. But like I put in the commit logs, there were very specific cases that it would happen where it should have had a NULL check before being normalized. In those cases, through what the correct code ends up doing, the vector is NULL due to subtraction or just crapy model data. The warning is more the error than the code is.

In the model case there is already a NULL check which then goes back to normal model (non htl) data however it doesn't get an additional NULL check before trying to normalize. That was a general code bug though it may be that rather than a IS_VEC_NULL check that we vm_vec_normalize_safe() instead which just wouldn't give the NULL vector warning. I'm waiting on what people see before doing that, though I am testing that in my tree right now just to see if it really is better.

The second main place was in dot_to_point where one vertex subtracted from itself ends up with a NULL vector. This case is the same as above where we may just need to assign the vec.x to 1.0 rather than taking it as a NULL vector. The dot_to_point case is a little different in that it probably should return 0 rather than 1 which is why I just stuck with the IS_VEC_NULL check rather than assigning 1.0 to x. This is the one that I'm the least happy with concerning my fix. I'm certainly no hotshot at math.

Basically these problems are expected and already handled in various ways in other parts of the code. So this isn't masking the problem and in these two cases at least the NULL vector warning was just plain noise and didn't point out an honest problem.

I am going to keep playing with it and make some changes to what I've done so far and try to find a couple of the other places that this can happen. This one deffinitely isn't resolved yet, just trying to isolate the non-issues from the real issues.

taylor

2005-10-22 05:49

administrator   ~0003622

Ok, changed from IS_VEC_NULL() check to using vm_vec_normalize_safe() which looks to be what :V: did in every other similar case. I feel better about that now.

Also went ahead and added the comments I was using to keep track of the problem areas which used a "VECMAT-ERROR" comment with the error type and when it triggers. Maybe that will help reduce any confusion about the changes. I've got a couple of other VECMAT-ERRORs marked for this same thing but I haven't been able to reproduce them again and am not sure why they happened in the first place so a cause isn't listed.

taylor

2005-11-01 03:49

administrator   ~0003708

Haven't been able to replicate any of the other NULL vec messages since the previous fix so that might have squashed them all. If I find more I'll fix them since I'm pretty sure of how to handle it now. Otherwise, considering this fixed.

taylor

2005-11-01 03:49

administrator   ~0003709

Fixered.

cjclark

2006-05-29 04:43

reporter   ~0005666

Reminder sent to taylor

sorry for the noob question, but what exactly do you do with the .trace file provided?

Issue History

Date Modified Username Field Change
2005-04-28 05:42 fizz New Issue
2005-04-28 05:42 fizz File Added: nullvec.trace
2005-05-30 17:55 administrator Status new => assigned
2005-05-30 17:55 administrator Assigned To => Bobboau
2005-05-31 23:28 Bobboau Note Added: 0002553
2005-06-01 05:52 fizz Note Added: 0002556
2005-07-22 04:29 Goober5000 Note Added: 0002842
2005-07-22 05:05 taylor Note Added: 0002846
2005-07-22 08:05 Goober5000 Note Added: 0002861
2005-08-12 15:16 Fractux Note Added: 0002984
2005-08-12 15:20 Fractux Note Edited: 0002984
2005-08-12 17:22 taylor Note Added: 0002985
2005-08-12 18:34 Goober5000 Summary Null vector in vector normalize => Null vector/vec3d in vector/vec3d normalize
2005-08-12 18:34 Goober5000 Description Updated
2005-08-18 19:29 Fractux Note Added: 0003019
2005-08-18 19:29 Fractux File Added: DepartTest.fs2
2005-08-18 19:31 Fractux Note Edited: 0003019
2005-08-18 19:31 Fractux Note Edited: 0003019
2005-08-18 19:59 Goober5000 Note Added: 0003020
2005-08-18 19:59 Goober5000 Note Edited: 0003020
2005-08-18 20:07 Fractux Note Added: 0003022
2005-08-18 22:52 taylor Note Added: 0003037
2005-08-18 23:11 Goober5000 Note Added: 0003039
2005-10-21 10:17 taylor Assigned To Bobboau => taylor
2005-10-21 10:53 taylor Note Added: 0003608
2005-10-21 23:37 Goober5000 Note Added: 0003619
2005-10-22 00:45 taylor Note Added: 0003620
2005-10-22 05:49 taylor Note Added: 0003622
2005-11-01 03:49 taylor Note Added: 0003708
2005-11-01 03:49 taylor Status assigned => resolved
2005-11-01 03:49 taylor Resolution open => fixed
2005-11-01 03:49 taylor Note Added: 0003709
2006-05-29 04:43 cjclark Note Added: 0005666