public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/13685] New: Building KDE3.2 clock applet with -march=pentium3 -O1 gives SIGSEGV
@ 2004-01-14 18:28 roger dot larsson at norran dot net
  2004-01-14 18:33 ` [Bug c++/13685] " roger dot larsson at norran dot net
                   ` (10 more replies)
  0 siblings, 11 replies; 13+ messages in thread
From: roger dot larsson at norran dot net @ 2004-01-14 18:28 UTC (permalink / raw)
  To: gcc-bugs

See (lots of confusion...) 
 http://bugs.kde.org/show_bug.cgi?id=70655 
 
I will attach source and assembly.

-- 
           Summary: Building KDE3.2 clock applet with -march=pentium3 -O1
                    gives SIGSEGV
           Product: gcc
           Version: 3.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: roger dot larsson at norran dot net
                CC: gcc-bugs at gcc dot gnu dot org


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


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

* [Bug c++/13685] Building KDE3.2 clock applet with -march=pentium3 -O1 gives SIGSEGV
  2004-01-14 18:28 [Bug c++/13685] New: Building KDE3.2 clock applet with -march=pentium3 -O1 gives SIGSEGV roger dot larsson at norran dot net
@ 2004-01-14 18:33 ` roger dot larsson at norran dot net
  2004-01-14 18:34 ` [Bug target/13685] " pinskia at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: roger dot larsson at norran dot net @ 2004-01-14 18:33 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From roger dot larsson at norran dot net  2004-01-14 18:33 -------
Created an attachment (id=5487)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=5487&action=view)
c++ source from kde/kdebase/kicker/applets/clock/

crash at line 536

-- 


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


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

