It seems to be triggerd by --stack-protector=all (I did not see it with
--stack-protector=strong) on the new memset-generic.c implementation
(which uses the generic C code):

Program received signal SIGSEGV, Segmentation fault.
0x000055555557c7c0 in __memset_generic (dstpp=0x2aaaab2aa930, c=0, len=416) at 
../string/memset.c:28
28      {
(gdb) bt
#0  0x000055555557c7c0 in __memset_generic (dstpp=0x2aaaab2aa930, c=0, len=416) 
at ../string/memset.c:28
#1  0x0000555555586e66 in _dl_aux_init (av=0x2aaaab2aacc8) at dl-support.c:241
#2  0x000055555556439a in __libc_start_main_impl (main=0x55555555fdc2 
<__wrap_main>, argc=1, argv=0x2aaaab2aab58, init=<optimized out>, 
fini=<optimized out>, rtld_fini=0x0, stack_end=<optimized out>)
    at libc-start.c:264
#3  0x000055555555fdc0 in _start () at ../sysdeps/riscv/start.S:67
(gdb) disas
Dump of assembler code for function __memset_generic:
   0x000055555557c7b6 <+0>:     addi    sp,sp,-32
   0x000055555557c7b8 <+2>:     auipc   a7,0x87
   0x000055555557c7bc <+6>:     ld      a7,1040(a7) # 0x555555603bc8
=> 0x000055555557c7c0 <+10>:    ld      a5,0(a7)

The 'ld' is the cookie load/store.

And I could not reproduce it on master because I have fixed some static
statup issues and I stumbled on the same issue for RISC-V in multiple
ocassions.  In any case could check if the upstream
0a380fe9a31bc2d5793c7c5d22d36c45dfe6e2ed patch fixes it [1]?

https://sourceware.org/git/?p=glibc.git;a=commit;h=0a380fe9a31bc2d5793c7c5d22d36c45dfe6e2ed

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2142067

Title:
  static-pie binaries crash on riscv64 with glibc 2.43 on resolute.

To manage notifications about this bug go to:
https://bugs.launchpad.net/glibc/+bug/2142067/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to