Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#1042980: gnome-shell: FTBFS on mips64el, mipsel: perf-* tests fail

1 view
Skip to first unread message

YunQiang Su

unread,
Aug 4, 2023, 7:50:04 AM8/4/23
to
Simon McVittie <sm...@debian.org> 于2023年8月4日周五 19:26写道:
>
> Control: forwarded -1 https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6877
>
> On Fri, 04 Aug 2023 at 15:50:32 +0800, YunQiang Su wrote:
> > 156 if (rpath)
> > 157 paths = g_strsplit (strtab + rpath->d_un.d_val, ":", -1);
> > 158 else
> > 159 paths = g_strsplit (strtab + runpath->d_un.d_val, ":", -1);
> > // <- segfault here due to
>
> Thanks, that's very useful information.
>
> After some printf debugging on eller, I think what is happening here is
> that GNOME Shell is assuming that the d_un.d_val of the DT_STRTAB is
> an absolute pointer, but on mips64el for whatever reason it's only an
> offset, and it needs to be added to the base address of the executable
> to get a real pointer.
>
> If I understand correctly, the value in the header in the binary on-disk
> is just an offset, and on most architectures the dynamic linker overwrites
> the offset with (base_address + offset) during loading/relocation - but
> for whatever reason, mips64el isn't doing that.
>

Yes. It is this case. I guess it should be a glibc's bug, while during years,
it is a feature now (;
We cannot change this behaviour now.

I am working on a patch for it, the real base address can be get by:
((getauxval(AT_PHDR) >> 8) <<8)

> Instead of doing this low-level ELF manipulation, I'm testing a patch which
> uses an environment variable to propagate the search path into the
> executable - that seems less likely to go wrong on unusual architectures.
>
> smcv



--
YunQiang Su

YunQiang Su

unread,
Aug 4, 2023, 8:10:03 AM8/4/23
to
YunQiang Su <wzs...@gmail.com> 于2023年8月4日周五 19:40写道:
FYI: this patch can fix the segfault problem in
maybe_add_rpath_introspection_paths

--- gnome-shell-44.3.orig/src/main.c
+++ gnome-shell-44.3/src/main.c
@@ -7,6 +7,7 @@
#endif
#include <stdlib.h>
#include <string.h>
+#include <sys/auxv.h>

#include <cogl-pango/cogl-pango.h>
#include <clutter/clutter.h>
@@ -129,6 +130,7 @@ shell_dbus_init (gboolean replace)
}

#ifdef HAVE_EXE_INTROSPECTION
+__attribute__((optimize("O0")))
static void
maybe_add_rpath_introspection_paths (void)
{
@@ -150,6 +152,15 @@ maybe_add_rpath_introspection_paths (voi
strtab = (const char *) dyn->d_un.d_val;
}

+#if defined(__mips)
+ /* The d_val of DT_STRTAB, contains the offset of .dynstr
+ * and the start of elf is loaded, instead of absolute address.
+ * getauxval(AT_PHDR) is near enough with the start, and we are sure
+ * that the elf will be loaded page-aligned.
+ */
+ strtab = strtab + ((getauxval(AT_PHDR) >> 8) << 8);
+#endif
+
if ((!rpath && !runpath) || !strtab)
return;


I am continue working on (EE) failed to write to Xwayland fd: Broken
pipe problem.

>
>
> --
> YunQiang Su



--
YunQiang Su

Simon McVittie

unread,
Aug 4, 2023, 10:30:04 AM8/4/23
to
On Fri, 04 Aug 2023 at 13:21:59 +0100, Simon McVittie wrote:
> On Fri, 04 Aug 2023 at 20:05:20 +0800, YunQiang Su wrote:
> > I am continue working on (EE) failed to write to Xwayland fd: Broken
> > pipe problem.

I notice that the perf-* tests are new in version 44, so if the equivalent
functionality had been failing on mips*el before, we wouldn't know.

Can you confirm whether gnome-shell/unstable works on a mips*el desktop
system?

If that works, please try building
https://salsa.debian.org/gnome-team/gnome-shell/-/merge_requests/71 with
DEB_BUILD_OPTIONS=nocheck: does that work or crash on a mips*el desktop?

Thanks
smcv

YunQiang Su

unread,
Aug 4, 2023, 11:00:04 AM8/4/23
to
Simon McVittie <sm...@debian.org> 于2023年8月4日周五 22:20写道:
>
> On Fri, 04 Aug 2023 at 13:21:59 +0100, Simon McVittie wrote:
> > On Fri, 04 Aug 2023 at 20:05:20 +0800, YunQiang Su wrote:
> > > I am continue working on (EE) failed to write to Xwayland fd: Broken
> > > pipe problem.
>
> I notice that the perf-* tests are new in version 44, so if the equivalent
> functionality had been failing on mips*el before, we wouldn't know.
>

It's due to another segfault. I am digging it.

> Can you confirm whether gnome-shell/unstable works on a mips*el desktop
> system?
>
> If that works, please try building
> https://salsa.debian.org/gnome-team/gnome-shell/-/merge_requests/71 with
> DEB_BUILD_OPTIONS=nocheck: does that work or crash on a mips*el desktop?
>

I will have a try tomorrow.

> Thanks
> smcv



--
YunQiang Su

YunQiang Su

unread,
Aug 4, 2023, 11:40:04 AM8/4/23
to
Ohh, Mozjs102 is using WASM now, which generates some MIPS SIMD instructions.
Interestingly, Let's try to rebuild mozjs102 with llvm-15, and then
maybe llvm-16.
I may need to help fix llvm-toolchain-16/snapshot first.


--
YunQiang Su
0 new messages