* [Bug target/13685] Building KDE3.2 clock applet with -march=pentium3 -O1 gives SIGSEGV
  2004-01-14 18:28 [Bug c++/13685] New: Building KDE3.2 clock applet with -march=pentium3 -O1 gives SIGSEGV roger dot larsson at norran dot net
  2004-01-14 18:33 ` [Bug c++/13685] " roger dot larsson at norran dot net
@ 2004-01-14 18:34 ` pinskia at gcc dot gnu dot org
  2004-01-14 19:51 ` roger dot larsson at norran dot net
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-01-14 18:34 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-01-14 18:34 -------
I think the problem is that the stack is unaligned causing the problem, I know there is another bug 
for that, if that is the bug, can you just mark it as a dup, I think it is suspended.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c++                         |target


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


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

* [Bug target/13685] Building KDE3.2 clock applet with -march=pentium3 -O1 gives SIGSEGV
  2004-01-14 18:28 [Bug c++/13685] New: Building KDE3.2 clock applet with -march=pentium3 -O1 gives SIGSEGV roger dot larsson at norran dot net
  2004-01-14 18:33 ` [Bug c++/13685] " roger dot larsson at norran dot net
  2004-01-14 18:34 ` [Bug target/13685] " pinskia at gcc dot gnu dot org
@ 2004-01-14 19:51 ` roger dot larsson at norran dot net
  2004-01-14 23:50 ` roger dot larsson at norran dot net
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: roger dot larsson at norran dot net @ 2004-01-14 19:51 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From roger dot larsson at norran dot net  2004-01-14 19:51 -------
Created an attachment (id=5489)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=5489&action=view)
Assembly output

Crashes at this line when compiled with -march=pentium3 [-mcpu=pentium3] -O1
(There is only one movaps...)

	0x41a8867b AnalogClock::paintEvent   movaps %xmm0,0xfffffc78(%ebp)

where

ebp	       0xbfffea60	0xbfffea60

This will generate a non 16 byte aligned access!!!
=> Crash

-- 


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


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

* [Bug target/13685] Building KDE3.2 clock applet with -march=pentium3 -O1 gives SIGSEGV
  2004-01-14 18:28 [Bug c++/13685] New: Building KDE3.2 clock applet with -march=pentium3 -O1 gives SIGSEGV roger dot larsson at norran dot net
                   ` (2 preceding siblings ...)
  2004-01-14 19:51 ` roger dot larsson at norran dot net
@ 2004-01-14 23:50 ` roger dot larsson at norran dot net
  2004-01-16 16:00 ` thiagom at mail dot com
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: roger dot larsson at norran dot net @ 2004-01-14 23:50 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From roger dot larsson at norran dot net  2004-01-14 23:50 -------
Code is not from a lib, it is generated by gcc. 
=> I do not think this is a DUP of bug 10395 
 
I did a little script to search for the problems. 
# /bin/bash 
# Filename: objdump_find_problematic 
 
grep_sse () 
{ 
	grep $1 "\(\(mov\(ap\|up\|ntp\)\|shufp\|unpck\(hp\|lp\)\|\(add\|\mul\|
div\|and\|andn\|or\|xor\|max\|min\|cmp\.\.\|sqrt\|rsqrt\|rcp\)p\)s\|
\(cvt\(ps2pi\|ss2pi\)\)\)" 
} 
 
if objdump -d $1 | grep_sse -q ; then 
   echo $1 
   objdump -d $1 | grep_sse 
fi 
 
and run my complete installation of kdecvs (-Os -march=pentium3) through it. 
 
# find /opt/kdecvs/ -type f -perm +111 | xargs -n 1 
bin/objdump_find_problematic | tee problematic.sse 
 
Among those found where 
	kfiresaver3d starting it will crash at a unaligned movaps 
	 (actual code from glibc-2.3) 
 
Complete list, some are OK with aligned offset: 
 
# more problematic.sse | grep "0x\|opt" 
/opt/kdecvs/bin/kdm_greet 
 805e5ac:       0f 29 85 98 fc ff ff    movaps %xmm0,0xfffffc98(%ebp) 
/opt/kdecvs/bin/keuphoria.kss 
 804fe6e:       0f 29 45 e0             movaps %xmm0,0xffffffe0(%ebp) 
 80500fd:       0f 29 45 d0             movaps %xmm0,0xffffffd0(%ebp) 
/opt/kdecvs/bin/kfiresaver3d 
 80502ac:       0f 29 85 7c ff ff ff    movaps %xmm0,0xffffff7c(%ebp) 
 8050529:       0f 29 85 64 ff ff ff    movaps %xmm0,0xffffff64(%ebp) 
/opt/kdecvs/lib/libartsflow.so.1.0.0 
/opt/kdecvs/lib/kde3/kdeprint_cups.so 
   4042d:       0f 29 45 8c             movaps %xmm0,0xffffff8c(%ebp) 
/opt/kdecvs/lib/kde3/kcm_clock.so 
    e294:       0f 29 85 20 fe ff ff    movaps %xmm0,0xfffffe20(%ebp) 
/opt/kdecvs/lib/kde3/libkiviopart.so 
   f8a94:       0f 29 45 a8             movaps %xmm0,0xffffffa8(%ebp) 
   f8d47:       0f 29 45 80             movaps %xmm0,0xffffff80(%ebp) 
   f90ad:       0f 29 85 5c ff ff ff    movaps %xmm0,0xffffff5c(%ebp) 
   fa0ac:       0f 29 45 a8             movaps %xmm0,0xffffffa8(%ebp) 
   fa305:       0f 29 45 a4             movaps %xmm0,0xffffffa4(%ebp) 
/opt/kdecvs/lib/kde3/libkpovmodelerpart.so.0.0.0 
/opt/kdecvs/lib/libkdefx.so.4.2.0 
/opt/kdecvs/lib/libnoatunarts.so 
   576d8:       0f 10 51 10             movups 0x10(%ecx),%xmm2 
   576dc:       0f c6 d2 00             shufps $0x0,%xmm2,%xmm2 
   576e0:       0f 10 61 14             movups 0x14(%ecx),%xmm4 
   576e4:       0f 10 69 24             movups 0x24(%ecx),%xmm5 
   57720:       0f c6 c8 b1             shufps $0xb1,%xmm0,%xmm1 
   57737:       0f c6 c5 24             shufps $0x24,%xmm5,%xmm0 
   5773b:       0f c6 e8 81             shufps $0x81,%xmm0,%xmm5 
   57743:       0f c6 db 39             shufps $0x39,%xmm3,%xmm3 
   57747:       0f c6 f6 39             shufps $0x39,%xmm6,%xmm6 
   57752:       0f 11 69 24             movups %xmm5,0x24(%ecx) 
   60ea4:       0f c6 c9 00             shufps $0x0,%xmm1,%xmm1 
   60ee6:       0f c6 c2 00             shufps $0x0,%xmm2,%xmm0 
   60ef5:       0f c6 c0 02             shufps $0x2,%xmm0,%xmm0 
 
This is a BIG problem! (kivio, and kfiresaver3d have been verified to crash) 

-- 


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


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

* [Bug target/13685] Building KDE3.2 clock applet with -march=pentium3 -O1 gives SIGSEGV
  2004-01-14 18:28 [Bug c++/13685] New: Building KDE3.2 clock applet with -march=pentium3 -O1 gives SIGSEGV roger dot larsson at norran dot net
                   ` (3 preceding siblings ...)
  2004-01-14 23:50 ` roger dot larsson at norran dot net
@ 2004-01-16 16:00 ` thiagom at mail dot com
  2004-01-18 18:07 ` dhazeghi at yahoo dot com
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: thiagom at mail dot com @ 2004-01-16 16:00 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |thiagom at mail dot com


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


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

* [Bug target/13685] Building KDE3.2 clock applet with -march=pentium3 -O1 gives SIGSEGV
  2004-01-14 18:28 [Bug c++/13685] New: Building KDE3.2 clock applet with -march=pentium3 -O1 gives SIGSEGV roger dot larsson at norran dot net
                   ` (4 preceding siblings ...)
  2004-01-16 16:00 ` thiagom at mail dot com
@ 2004-01-18 18:07 ` dhazeghi at yahoo dot com
  2004-01-19  6:38 ` roger dot larsson at norran dot net
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: dhazeghi at yahoo dot com @ 2004-01-18 18:07 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dhazeghi at yahoo dot com  2004-01-18 18:07 -------
Your report seems to indicate that the problematic asm is produced all over the
place. Can you either provide preprocessed source, or (better, and if the
problem is widespread, should not be too difficult) a small, self-contained
testcase? Thanks.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING


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


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

* [Bug target/13685] Building KDE3.2 clock applet with -march=pentium3 -O1 gives SIGSEGV
  2004-01-14 18:28 [Bug c++/13685] New: Building KDE3.2 clock applet with -march=pentium3 -O1 gives SIGSEGV roger dot larsson at norran dot net
                   ` (5 preceding siblings ...)
  2004-01-18 18:07 ` dhazeghi at yahoo dot com
@ 2004-01-19  6:38 ` roger dot larsson at norran dot net
  2004-01-19  8:11 ` roger dot larsson at norran dot net
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: roger dot larsson at norran dot net @ 2004-01-19  6:38 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From roger dot larsson at norran dot net  2004-01-19 06:38 -------
I am currently trying to create a testcase - the instructions gets generated 
but I do not get it unaligned - to crash... 
 
-O1 -march=pentium3 
 
Gives the instructions (movaps) 
 
-O1 -march=pentium3 -mno-sse 
 
Is needed to avoid them. 
 

-- 


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


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

* [Bug target/13685] Building KDE3.2 clock applet with -march=pentium3 -O1 gives SIGSEGV
  2004-01-14 18:28 [Bug c++/13685] New: Building KDE3.2 clock applet with -march=pentium3 -O1 gives SIGSEGV roger dot larsson at norran dot net
                   ` (6 preceding siblings ...)
  2004-01-19  6:38 ` roger dot larsson at norran dot net
@ 2004-01-19  8:11 ` roger dot larsson at norran dot net
  2004-01-19 10:42   ` Jan Hubicka
  2004-01-19 10:42 ` hubicka at ucw dot cz
                   ` (2 subsequent siblings)
  10 siblings, 1 reply; 13+ messages in thread
From: roger dot larsson at norran dot net @ 2004-01-19  8:11 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From roger dot larsson at norran dot net  2004-01-19 08:11 -------
This is the shortest code yet (matrix.cpp) I found that generates the 
offending instruction (movaps) - but I have not yet succeeded in getting 
the stack unaligned... [Do you need that too?] 
 
class RTime 
{ 
public: 
    int minute() {} 
}; 
 
void rotate(float x) 
{ 
} 
 
int main() 
{ 
    RTime _time; 
 
    // hour 
    float h_angle = _time.minute(); 
    rotate(-h_angle); 
 
    // minute 
    float m_angle = _time.minute(); 
    rotate(-m_angle); 
} 
 
I am pretty sure that Qt should be simple to  
Compile with: 
gcc -I/usr/src/kde/qt-copy/mkspecs/linux-g++ -I../../include -o matrix.o 
-march=pentium3 -O1 matrix.cpp 

-- 


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


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

* Re: [Bug target/13685] Building KDE3.2 clock applet with -march=pentium3 -O1 gives SIGSEGV
  2004-01-19  8:11 ` roger dot larsson at norran dot net
