Opened 3 years ago

Closed 3 years ago

#17389 closed bug (fixed)

mimeset crash kills Haiku build

Reported by: mbrumbelow Owned by: nobody
Priority: high Milestone: Unscheduled
Component: Build System Version: R1/beta3
Keywords: Cc:
Blocked By: Blocking:
Platform: x86-64

Description

Kernel: x86_64 hrev55625 CPU: 8 Processors Intel I5 Memory: 16GB Storage: 500GB Compiler: GCC 11.2.0_2021_07_28-3 x86_64-unknown-haiku

Building Haiku fails when mimeset is called. mimeset crashes and user terminates the process which terminates the build.

Attachments (2)

mimeset-218422-debug-07-11-2021-13-33-59.report (45.4 KB ) - added by mbrumbelow 3 years ago.
Crash Report
mimeset_crash.jpg (496.2 KB ) - added by mbrumbelow 3 years ago.

Download all attachments as: .zip

Change History (13)

by mbrumbelow, 3 years ago

Crash Report

by mbrumbelow, 3 years ago

Attachment: mimeset_crash.jpg added

comment:1 by waddlesplash, 3 years ago

Component: ApplicationsBuild System
Keywords: mimeset crash build removed

comment:2 by waddlesplash, 3 years ago

This doesn't seem to reproduce with -O0 -g, so it is probably related to some optimization somehow.

comment:3 by mbrumbelow, 3 years ago

Where should those be put so I can test the build out on my other machines?

comment:4 by waddlesplash, 3 years ago

Add them to SubDirC[++]Flags in src/build/libroot/Jamfile.

comment:5 by waddlesplash, 3 years ago

Ah, I missed that it only happens during package creation. Indeed I can still reproduce it with debug mode.

comment:6 by waddlesplash, 3 years ago

Adding some extra error checks to libroot_build's dup() seems to fix the crash, but then mimeset seems to be stuck in a loop and never completes. So the problem appears to be elsewhere.

comment:7 by waddlesplash, 3 years ago

The problem is really in the Storage Kit, it appears. With -O0 or -O1 in libbe_build storage Jamfile, mimeset works. With -O2, it loops forever (runs out of FDs and then just keeps going.)

comment:8 by waddlesplash, 3 years ago

I've narrowed it down to Directory.cpp. Adding this line to storage/Jamfile avoids the problem:

C++FLAGS on [ FGristFiles Directory.o ] += -O1 ;

Changing it to O2 triggers the problem.

comment:9 by mbrumbelow, 3 years ago

Could this be because of a change in the compiler from GCC 8 to 11?

comment:10 by waddlesplash, 3 years ago

Yes.

The culprit function appears to be BDirectory::GetNextRef(entry_ref* ref). Using pragmas to build just this function at -O1 solves the problem.

comment:11 by waddlesplash, 3 years ago

Resolution: fixed
Status: newclosed

Fixed in hrev55647.

Note: See TracTickets for help on using tickets.