-
Notifications
You must be signed in to change notification settings - Fork 31
Fix storing of lan log segfault #441
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
Conversation
The fix would work but could be done better.
I suggest going the quick way just now. I will rework it afterwards into the second. |
but then
I thought it too but yes, it's more complex solution and I hadn't much time to review the whole code what will affect that modification.
So do you suggest to use your 1st solution? |
Yes please do. I will pick it up and make a reminder for myself to rework the addcall2 code into the second solution afterwards. |
The fix does cure the segfault, just tested it. Maybe it's my setup, but I don't see the node information recorded in the log. The 1st QSO was logged on Node B, the 2nd on Node A, but both appear to have originated from
|
Indeed, that was the point.
If the serial must be incremented, then - I think - it already works (apart from some very extreme cases).
Let me check this too soon. |
One more issue: upon restarting TLF complains about the log line length: |
Done, see #443. Is this something you thought? |
There is a bug report in e-mail (via mailing list), where the reporter explained the situation: if he uses Tlf on two nodes then when he enter a QSO the receiver node exists with SEGFAULT. The problem is that the function parse_qso() is called two times while accepting the message from the other node, and it uses the buffer variable directly. When the function is called first time, the used strtok_r() chain "eats" the buffer, and at the second call it uses an empty buffer. Making a copy of the string and passing that to the first call fixes the problem. (See discussion in PR #441)
Thanks. Just merged #443 in. Already working on a change for addcall2() to accept a parsed struct qso_t instead of the logline. |
Thanks - I'm closing this PR. |
There is a bug report in e-mail (via mailing list), where the reporter explained the situation: if he uses Tlf on two nodes then when he enter a QSO the receiver node exists with SEGFAULT.
The problem is that the function parse_qso() is called two times, and it uses the
char *buffer
variable directly. When the function is called first time, the usedstrtok_r()
chain "eats" the buffer, and at the second call it uses an empty buffer.Here are the traces:
Both calls are necessary for a complete log, so I think the best solution is to copy the original buffer and operate with that.