@ 2004-01-19 10:42   ` Jan Hubicka
  0 siblings, 0 replies; 13+ messages in thread
From: Jan Hubicka @ 2004-01-19 10:42 UTC (permalink / raw)
  To: roger dot larsson at norran dot net; +Cc: gcc-bugs

> 
> ------- Additional Comments From roger dot larsson at norran dot net  2004-01-19 08:11 -------
> This is the shortest code yet (matrix.cpp) I found that generates the 
> offending instruction (movaps) - but I have not yet succeeded in getting 
> the stack unaligned... [Do you need that too?] 

Roger,
I am not able to reproduce it from your testcase, but sending the
assembly file produces with g++ -O1 -march=pentium3 -dp -S will probably
give me enough information to fix it.

Thanks!
Honza
>  
> class RTime 
> { 
> public: 
>     int minute() {} 
> }; 
>  
> void rotate(float x) 
> { 
> } 
>  
> int main() 
> { 
>     RTime _time; 
>  
>     // hour 
>     float h_angle = _time.minute(); 
>     rotate(-h_angle); 
>  
>     // minute 
>     float m_angle = _time.minute(); 
>     rotate(-m_angle); 
> } 
>  
> I am pretty sure that Qt should be simple to  
> Compile with: 
> gcc -I/usr/src/kde/qt-copy/mkspecs/linux-g++ -I../../include -o matrix.o 
> -march=pentium3 -O1 matrix.cpp 
> 
> -- 
> 
> 
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13685


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

* [Bug target/13685] Building KDE3.2 clock applet with -march=pentium3 -O1 gives SIGSEGV
  2004-01-14 18:28 [Bug c++/13685] New: Building KDE3.2 clock applet with -march=pentium3 -O1 gives SIGSEGV roger dot larsson at norran dot net
                   ` (7 preceding siblings ...)
  2004-01-19  8:11 ` roger dot larsson at norran dot net
@ 2004-01-19 10:42 ` hubicka at ucw dot cz
  2004-01-19 12:48 ` roger dot larsson at norran dot net
  2005-01-07  9:49 ` [Bug target/13685] Building simple test application with -march=pentium3 -Os gives SIGSEGV (unaligned sse instruction) roger dot larsson at norran dot net
  10 siblings, 0 replies; 13+ messages in thread
