-
Notifications
You must be signed in to change notification settings - Fork 265
Fix multiple regressions from mathlib rewrite #703
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
@jopadan this improves on #686 , can you please confirm that it is correct? Could you also comment on #686 (comment) ? I also think that the formula is applicable to any vector dimension. |
==78918==ERROR: AddressSanitizer: unknown-crash on address 0x7b8c9e36257c at pc 0x000001bdb39f bp 0x7ffdccbd8410 sp 0x7ffdccbd8408 READ of size 32 at 0x7b8c9e36257c thread T0 f0 vm_Dot3Vector ~/lib/vecmat_external.h:421 f1 operator*(matrix, matrix) ~/vecmat/vector.cpp:295 f2 ReadNewModelFile ~/model/polymodel.cpp:1938 f3 PageInPolymodel(int, int, float*) ~/model/polymodel.cpp:2189 f4 GetPolymodelPointer(int) ~/model/polymodel.cpp:2214 f5 ObjSetRenderPolyobj(object*, int, int) ~/Descent3/ObjInit.cpp:649 f6 ObjInitGeneric(object*, bool) ~/Descent3/ObjInit.cpp:787 f7 ObjInitTypeSpecific(object*, bool) ~/Descent3/ObjInit.cpp:1110 f8 ObjInit(object*, int, int, int, vec<float, 3ul, (align)8, 8ul>*, float, int) ~/Descent3/ObjInit.cpp:1199 f9 ReadObject(CFILE*, object*, int, int) ~/Descent3/LoadLevel.cpp:1657 f10 LoadLevel(char*, void (*)(char const*, int, int)) ~/Descent3/LoadLevel.cpp:3884 f11 LoadMissionLevel(int) ~/Descent3/Mission.cpp:1258 f12 LoadAndStartCurrentLevel() ~/Descent3/gamesequence.cpp:1629 f13 GameSequencer() ~/Descent3/gamesequence.cpp:1188 f14 PlayGame() ~/Descent3/game.cpp:821 f15 MainLoop() ~/Descent3/descent.cpp:552 f16 Descent3() ~/Descent3/descent.cpp:505 f17 oeD3LnxApp::run() ~/Descent3/sdlmain.cpp:143 f18 main ~/Descent3/sdlmain.cpp:315 f19 __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 f20 __libc_start_main_impl ../csu/libc-start.c:360 f21 _start ../sysdeps/x86_64/start.S:115 Address 0x7b8c9e36257c is located in stack of thread T0 at offset 124 in frame #0 operator*(matrix, matrix) ~/vecmat/vector.cpp:290 This frame has 2 object(s): [32, 68) 'src0' (line 290) [112, 148) 'src1' (line 290) <== Memory access at offset 124 partially overflows this variable HINT: this may be a false positive if your program uses some custom stack unwind mechanism, swapcontext or vfork (longjmp and C++ exceptions *are* supported) SUMMARY: AddressSanitizer: unknown-crash ~/lib/vecmat_external.h:421 in vm_Dot3Vector Fixes: adda1c1
Skip the unnecessary copy, especially when larger vectors/matrices are used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ugh I missed an awful lot of issues on the math lib rewrite, and nothing seemed wrong on my usual testing round... thanks for the effort on that. It could be nice to add some specific testing later to make sure it's rock-solid.
Pull Request Type
Description
Checklist