Opened 2 years ago

Closed 2 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:
Has a Patch: no Platform: All

Description

lots of packages installed, happens during boot. hrev50701

Attachments (2)

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

Change History (6)

Changed 2 years ago by korli

Attachment: SAM_3751.JPG added

comment:1 Changed 2 years ago by korli

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 Changed 2 years ago by korli

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

Changed 2 years ago by korli

Attachment: SAM_3752.JPG added

comment:3 Changed 2 years ago by axeld

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

comment:4 Changed 2 years ago by axeld

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.