Closed gvacaliuc closed 4 years ago
this just needs a little bit more testing @almagee16 @southpawac @jeffrey990219 can y'all see if these updates regress anything? there's a start of a test under tests/wsdiag.go (run with go run tests/wsdiag.go
), but it doesn't work yet. i haven't tried running the frontend though.
invalid memory address or nil pointer dereference
I tried checking out the branch and running it with the front end. I clicked a pixel and I get this error. Im not sure I can debug all the code that you wrote without sitting down and going line by line. This seems to be a different error than before when it was panicing due to concurrent websocket writes, or it might just seem like a different error to me since the code is now in a different file.
Im going to try commenting out the user code with the referencing of the time and see if that is the issue. If not I'm not exactly sure what it would be and have to study for the 412 exam :(
Hi, Patrick. Did you make sure that you have manually logged in yourself before changing a pixel?
This error may happen if the system tries to get the last modification time of a user that's not in the database. Why? Because SyncGetLastUserModification returns a pointer and we are currently getting the time by dereferencing that pointer, so if the pointer is nil, then it is a problem.
If that still doesn't work, then I will take a look later.
I still don't know what is going on. I tried logging out and then back in as @jeffrey990219 suggested but it also crashes the server when I do that with another invalid memory address this time in the handleLoginUser
method.
Gabe I think the way you changed it to parse the messages still works since this one is bombing out in the handleLoginUser
method and the other one crashes in the handleDrawPixel
method, but something is still wrong and causing segfaults.
Ok so the issue seems to be that c *Client
doesn't have a cons consensus.IConsensus
field.
As a matter of fact, calling c.cons.SyncGetLastUserModification(userID)
gives an error.
Yup, the cons
field is not initialized. @gvacaliuc
sweet thanks for debugging this!
idk how to fix this tho lol
This code builds, but it needs some testing.
Commit Desc:
WS Client Connections:
Makefile:
lint
andfix
targetslint
will not report an error even if there are errors (currently)Messages:
This change is