This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/45724] New: segmentation fault occurs when printing string if -malign-double option is used


J.P. Malhado originally reported this bug in Debian BTS as
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=518642.

debian_chroot:sid:kusumanchi:/home/518642# cat string.f90 
write(6,*) 'string1'
write(6,'(A)') 'string2'
end

debian_chroot:sid:kusumanchi:/home/518642# /usr/lib/gcc-snapshot/bin/gfortran
-g -malign-double string.f90 

debian_chroot:sid:kusumanchi:/home/518642# ./a.out 
 string1
Segmentation fault (core dumped)

The segmentation fault does not occur if the -malign-double option is not used.

It is reproducible in gfortran 4.3.2, 4.3.5, 4.4.4, 4.5.1 and 4.6.0.


debian_chroot:sid:kusumanchi:/home/518642# /usr/lib/gcc-snapshot/bin/gfortran
-v
Using built-in specs.                                                           
COLLECT_GCC=/usr/lib/gcc-snapshot/bin/gfortran                                  
COLLECT_LTO_WRAPPER=/usr/lib/gcc-snapshot/libexec/gcc/i486-linux-gnu/4.6.0/lto-wrapper 
Target: i486-linux-gnu                                                          
Configured with: ../src/configure -v --with-pkgversion='Debian 20100828-1'
--with-bugurl=file:///usr/share/doc/gcc-snapshot/README.Bugs
--enable-languages=c,ada,c++,fortran,objc,obj-c++
--prefix=/usr/lib/gcc-snapshot --enable-shared --enable-multiarch
--enable-linker-build-id --with-system-zlib --disable-nls --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin
--enable-gold --with-plugin-ld=ld.gold --enable-objc-gc --enable-targets=all
--with-arch-32=i586 --with-tune=generic --disable-werror --enable-checking=yes
--build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu            
Thread model: posix                                                             
gcc version 4.6.0 20100828 (experimental) [trunk revision 163616] (Debian
20100828-1)        

debian_chroot:sid:kusumanchi:/home/518642# gdb -q ./a.out                       
Reading symbols from /home/518642/a.out...done.                                 
(gdb) r                                                                         
Starting program: /home/518642/a.out                                            
 string1                                                                        

Program received signal SIGSEGV, Segmentation fault.                            
format_hash (dtp=0xbffffb50) at ../../../src/libgfortran/io/format.c:152        
152     ../../../src/libgfortran/io/format.c: No such file or directory.        
        in ../../../src/libgfortran/io/format.c                                 
(gdb)bt                                                                         
#0  format_hash (dtp=0xbffffb50) at ../../../src/libgfortran/io/format.c:152    
#1  find_parsed_format (dtp=0xbffffb50) at
../../../src/libgfortran/io/format.c:189          
#2  parse_format (dtp=0xbffffb50) at ../../../src/libgfortran/io/format.c:1228  
#3  0x400c3610 in data_transfer_init (dtp=0xbffffb50, read_flag=0)              
    at ../../../src/libgfortran/io/transfer.c:2227                              
#4  0x08048619 in MAIN__ () at string.f90:2


thanks
raju


-- 
           Summary: segmentation fault occurs when printing string if -
                    malign-double option is used
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: kamaraju at gmail dot com


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]