From: hubicka at ucw dot cz @ 2004-01-19 10:42 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From hubicka at ucw dot cz  2004-01-19 10:42 -------
Subject: Re:  Building KDE3.2 clock applet with -march=pentium3 -O1 gives SIGSEGV

> 
> ------- Additional Comments From roger dot larsson at norran dot net  2004-01-19 08:11 -------
> This is the shortest code yet (matrix.cpp) I found that generates the 
> offending instruction (movaps) - but I have not yet succeeded in getting 
> the stack unaligned... [Do you need that too?] 

Roger,
I am not able to reproduce it from your testcase, but sending the
assembly file produces with g++ -O1 -march=pentium3 -dp -S will probably
give me enough information to fix it.

Thanks!
Honza
>  
> class RTime 
> { 
> public: 
>     int minute() {} 
> }; 
>  
> void rotate(float x) 
> { 
> } 
>  
> int main() 
> { 
>     RTime _time; 
>  
>     // hour 
>     float h_angle = _time.minute(); 
>     rotate(-h_angle); 
>  
>     // minute 
>     float m_angle = _time.minute(); 
>     rotate(-m_angle); 
> } 
>  
> I am pretty sure that Qt should be simple to  
> Compile with: 
> gcc -I/usr/src/kde/qt-copy/mkspecs/linux-g++ -I../../include -o matrix.o 
> -march=pentium3 -O1 matrix.cpp 
> 
> -- 
> 
> 
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13685


