Opened 14 years ago
Closed 14 years ago
#6305 closed bug (fixed)
Problem with ext3 volumes
Reported by: | jackburton | Owned by: | korli |
---|---|---|---|
Priority: | normal | Milestone: | R1 |
Component: | File Systems/ext2 | Version: | R1/Development |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description
Since some time (I can't tell from which revision, since I don't use Haiku daily), trying to read from ext3 volumes causes some problems. From tracker, trying to descend into more than 3 levels of subdirectories causes a crash (backtrace attached). From the terminal, some commands fail in a weird way (ls | less causes a "cannot find less") or something like this). Actually I think there are 2 problems here:
- The ext2/3 fs module passes some weird data
- Tracker shouldn't crash when it receives weird data from the fs modules
Filing into general for now. Gcc2 hybrid, hrev37487.
Attachments (3)
Change History (29)
by , 14 years ago
comment:2 by , 14 years ago
Component: | - General → File Systems/ext2 |
---|---|
Owner: | changed from | to
Status: | new → assigned |
To be honest, I only remind of having tested with one level of directories. I'm unsure what can be exactly failing from the crash trace.
by , 14 years ago
Attachment: | htree_update.patch added |
---|
This is an updated patch of the same code. I'm not sure it fixes the crash, but it will output more information to help find the cause.
comment:3 by , 14 years ago
patch: | 0 → 1 |
---|
follow-up: 9 comment:5 by , 14 years ago
I'm sorry, I'm still confused about what's causing this =(. Could you tell me how to reproduce this error? Do you think it's possible to narrow down to what is causing the crash? A specific file or directory? Is there a test image you could send me so I can try to figure it out? Thank you.
follow-up: 7 comment:6 by , 14 years ago
Stefano, is the problem still here without hrev37295? I ask because attribute support was also added a few months ago.
comment:7 by , 14 years ago
comment:9 by , 14 years ago
Replying to jvff:
I'm sorry, I'm still confused about what's causing this =(. Could you tell me how to reproduce this error? Do you think it's possible to narrow down to what is causing the crash? A specific file or directory? Is there a test image you could send me so I can try to figure it out? Thank you.
Unfortunately the only ext3 partition I have is the one with my personal data, so I can't send the image to you. As I said, the crash happens as soon as I descend to the 3rd level of directories:
- Root
- Home
- Stefano (my username in linux)
follow-up: 11 comment:10 by , 14 years ago
By the way, Coverity says there's an array overrun in /src/add-ons/kernel/file_systems/ext2/HTree.cpp, line 250, since the array contains 4 elements, and the loop tries to access the 6th.
comment:11 by , 14 years ago
Replying to jackburton:
By the way, Coverity says there's an array overrun in /src/add-ons/kernel/file_systems/ext2/HTree.cpp, line 250, since the array contains 4 elements, and the loop tries to access the 6th.
IIRC, that's already fixed in the patch I posted =). Thank you for the heads up though!
comment:13 by , 14 years ago
comment:14 by , 14 years ago
I tested briefly, and Tracker still crashes just like before. Doing any operations in the ext3 volume from Terminal works, though. I'll try to do more testing in the next days to see if I can give more info.
comment:15 by , 14 years ago
Looking again at the stacktrace it looks the same as in #4037
I had a look at BContainerWindow::AddMimeTypesToMenu(BMenu *menu), to me it looks like it forgets to check the BPath sanity.
Could you try something like this ?
// Add MIME type in case we're a default query type window if (TargetModel() != NULL) { BPath path; TargetModel()->GetPath(&path); if (path.InitCheck() == B_OK && strstr(path.Path(), "/" kQueryTemplates "/") != NULL) { // demangle MIME type name BString name(TargetModel()->Name()); name.ReplaceFirst('_', '/'); PoseView()->AddMimeType(name.String()); } }
comment:17 by , 14 years ago
Owner: | changed from | to
---|---|
Status: | assigned → in-progress |
I can't tell clearly from the comments if there was indeed an FS issue and if it's still there. In any case i'm looking at the Tracker issue :)
follow-up: 19 comment:18 by , 14 years ago
I can reproduce each time, going deeper than 3 dirs fails, with BPath::SetTo(entry_ref) misbehaving. The ref is valid though (everything else appears to be working except where Tracker relies on the BPath) thus maybe explaining why Terminal is unafected.
So it seems the problem is on the fs side, failing in _kern_entry_ref_to_path().
Still i will add checks with alerts in Tracker although a proper fs error/user feedback strategy has yet to be implemented.
comment:19 by , 14 years ago
Replying to aldeck:
I can reproduce each time, going deeper than 3 dirs fails, with BPath::SetTo(entry_ref) misbehaving. The ref is valid though (everything else appears to be working except where Tracker relies on the BPath) thus maybe explaining why Terminal is unafected.
So it seems the problem is on the fs side, failing in _kern_entry_ref_to_path().
Could you be more specific on the failure (error code for instance) ? Because I'm still clueless. Thanks.
comment:20 by , 14 years ago
Ok, sorry, here is a small test.
#include <Entry.h> #include <Path.h> #include <stdio.h> #include <string.h> int main(int argc, char **argv) { BEntry entry("/unnamed volume/home/alex/.bashrc"); status_t err = entry.InitCheck(); printf("entry.InitCheck() == %li (%s)\n", err, strerror(err)); BPath path; err = entry.GetPath(&path); printf("entry.GetPath() == %li (%s)\n", err, strerror(err)); err = path.InitCheck(); printf("path.InitCheck() == %li (%s) path.Path() == '%s'\n", err, strerror(err), path.Path()); return 0; }
Output:
entry.InitCheck() == 0 (No error) entry.GetPath() == -2147459069 (No such file or directory) path.InitCheck() == -2147459069 (No such file or directory) path.Path() == '(null)'
Output for one level up ie: "/unnamed volume/home/alex"
entry.InitCheck() == 0 (No error) entry.GetPath() == 0 (No error) path.InitCheck() == 0 (No error) path.Path() == '/unnamed volume/home/alex'
comment:21 by , 14 years ago
Owner: | changed from | to
---|---|
Status: | in-progress → assigned |
I'd like to work on other things, i'll wait for progress on the fs issue. (which is out of my league, if i need to precise :))
comment:23 by , 14 years ago
My test above still fails on hrev39530. Btw shouldn't entry.InitCheck() return an error when entry.GetPath() fails?
Backtrace of the crash