public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgcc/57085] New: Segmentation Fault when building a c file
@ 2013-04-26 18:23 synergye at codefi dot re
  2013-04-27 22:54 ` [Bug libgcc/57085] " synergye at codefi dot re
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: synergye at codefi dot re @ 2013-04-26 18:23 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57085

             Bug #: 57085
           Summary: Segmentation Fault when building a c file
    Classification: Unclassified
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libgcc
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: synergye@codefi.re


GCC head is at "PR go/57045." I receive the following segmentation fault while
building system/extras of android. The flags gcc was built with are as follows:
--with-float=soft --with-fpu=neon --with-arch=armv7-a --enable-target-optspace
--with-abi=aapcs --disable-libssp --enable-threads --disable-nls
--disable-libmudflap --disable-libgomp --disable-libstdc__-v3
--disable-sjlj-exceptions --disable-shared --disable-tls --disable-libitm
--disable-libquadmath --disable-libatomic.

Here's the error and backtrace:

system/extras/ext4_utils/contents.c:162:1: internal compiler error:
Segmentation fault
 }
0x974095 crash_signal
        ../../../build/../gcc/gcc-4.9/gcc/toplev.c:333
0x8d68ea reload_cse_simplify_operands
        ../../../build/../gcc/gcc-4.9/gcc/postreload.c:655
0x8d6f3c reload_cse_simplify
        ../../../build/../gcc/gcc-4.9/gcc/postreload.c:123
0x8d6f3c reload_cse_regs_1
        ../../../build/../gcc/gcc-4.9/gcc/postreload.c:220
0x8d71a8 reload_cse_regs
        ../../../build/../gcc/gcc-4.9/gcc/postreload.c:75
0x8d71a8 rest_of_handle_postreload
        ../../../build/../gcc/gcc-4.9/gcc/postreload.c:2294
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

The code in contents.c is as follows:
u32 make_directory(u32 dir_inode_num, u32 entries, struct dentry *dentries,
        u32 dirs)
{
        struct ext4_inode *inode;
        u32 blocks;
        u32 len;
        u32 offset = 0;
        u32 inode_num;
        u8 *data;
        unsigned int i;
        struct ext4_dir_entry_2 *dentry;

        blocks = DIV_ROUND_UP(dentry_size(entries, dentries), info.block_size);
        len = blocks * info.block_size;

        if (dir_inode_num) {
                inode_num = allocate_inode(info);
        } else {
                dir_inode_num = EXT4_ROOT_INO;
                inode_num = EXT4_ROOT_INO;
        }

        if (inode_num == EXT4_ALLOCATE_FAILED) {
                error("failed to allocate inode\n");
                return EXT4_ALLOCATE_FAILED;
        }

        add_directory(inode_num);

        inode = get_inode(inode_num);
        if (inode == NULL) {
                error("failed to get inode %u", inode_num);
                return EXT4_ALLOCATE_FAILED;
        }

        data = inode_allocate_data_extents(inode, len, len);
        if (data == NULL) {
                error("failed to allocate %u extents", len);
                return EXT4_ALLOCATE_FAILED;
        }

        inode->i_mode = S_IFDIR;
        inode->i_links_count = dirs + 2;
        inode->i_flags |= aux_info.default_i_flags;

        dentry = NULL;

        dentry = add_dentry(data, &offset, NULL, inode_num, ".", EXT4_FT_DIR);
        if (!dentry) {
                error("failed to add . directory");
                return EXT4_ALLOCATE_FAILED;
        }

        for (i = 0; i < entries; i++) {
                dentry = add_dentry(data, &offset, dentry, 0,
                                dentries[i].filename, dentries[i].file_type);
                if (offset > len || (offset == len && i != entries - 1))
                        critical_error("internal error: dentry for %s ends at
%d, past %d\n",
                                dentries[i].filename, offset, len);
                dentries[i].inode = &dentry->inode;
                if (!dentry) {
                        error("failed to add directory");
                        return EXT4_ALLOCATE_FAILED;
                }
        }

        /* pad the last dentry out to the end of the block */
        dentry->rec_len += len - offset;

        return inode_num;
}

^^^^ The last line is line 162. 
Thank you


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2013-05-03  9:23 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-26 18:23 [Bug libgcc/57085] New: Segmentation Fault when building a c file synergye at codefi dot re
2013-04-27 22:54 ` [Bug libgcc/57085] " synergye at codefi dot re
2013-04-28  9:11 ` mikpe at it dot uu.se
2013-04-28 10:18 ` ubizjak at gmail dot com
2013-04-28 10:18 ` synergye at codefi dot re
2013-04-28 13:41 ` mikpe at it dot uu.se
2013-04-28 17:51 ` synergye at codefi dot re
2013-04-28 18:08 ` mikpe at it dot uu.se
2013-04-28 22:20 ` synergye at codefi dot re
2013-04-29 19:30 ` mikpe at it dot uu.se
2013-04-29 21:13 ` synergye at codefi dot re
2013-05-03  9:23 ` synergye at codefi dot re

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).