qiqian / webp

Automatically exported from code.google.com/p/webp
0 stars 0 forks source link

MinGW SSE2 segfault #244

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. compile library under mingw
2. sometimes you will get segfault error

starting from 0.4.1 program can crash on sse2 instructions(0.4.3 for me in 
dec_sse2.c line 180)

problem looks like described here 
http://stackoverflow.com/questions/6716654/segmentation-fault-using-openmp-and-s
se

Original issue reported on code.google.com by newn...@gmail.com on 8 Mar 2015 at 9:55

GoogleCodeExporter commented 8 years ago
What does your mingw setup look like?
Are you using mingw-w64, msys 1.0, msys 2.0? gcc version?

Original comment by jz...@google.com on 10 Mar 2015 at 11:23

GoogleCodeExporter commented 8 years ago
I haven't been able to reproduce this with 32-bit builds of dwebp using 
gcc-4.2.1, gcc-4.5.0 or gcc-4.6.2.
Does setting CFLAGS='-O2 -g -mstackrealign' help in your case? Do you have a 
particular file that consistently crashes?

Original comment by jz...@google.com on 11 Mar 2015 at 1:35

GoogleCodeExporter commented 8 years ago
hmmm... does the program crashes always at the same line/instruction? Or at 
random location? Always during some sse2 instructions?

Original comment by s...@google.com on 11 Mar 2015 at 7:11

GoogleCodeExporter commented 8 years ago
Program crash on same place but not ever time the problem is than there is no 
guaranty that stack will not be aligned on 16 byte
I can be reproduced on any MinGW build even msys or msys2 
Yes -mstackrealign help but it will case some performance penalty, it is enough 
to align stack only on DecodeInto()
something like
#ifdef __MINGW32__ 
__attribute__ ((force_align_arg_pointer)) 
#endif
static VP8StatusCode DecodeInto(....

Original comment by newn...@gmail.com on 14 Mar 2015 at 7:51

GoogleCodeExporter commented 8 years ago
@newnon do you have a sample image that can be used in testing this bug?

Original comment by timothygu99 on 14 Mar 2015 at 9:13