public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "vital.had at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/107590] __atomic_test_and_set broken on PowerPC
Date: Thu, 10 Nov 2022 18:24:16 +0000	[thread overview]
Message-ID: <bug-107590-4-qyMsmYJY0z@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-107590-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107590

--- Comment #12 from Sergey Fedorov <vital.had at gmail dot com> ---
(In reply to Andrew Pinski from comment #2)
> >Reason: 259 at address: 0x00003109
> 
> Yes that does seem like an alignment disagreement.
> 
> I suspect the code is broken for allocation and it is allocating unaligned
> structs.
> 
> Also inside gdb can you do the following:
> 
> disassemble $pc-0x10 $pc+0x10
> info registers

Here:

(gdb) run
Starting program: /Users/svacchanda/Dev/boost/a.out 
Reading symbols for shared libraries ++++.. done

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: 259 at address: 0x0000208d
0x00001b38 in boost::detail::spinlock::try_lock (this=0x208d) at
spinlock_gcc_atomic.hpp:39
39              return __atomic_test_and_set( &v_, __ATOMIC_ACQUIRE ) == 0;
(gdb) disassemble $pc-0x10 $pc+0x10
Dump of assembler code from 0x1b28 to 0x1b48:
0x00001b28 <_ZN5boost6detail8spinlock8try_lockEv+8>:    mr      r30,r1
0x00001b2c <_ZN5boost6detail8spinlock8try_lockEv+12>:   stw     r3,72(r30)
0x00001b30 <_ZN5boost6detail8spinlock8try_lockEv+16>:   lwz     r2,72(r30)
0x00001b34 <_ZN5boost6detail8spinlock8try_lockEv+20>:   li      r9,1
0x00001b38 <_ZN5boost6detail8spinlock8try_lockEv+24>:   lwarx   r10,0,r2
0x00001b3c <_ZN5boost6detail8spinlock8try_lockEv+28>:   stwcx.  r9,0,r2
0x00001b40 <_ZN5boost6detail8spinlock8try_lockEv+32>:   bne-    0x1b38
<_ZN5boost6detail8spinlock8try_lockEv+24>
0x00001b44 <_ZN5boost6detail8spinlock8try_lockEv+36>:   isync
End of assembler dump.
(gdb) info registers
r0             0x19c4   6596
r1             0xbffff9f0       3221223920
r2             0x208d   8333
r3             0x208d   8333
r4             0xbffffb30       3221224240
r5             0xbffffb38       3221224248
r6             0xbffffb88       3221224328
r7             0xc      12
r8             0x0      0
r9             0x1      1
r10            0x0      0
r11            0x2048   8264
r12            0x1b20   6944
r13            0x0      0
r14            0x0      0
r15            0x0      0
r16            0x0      0
r17            0x0      0
r18            0x0      0
r19            0x0      0
r20            0x0      0
r21            0x0      0
r22            0x0      0
r23            0x0      0
r24            0x0      0
r25            0x0      0
r26            0xbffffb2c       3221224236
r27            0x8      8
r28            0x0      0
r29            0x0      0
r30            0xbffff9f0       3221223920
r31            0x19a8   6568
pc             0x1b38   6968
ps             0x100000000000f030       1152921504606908464
cr             0x24000002       603979778
lr             0x1ba4   7076
ctr            0x1b20   6944
xer            0x0      0
mq             0x0      0
fpscr          0x0      0
vscr           0x10000  65536
vrsave         0x0      0

  parent reply	other threads:[~2022-11-10 18:24 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-09 15:33 [Bug target/107590] New: " vital.had at gmail dot com
2022-11-09 15:42 ` [Bug target/107590] " pinskia at gcc dot gnu.org
2022-11-09 15:48 ` pinskia at gcc dot gnu.org
2022-11-09 16:05 ` vital.had at gmail dot com
2022-11-09 16:36 ` pinskia at gcc dot gnu.org
2022-11-09 16:40 ` iains at gcc dot gnu.org
2022-11-09 16:52 ` pinskia at gcc dot gnu.org
2022-11-10 13:19 ` pdimov at gmail dot com
2022-11-10 16:56 ` pinskia at gcc dot gnu.org
2022-11-10 17:13 ` pdimov at gmail dot com
2022-11-10 18:14 ` vital.had at gmail dot com
2022-11-10 18:16 ` vital.had at gmail dot com
2022-11-10 18:24 ` vital.had at gmail dot com [this message]
2022-11-10 22:20 ` pinskia at gcc dot gnu.org
2022-11-10 23:02 ` iains at gcc dot gnu.org
2022-11-10 23:24 ` vital.had at gmail dot com
2024-01-24 13:21 ` vital.had at gmail dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-107590-4-qyMsmYJY0z@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).