NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: port-arm/47798: [arm-netbsdelf] /usr/pkgsrc/net/mikutter:core/mui/gtk_web_image_loader.rb:242: [BUG] Segmentation fault

The following reply was made to PR port-arm/47798; it has been noted by GNATS.

From: Izumi Tsutsui <>
Subject: Re: port-arm/47798: [arm-netbsdelf] 
         [BUG] Segmentation fault
Date: Sun, 16 Jun 2013 15:28:18 +0900

 According to analysis by a libpng guy, this is a bug of
 gcc-4.5.3 -fipa-sra optimization on ARM:
 --- snip ---
 I can confirm that it is a compiler bug in gcc 4.5.3.  The bug does not
 happen in 4.6.3, I haven't checked 4.5.4.  The bug can be avoided by
 compiling with -fno-ipa-sra (and I would guess this applies to the Bison
 problem too.)
 The bug happens somewhere inside png_chunk_warning and almost certainly in
 png_chunk_error as well.  The call to png_format_buffer has been
 'optimized' to pass png_ptr->chunk_name rather than png_ptr in the first
 argument; the optimization actually increases code size (by 4 bytes) but
 may have pipeline benefits on some architectures.  After png_format_buffer
 returns (successfully formatting the message) png_warning is called with a
 bogus value for png_ptr; on my system png_ptr is 0x5 and this leads to an
 immediate crash.
 The bug seems to be in png_format_buffer; it fails to preserve register
 r4.  In fact it fails to preserve a lot of registers that it should
 preserve - it looks totally broken to me.  The problem optimization is
 -fipa-sra (presumably the part that converts parameters passed by reference
 to ones passed by value), if I compile with -fno-ipa-sra the bug
 disappears, and, with -Os, the code size of drops from 152903
 bytes to 152887 bytes.
 --- snip ---
 With a quick glance, I can't see which changes after 4.5.3 are
 actually affected to this problem so backporting is not easy.
 I'll change the synopsis of this PR (i.e. gcc bug) to reflect this analysis.
 I wonder if we should specify -fno-ipa-sra by default at least for arm.
 opensuse has a patch for gcc-4.5.3 package that disable -fno-ipa-sra
 even if -O2 is specified and they say -fipa-sra makes debugging harder.
 Izumi Tsutsui

Home | Main Index | Thread Index | Old Index