-- 


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


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

* [Bug target/13685] Building KDE3.2 clock applet with -march=pentium3 -O1 gives SIGSEGV
  2004-01-14 18:28 [Bug c++/13685] New: Building KDE3.2 clock applet with -march=pentium3 -O1 gives SIGSEGV roger dot larsson at norran dot net
                   ` (8 preceding siblings ...)
  2004-01-19 10:42 ` hubicka at ucw dot cz
@ 2004-01-19 12:48 ` roger dot larsson at norran dot net
  2005-01-07  9:49 ` [Bug target/13685] Building simple test application with -march=pentium3 -Os gives SIGSEGV (unaligned sse instruction) roger dot larsson at norran dot net
  10 siblings, 0 replies; 13+ messages in thread
From: roger dot larsson at norran dot net @ 2004-01-19 12:48 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From roger dot larsson at norran dot net  2004-01-19 12:48 -------
I guess no more WAITING is needed -> NEW 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW
     Ever Confirmed|                            |1


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


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

* [Bug target/13685] Building simple test application with -march=pentium3 -Os gives SIGSEGV (unaligned sse instruction)
  2004-01-14 18:28 [Bug c++/13685] New: Building KDE3.2 clock applet with -march=pentium3 -O1 gives SIGSEGV roger dot larsson at norran dot net
                   ` (9 preceding siblings ...)
  2004-01-19 12:48 ` roger dot larsson at norran dot net
@ 2005-01-07  9:49 ` roger dot larsson at norran dot net
  10 siblings, 0 replies; 13+ messages in thread
From: roger dot larsson at norran dot net @ 2005-01-07  9:49 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From roger dot larsson at norran dot net  2005-01-07 09:49 -------
Got a query about this bug...   
   
It is still valid for gcc 3.3.4   
My computer has been upgraded to a athlon-xp, so I tested both   
   
g++ -Os -march=pentium3 matrix.cpp -o matrix   
 and   
g++ -Os -march=athlon-xp matrix.cpp -o matrix   
   
they both gives Segmentation fault when running   
./matrix   
   
Other optimization levels works.  
   
Updated summary etc.  
   

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
           Priority|P2                          |P1
            Summary|Building KDE3.2 clock applet|Building simple test
                   |with -march=pentium3 -O1    |application with -
                   |gives SIGSEGV               |march=pentium3 -Os gives
                   |                            |SIGSEGV (unaligned sse
                   |                            |instruction)
            Version|3.3.1                       |3.3.4


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


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

end of thread, other threads:[~2005-01-07  9:49 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-14 18:28 [Bug c++/13685] New: Building KDE3.2 clock applet with -march=pentium3 -O1 gives SIGSEGV roger dot larsson at norran dot net
2004-01-14 18:33 ` [Bug c++/13685] " roger dot larsson at norran dot net
2004-01-14 18:34 ` [Bug target/13685] " pinskia at gcc dot gnu dot org
2004-01-14 19:51 ` roger dot larsson at norran dot net
2004-01-14 23:50 ` roger dot larsson at norran dot net
2004-01-16 16:00 ` thiagom at mail dot com
2004-01-18 18:07 ` dhazeghi at yahoo dot com
2004-01-19  6:38 ` roger dot larsson at norran dot net
2004-01-19  8:11 ` roger dot larsson at norran dot net
2004-01-19 10:42   ` Jan Hubicka
2004-01-19 10:42 ` hubicka at ucw dot cz
2004-01-19 12:48 ` roger dot larsson at norran dot net
2005-01-07  9:49 ` [Bug target/13685] Building simple test application with -march=pentium3 -Os gives SIGSEGV (unaligned sse instruction) roger dot larsson at norran dot net

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).