-
Notifications
You must be signed in to change notification settings - Fork 27
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
rar2fs v1.29.5 - segfault #162
Comments
Thanks for the issue report. |
Do you have a huge directory depth by any chance? Judging from what can be read from the stack trace it seems to crash when we back off from a recursive to a linear invalidation approach which then should indicate a depth of at least 32. If you simply touch a dummy file at some directory level can you force this crash to occur again? |
I'll try to help out. I'll upgrade again and see. However, the directory depth shouldn't be huge, if you mean levels.
( |
I understand. But without reproducing it there will be limited possibilities for further troubleshooting as well confirm a possible fix. You do not necessarily need to have a large depth since also a change to a base directory would need to invalidate all possible child nodes. Thus many child nodes can also result in the limit being exceeded. I would appreciate any help I can get and as I said previously maybe you can force this crash by touching some dummy file inside your library. Would have been nice to know exactly what part of the library triggered this but maybe it is not that important. I am not entirely sure I understood your mount hierarchy but do you stack rar2fs mount points as well? |
If you manage to reproduce a simple change of the above to 0 in hashtable.c can confirm if problem is in the recursive invalidation or not. |
Yes, rar2fs is stacked once, to deal with rars inside rars. So, what I basically have is:
|
Ok but it is the main rar2fs mount that crash, right? Not the second level that would deal with rar in rar. |
It was the second layer that crashed, as per the first post: |
I guess we have a confusion about definitions here 😉 You sad "top" in initial post which says very little. But since you would point PMS to the mount point which would provide also contents of rar inside rar I here assume that is the one we are dealing with here. It is only for my complete understanding of your use-case which does not seem very unusual at all. |
You got it right. :) By top, I meant the one exposed to PMS, which is the one dealing with rars-in-rars.
where
How do I easiest modify this to get something useful for bug tracing? |
I would say the easiest is to rebuild using Also you can attach to process using gdb or start it through gdb since that as well will run in foreground but |
Eh, alright. I'll look at it. The Gentoo ebuild has a debug use flag. There is no |
Gentoo debug flag should be good enough. It will apply a default debug level. |
Yeah ok. I had to make some changes, as those logs grow huge very fast and they managed to fill my 24GB tmpfs in a few hours. I've since changed the logging so that rar2fs-outputs are piped through xz before writing them to tmpfs. But it hasn't crashed yet. So, was the suggestion to just write any file to the library? Like |
If you read the man page using a warmup on the secondary mount point carries a penalty you should be aware of. Only the primary mount can fully utilize the gain of avoiding all interactions with the FUSE file system. Enough said about that, it is not the source of the crash. Don't sweat it trying to log things until you know issue can be reproduced. I have identified what I believe is a weakness in the recursive approach, call it a bug if you wish. But without you being able to reproduce it would be hard getting any clean evidence it is the true source of your reported crash. It would become a guess game really. What we can say though is that if your statement is correct about current directory depth never exceeding 32 the place in where it crashes should basically never be reached. Since reaching that part of the code is unexpected it is hard to say how it would behave if it does. |
I will continue logging. With xz the files grow only to a couple of gigabytes per day. The pms system is restarted daily anyway, so log rotation is not a problem. Then, at least logs will be there when it crashes again. And, the level of directories does not exceed 11 on the file system where rar2fs crashed. |
I have logged a few segfaults now. They seem to happen in only one of my libraries, sometimes after 5hrs, sometimes after 12hrs. On some days it does not crash. I guess it has to do with PMS's indexing. I've only looked at the debug logs quickly, and it seems like the it happens after the invalidation of a lot of hash keys. I could send you excerpts. Or something. Perhaps I could also attach gdb to the rar2fs-process that crashes. Some further looks indicate that the crash involves the same directory. |
Ok I have an idea what the problem might be so I will attach a patch here later that you can try and see if problem is resolved by it. |
Sorry for the delay, it has been rather hectic at work recently and I just could not find the spare time needed. I will try to send you a patch during the weekend. Again sorry for the inconvenience this delay may cause you. |
And of course, any input you can give would be valuable, traces etc and if you suspect a specific directory, the complete hierarchy of sub folders this directory belongs to with exact names as well. This since it might be hash collision related as well. If you do not wish to expose details about your setup here you can send them to me in private mail to hans.beckerus AT gmail.com. |
No worries. I have a day job as well, and I have nothing important tied to this. I'll e-mail you with some logs, as I don't think the posting them for all bots to find would be helpful for anyone. |
You can try to apply the above patch to see if it makes a difference. |
But as I mentioned before simply setting
to 0 would show if this part of the code is the culprit or not. |
Yeah alright. Gonna apply that patch and see. I've e-mailed you with some logs as well. |
Skip that patch, set limit to 0 and see if crash can be avoided as a workaround. Something is fishy here and I need to go back and look this over again from scratch. |
You can try this patch as well |
Thanks. I've applied the patch. Let's see. |
Any news here? I guess a complete reset of the PMS database should push this a bit? |
Any news? Would really need some feedback on this patch if it helps or not. |
I'm sorry. I've been a bit busy. I'll check through my logs for crashes later this evening or tomorrow. |
I haven't had any crashes from the 22nd. Probably I haven't had any for longer time, but logs are only kept a week. I have a log from the 22nd that logged the section that made rar2fs crash previously. That logfile is 2.2G, xz compressed, indicating a lot happened there but nothing crashed. Might be extrapolated to concluding that the patch is effective. |
Thanks, I will merge the patch and then close the issue. If the issue reappears we can simply reopen it. |
I've logged a segfault with the latest rar2fs. I think v1.29.4 did not segfault on me.
This is a 2-layered rar2fs, where it is the top layer that crashed.
The text was updated successfully, but these errors were encountered: