Opened 8 years ago

Closed 8 years ago

#13094 closed bug (fixed)

[bfs] divide error exception in MimeManager Looper

Reported by: korli Owned by: axeld
Priority: normal Milestone: Unscheduled
Component: File Systems/BFS Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

lots of packages installed, happens during boot. hrev50701

Attachments (2)

SAM_3751.JPG (1.7 MB ) - added by korli 8 years ago.
SAM_3752.JPG (1.4 MB ) - added by korli 8 years ago.

Change History (6)

by korli, 8 years ago

Attachment: SAM_3751.JPG added

comment:1 by korli, 8 years ago

Is adding a check a good idea?

diff --git a/src/add-ons/kernel/file_systems/bfs/Inode.cpp b/src/add-ons/kernel/file_systems/bfs/Inode.cpp
index db2d98f..b26943c 100644
--- a/src/add-ons/kernel/file_systems/bfs/Inode.cpp
+++ b/src/add-ons/kernel/file_systems/bfs/Inode.cpp
@@ -2032,6 +2032,9 @@ Inode::_FreeStaticStreamArray(Transaction& transaction, int32 level,
                        fVolume->BlockSize());
        }
 
+       if (indirectSize == 0)
+               return RETURN_ERROR(B_ERROR);
+
        off_t start;
        if (size > offset)
                start = size - offset;

comment:2 by korli, 8 years ago

Seems the inode is corrupt. Trying to list the directory, I get a "Divide error exception", see next attachment.

by korli, 8 years ago

Attachment: SAM_3752.JPG added

comment:3 by axeld, 8 years ago

The code should definitely not crash if the inode data is corrupted, so this should indeed be fixed.

comment:4 by axeld, 8 years ago

Resolution: fixed
Status: newclosed

Fixed in hrev50820 - it was not the only place that needed the check, though.

Note: See TracTickets for help on using tickets.