-
-
Notifications
You must be signed in to change notification settings - Fork 187
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
FTL crashes instantly after start #50
Comments
Thanks for reporting this issue! It seems the error appears here: https://github.com/pi-hole/FTL/blob/master/parser.c#L440 Could you please do a
in gdb? |
Thanks for the quick reply!
|
Okay, looks like the line number that comes from the backtrace is not on-the-spot. Please do also a
|
Since clients[clientID].ip is empty, the crash should occur somewhere before line 438.... |
Yeah, I was assuming
whereas you also have
i.e. this client is already known (ID 7) and there should be no new entry created for it! I'll have to think more about that ... what is the content of |
|
Hmm, I'm not sure where the issue is happening now, since https://github.com/pi-hole/FTL/blob/master/parser.c#L433 seems to have worked, but https://github.com/pi-hole/FTL/blob/master/parser.c#L435 also seem to have worked, since there are valid addresses (so there is some memory allocated), but there is nothing copied into. Maybe you can dig a bit further around and find out where it crashes exactly. |
Ohhhhkay..... I'm officially confused... I tried to catch the line where clients[clientID].count is set to one to get the offset from gdb to the actual source file. Looks to be pretty accurately the last line before the one shown.
|
Try
(this includes the result at my end, but my code is usually not on I'll now look at the part you posted in more detail. |
Yeah, we see an evolution like
so everything until the |
So, it kept bugging me where the hostname "gravity.list " came from. So I searched the FTL source code for occurrences. Turns out, gravity.list has something to do with blacklists, and indeed, I think my problems started after I added "facebook.com" to the blacklist (as wildcard). I tried deleting it (currently my only entry in the blacklist) and suddenly no crash anymore. Adding it again and restarting ftl causes the crash again. I tried a few variations and it only happens if added as wildcard instead as exact. Adding any other url as wildcard to the blacklist also causes the segfault. I guess even before the actual crash, there has to be some kind of memory problem/buffer overflow/whatever. For now as a workaround I guess I just keep the blacklist empty for now. Let me know if I should try anything else to help you debug it ;-) |
Uff, I have |
@xorrizon try running FTL in a memory checker like |
I run
|
Okay, that might be an Could you send me the full output? Via email to |
I'll just post it here. After removing a bunch of unrelated "New domain" lines it's not that much bigger than the last one:
|
I still don't understand what is going on...
It might be worth trying re-running with However, on the way of digging through the code if found a potential vulnerability where a specifically malformed log line in |
However that works, it seems like line 440 is still what is causing
because
and we have |
You can try again with |
Thanks for the hard work! |
@xorrizon The |
Here you go. Just removed the new domain lines to keep the logs a bit shorter. GDB output:
Valgrind Output
|
Thanks again, for your input and your patience!
Those two seem to be connected, although I don't see why
I'd like to know where the address Could you do a
? It might have happened that a broken log line lead to a string that was not |
Here you go:
|
What I don't understand here is that you see
is an empty string. This part of the code should only ever be accessed, when this buffer contains |
Only explanation I can think of is that there is a buffer overflow or something similar somewhere which overwrites these.... |
I concur, but this is exactly what should be discovered by |
Well, the good thing is that the more I look at the code, the more I find and harden even the most unlikely situations. Please try again with If nothing helps, I will look into buying such a device but I'd really like to avoid that being necessary. |
Are you sure? I always thought valgrind doesn't catch overflows if you write into buffers you allocated yourself... Also, I looked through the code for string copys and such, and I think there might be a problem in https://github.com/pi-hole/FTL/blob/master/parser.c#L674 |
Good catch! This is something |
Well thats the point, maybe the memory after these variables actually is allocated to another local variable which gets overwritten. Which in turn might completely screw up the program flow. |
Crafting up another point release. We are surely keeping the build integration system busy this morning.
Yeah, I tend to forget that this cannot be detected by |
@xorrizon Please update to |
SUCCESS! |
Thanks for helping to improve |
And thank you for the quick work and for being part of an awesome project! |
Write DNS settings and implement everything that is needed to do that
In raising this issue, I confirm the following (please check boxes, eg [X]) Failure to fill the template will close your issue:
How familiar are you with the codebase?:
1
[BUG | ISSUE] Expected Behaviour:
pihole-FTL should start and not crash
[BUG | ISSUE] Actual Behaviour:
pihole-FTL either crashes instantly after start or after a few hours
[BUG | ISSUE] Steps to reproduce:
Log file output [if available]
gdb backtrace
Device specifics
Hardware Type: Pine64
Arch: aarch64
OS: Ubuntu 16.04.2
Kernel: 3.10.104-2-pine64-longsleep
Pi-hole Version: v3.0.1
FTL Version: v2.7
This template was created based on the work of
udemy-dl
.The text was updated successfully, but these errors were encountered: