bad code with gcc-4.3 and lzma-utils ?

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

 



if you build lzma-4.32.7 with gcc-4.3 and -march=2.0, then lzma segfaults when 
trying to do anything useful.  gcc-4.1 has no problem here.

to reproduce, just download lzma-4.32.7.tar.gz and do:
tar xf lzma-4.32.7.tar.gz
cd lzma-4.32.7
CXXFLAGS='-O1 -march=2.0 -g' ./configure
make
make check

Guy Martin narrowed it down to the code in src/sdk/7zip/Compress/LZMA/ ... if 
we build the encoder/decoder without -march=2.0, then the tests pass and life 
is peachy.  with a little bit of patience, i think i narrowed down a bit 
further to the function CDecoder::SetDecoderProperties2().  we can build the 
rest of the file with -march=2.0, but when we build this function with -
march=2.0, then it craps out.  the code in question has a bit of funky casting 
from a byte array up to uint32's, but i dont think this is an alignment issue.

i'm attaching the preprocessed file which can then be compared:
g++ -O1 -c LZMADecoder.i -march=2.0 -o LZMADecoder.bad.o
g++ -O1 -c LZMADecoder.i -o LZMADecoder.good.o

the kernel logs the fault like so:
do_page_fault() pid=15903 command='lzma' type=15 address=0x00000063

     YZrvWESTHLNXBCVMcbcbcbcbOGFRQPDI
PSW: 00000000000001000000000000001111 Not tainted
r00-03  0004000f 0001b800 0001c217 00000005
r04-07  000320e8 00356e06 00000019 00040000
r08-11  000320b0 fb12c810 fb12c6c4 00000000
r12-15  fb12c6c0 00000000 00030790 fb12c010
r16-19  00030794 00029d74 0002a8a8 00000063
r20-23  00000000 00000400 00000003 fb12c9c8
r24-27  00100000 4008f008 00000003 0002fcbc
r28-31  00000060 00000000 fb12c980 00000000
sr00-03  00000006 00000000 00000000 00000006
sr04-07  00000006 00000006 00000006 00000006

      VZOUICununcqcqcqcqcqcrmunTDVZOUI
FPSR: 00000000000000000000000000000000
FPER1: 00000000
fr00-03  0000000000000000 0000000000000000 0000000000000000 0000000000000000
fr04-07  1267d000cfed0968 00000020101683f0 106238101061f810 bff0000000000000
fr08-11  fffff0001267d000 0000000200000003 0000000012729840 ffffff9c00000002
fr12-15  fb6ab02c00000001 000cc542101737c8 10101a281061f810 126840883b9aca00
fr16-19  104aed9c106238a8 fffffff412684208 105902f6105902f7 000000000000000b
fr20-23  1055d8100000000f 1055d810101687b4 0000000800000002 00001c2c00000000
fr24-27  0000000000000000 000000004ccd4eed fce2fc640b19f33d 8c4f289cb1314a9a
fr28-31  0701fb1163036696 8a9012eac57c0709 0701fb1100000228 0a4ed1f910111908

IASQ: 00000006 00000006 IAOQ: 0001b9f3 0001b9f7
 IIR: 0e751280    ISR: 00000006  IOR: 00000063
 CPU:        0   CR30: 93704000 CR31: 10600000
 ORIG_R28: 00000000
 IAOQ[0]: 0x1b9f0
 IAOQ[1]: 0x1b9f4
 RP(r2): 0x1c214
-mike

Attachment: LZMADecoder.i.bz2
Description: application/bzip

Attachment: signature.asc
Description: This is a digitally signed message part.


[Index of Archives]     [Linux SoC]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux