View previous topic :: View next topic |
Author |
Message |
gtbX Tux's lil' helper
Joined: 11 Oct 2003 Posts: 126
|
Posted: Sun Sep 13, 2020 11:00 pm Post subject: Crash when attempting to emerge anything on ARM |
|
|
I've been working on installing Gentoo onto a DLink DIR-685, which is a fancy (but old) wifi router. Why? because.
It actually has a little 2" framebuffer display, USB and SATA, so with a HD and keyboard I can get a tiny barely readable console on it. For kernel config I've been using this site as a guide, but it's more focused on OpenWRT.
The first major obstacle is that I've had to build my own stage3 for it since it uses an ARMv4 (non-thumb) CPU, which GCC appeared to drop support for in version 8 and newer. I ended up using the Gentoo Embedded handbook, specifically the section on setting up a Qemu-user environment to build it. I copied the environment over to a hard drive, popped it into the router, and most stuff I expect to work does. My main problem seems to be running emerge (or ebuild) directly on the device. Whenever it gets to actually building a package, I get a crash dump similar to this:
Code: |
Exception in callback AsynchronousTask._exit_listener_cb(<bound method...t 0xb5784210>>)
handle: <Handle AsynchronousTask._exit_listener_cb(<bound method...t 0xb5784210>>)>
Traceback (most recent call last):
File "/usr/lib/python3.7/site-packages/portage/process.py", line 760, in __call__
return self._results[flags]
KeyError: 1275068416
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.7/asyncio/events.py", line 88, in _run
self._context.run(self._callback, *self._args)
File "/usr/lib/python3.7/site-packages/_emerge/AsynchronousTask.py", line 201, in _exit_listener_cb
listener(self)
File "/usr/lib/python3.7/site-packages/_emerge/EbuildPhase.py", line 158, in _async_start_exit
self._start_lock()
File "/usr/lib/python3.7/site-packages/_emerge/EbuildPhase.py", line 178, in _start_lock
self._start_ebuild()
File "/usr/lib/python3.7/site-packages/_emerge/EbuildPhase.py", line 221, in _start_ebuild
self._start_task(ebuild_process, self._ebuild_exit)
File "/usr/lib/python3.7/site-packages/_emerge/CompositeTask.py", line 113, in _start_task
task.start()
File "/usr/lib/python3.7/site-packages/_emerge/AsynchronousTask.py", line 30, in start
self._start()
File "/usr/lib/python3.7/site-packages/_emerge/AbstractEbuildProcess.py", line 169, in _start
self._start_post_builddir_lock(start_ipc_daemon=start_ipc_daemon)
File "/usr/lib/python3.7/site-packages/_emerge/AbstractEbuildProcess.py", line 200, in _start_post_builddir_lock
SpawnProcess._start(self)
File "/usr/lib/python3.7/site-packages/_emerge/SpawnProcess.py", line 110, in _start
retval = self._spawn(self.args, **kwargs)
File "/usr/lib/python3.7/site-packages/_emerge/EbuildProcess.py", line 25, in _spawn
actionmap=actionmap, **kwargs)
File "/usr/lib/python3.7/site-packages/portage/package/ebuild/doebuild.py", line 178, in _doebuild_spawn
return spawn(cmd, settings, **kwargs)
File "/usr/lib/python3.7/site-packages/portage/package/ebuild/doebuild.py", line 1662, in spawn
**keywords)
File "/usr/lib/python3.7/site-packages/portage/process.py", line 145, in spawn_bash
return spawn(args, opt_name=opt_name, **keywords)
File "/usr/lib/python3.7/site-packages/portage/process.py", line 360, in spawn
_unshare_validate(unshare_flags)
File "/usr/lib/python3.7/site-packages/portage/process.py", line 762, in __call__
result = self._results[flags] = self._validate(flags)
File "/usr/lib/python3.7/site-packages/portage/process.py", line 791, in _validate
result = parent_pipe.recv()
File "/usr/lib/python3.7/multiprocessing/connection.py", line 250, in recv
buf = self._recv_bytes()
File "/usr/lib/python3.7/multiprocessing/connection.py", line 407, in _recv_bytes
buf = self._recv(4)
File "/usr/lib/python3.7/multiprocessing/connection.py", line 383, in _recv
raise EOFError
EOFError
Terminated
|
If I mount the drive on my amd64 system and run it under qemu, emerge works correctly. There must be some compatibility issue with this CPU, but I don't know where to look to see if I can fix it.
emerge --info
Code: |
Portage 3.0.4 (python 3.7.8-final-0, default/linux/arm/17.0/armv4, gcc-7.5.0, glibc-2.31-r6, 5.8.6-gentoo armv4l)
=================================================================
System uname: Linux-5.8.6-gentoo-armv4l-FA526_rev_1_-v4l-with-gentoo-2.7
KiB Mem: 120288 total, 32672 free
KiB Swap: 0 total, 0 free
Timestamp of repository gentoo: Fri, 04 Sep 2020 23:00:01 +0000
Head commit of repository gentoo: 53eecce6afbd9931ead5da9c3dfc9147e0a320cc
sh bash 5.0_p18
ld GNU ld (Gentoo 2.33.1 p2) 2.33.1
app-shells/bash: 5.0_p18::gentoo
dev-lang/perl: 5.30.3::gentoo
dev-lang/python: 2.7.18-r2::gentoo, 3.7.8-r2::gentoo, 3.8.5::gentoo
sys-apps/baselayout: 2.7::gentoo
sys-apps/openrc: 0.42.1::gentoo
sys-apps/sandbox: 2.18::gentoo
sys-devel/binutils: 2.33.1-r1::gentoo
sys-devel/gcc: 7.5.0-r1::gentoo
sys-devel/gcc-config: 2.3.1::gentoo
sys-devel/make: 4.2.1-r4::gentoo
sys-kernel/linux-headers: 5.4-r1::gentoo (virtual/os-headers)
sys-libs/glibc: 2.31-r6::gentoo
Repositories:
gentoo
location: /var/db/repos/gentoo
sync-type: rsync
sync-uri: rsync://materia/gentoo-portage
priority: -1000
sync-rsync-verify-jobs: 1
sync-rsync-verify-metamanifest: yes
sync-rsync-verify-max-age: 24
sync-rsync-extra-opts:
ACCEPT_KEYWORDS="arm"
ACCEPT_LICENSE="@FREE"
CBUILD="armv4l-softfloat-linux-gnueabi"
CFLAGS="-O2 -pipe -march=armv4"
CHOST="armv4l-softfloat-linux-gnueabi"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -march=armv4"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -pipe -march=armv4"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch preserve-libs protect-owned qa-unresolved-soname-deps sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersync xattr"
FFLAGS="-O2 -pipe -march=armv4"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
PKGDIR="/var/db/repos/gentoo/packages/armv4l"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="acl alsa arm berkdb bzip2 cli crypt dri egl fbdev fortran gdbm iconv ipv6 libglvnd ncurses nls nptl pam pcre readline seccomp split-usr ssl tcpd unicode xattr zlib" ADA_TARGET="gnat_2018" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2 php7-3 php7-4" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_7" PYTHON_TARGETS="python2_7 python3_7" RUBY_TARGETS="ruby25" USERLAND="GNU" VIDEO_CARDS="exynos fbdev omap dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset: CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, MAKEOPTS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
|
|
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54578 Location: 56N 3W
|
Posted: Sun Sep 13, 2020 11:53 pm Post subject: |
|
|
gtbX,
After emerge or ebuild has failed, what do you have in dmesg?
Can you put the whole thing onto a pastebin site please?
wgetpaste can help.
I don't need it all ... but armv4. I'm curious :)
With only 120Mb RAM, its going to be a squeeze to build anything there and I expect to see the Out Of Memory (OOM) manager in action in dmesg.
You won't miss it if its there.
The content of /proc/cpuinfo would be good see too. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
gtbX Tux's lil' helper
Joined: 11 Oct 2003 Posts: 126
|
Posted: Mon Sep 14, 2020 2:32 am Post subject: |
|
|
dmesg
There's some messages in there about the display and USB hardware, but it doesn't look like the OOM killer was activated. The last line is when I enabled some swap space to see if that might resolve it (it didn't).
I was planning on compiling most packages on a larger machine and copying binpkgs over. I was able to successfully build python manually, when I first ran `ebuild ... prepare` inside qemu. I'm not sure how to manually install it without using ebuild though, and I don't really expect that building python on the device will have a different result. I just can't think of anything else.
Code: |
# cat /proc/cpuinfo
processor : 0
model name : FA526 rev 1 (v4l)
BogoMIPS : 50.00
Features : swp half
CPU implementer : 0x66
CPU architecture: 4
CPU variant : 0x0
CPU part : 0x526
CPU revision : 1
Hardware : Gemini (Device Tree)
Revision : 0000
Serial : 0000000000000000
|
|
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54578 Location: 56N 3W
|
Posted: Mon Sep 14, 2020 10:56 am Post subject: |
|
|
gtbX,
Your paste has gone :(
Installing binaries without using emerge is possible.
You have done it at least once already.
The down side is that single package tar will not maintain /var/db/pkg/ which is how portage tracks everything you have installed.
Hence the rescue use of fix it and rebuild..
emerge --info clearly works, that uses Python. so which ebuild phase function fails? _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
gtbX Tux's lil' helper
Joined: 11 Oct 2003 Posts: 126
|
Posted: Mon Sep 14, 2020 12:28 pm Post subject: |
|
|
Never used a pastebin before. I guess big pastes might expire faster than 7 days? Try again? |
|
Back to top |
|
|
gtbX Tux's lil' helper
Joined: 11 Oct 2003 Posts: 126
|
Posted: Mon Sep 14, 2020 12:43 pm Post subject: |
|
|
It doesn't look like any of the ebuild phases work. In order to compile python, I ran up to `ebuild ... configure` in qemu then manually executed `make && touch .compiled` on the device. I've switched back to qemu to complete the install, but I don't think this will affect anything. |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54578 Location: 56N 3W
|
Posted: Fri Sep 18, 2020 9:15 pm Post subject: |
|
|
gtbX,
Code: | [ 7.656687] uhci_hcd: USB Universal Host Controller Interface driver
[ 7.692976] fotg210_hcd: FOTG210 Host Controller (EHCI) Driver
[ 7.720214] Warning! fotg210_hcd should always be loaded before uhci_hcd and ohci_hcd, not after |
The kernel driver for the display is not happy.
Code: | [ 12.287261] ------------[ cut here ]------------
[ 12.287343] WARNING: CPU: 0 PID: 14 at drivers/gpu/drm/drm_atomic_helper.c:1496 drm_atomic_helper_wait_for_vblanks.part.1+0x26c/0x280
[ 12.287365] [CRTC:32:crtc-0] vblank wait timed out
[ 12.287375] Modules linked in:
[ 12.287418] CPU: 0 PID: 14 Comm: kworker/0:1 Not tainted 5.8.6-gentoo #3
[ 12.287435] Hardware name: Gemini (Device Tree)
[ 12.287565] Workqueue: events deferred_probe_work_func
[ 12.287658] [<c0011834>] (unwind_backtrace) from [<c000d730>] (show_stack+0x10/0x14)
[ 12.287726] [<c000d730>] (show_stack) from [<c001a5f0>] (__warn+0xa8/0xcc)
[ 12.287789] [<c001a5f0>] (__warn) from [<c001a680>] (warn_slowpath_fmt+0x6c/0xb8)
[ 12.287860] [<c001a680>] (warn_slowpath_fmt) from [<c03a6c60>] (drm_atomic_helper_wait_for_vblanks.part.1+0x26c/0x280)
[ 12.287921] [<c03a6c60>] (drm_atomic_helper_wait_for_vblanks.part.1) from [<c03a8d48>] (drm_atomic_helper_commit_tail+0x58/0x68)
[ 12.287975] [<c03a8d48>] (drm_atomic_helper_commit_tail) from [<c03a93d0>] (commit_tail+0x188/0x1a0)
[ 12.288028] [<c03a93d0>] (commit_tail) from [<c03aa09c>] (drm_atomic_helper_commit+0x12c/0x158)
[ 12.288105] [<c03aa09c>] (drm_atomic_helper_commit) from [<c03d8e70>] (drm_client_modeset_commit_atomic+0x164/0x208)
[ 12.288174] [<c03d8e70>] (drm_client_modeset_commit_atomic) from [<c03d8f54>] (drm_client_modeset_commit_locked+0x40/0x180)
[ 12.288242] [<c03d8f54>] (drm_client_modeset_commit_locked) from [<c03d90b8>] (drm_client_modeset_commit+0x24/0x40)
[ 12.288306] [<c03d90b8>] (drm_client_modeset_commit) from [<c03aeb48>] (__drm_fb_helper_restore_fbdev_mode_unlocked+0x5c/0xc4)
[ 12.288357] [<c03aeb48>] (__drm_fb_helper_restore_fbdev_mode_unlocked) from [<c03aec18>] (drm_fb_helper_set_par+0x38/0x68)
[ 12.288406] [<c03aec18>] (drm_fb_helper_set_par) from [<c0342334>] (fbcon_init+0x2c8/0x610)
[ 12.288468] [<c0342334>] (fbcon_init) from [<c037fd38>] (visual_init+0xb0/0xf8)
[ 12.288524] [<c037fd38>] (visual_init) from [<c0381310>] (do_bind_con_driver+0x1fc/0x408)
[ 12.288570] [<c0381310>] (do_bind_con_driver) from [<c03817dc>] (do_take_over_console+0x80/0x1ec)
[ 12.288617] [<c03817dc>] (do_take_over_console) from [<c0340818>] (do_fbcon_takeover+0x60/0xc0)
[ 12.288683] [<c0340818>] (do_fbcon_takeover) from [<c033a988>] (register_framebuffer+0x1cc/0x2c4)
[ 12.288746] [<c033a988>] (register_framebuffer) from [<c03ae644>] (__drm_fb_helper_initial_config_and_unlock+0x388/0x54c)
[ 12.288798] [<c03ae644>] (__drm_fb_helper_initial_config_and_unlock) from [<c03aee8c>] (drm_fbdev_client_hotplug+0x138/0x204)
[ 12.288846] [<c03aee8c>] (drm_fbdev_client_hotplug) from [<c03aefe0>] (drm_fbdev_generic_setup+0x88/0x19c)
[ 12.288901] [<c03aefe0>] (drm_fbdev_generic_setup) from [<c03e14b0>] (tve200_probe+0x310/0x3cc)
[ 12.288965] [<c03e14b0>] (tve200_probe) from [<c03ec058>] (platform_drv_probe+0x4c/0x9c)
[ 12.289018] [<c03ec058>] (platform_drv_probe) from [<c03ea52c>] (really_probe+0x224/0x35c)
[ 12.289066] [<c03ea52c>] (really_probe) from [<c03ea768>] (driver_probe_device+0x54/0xac)
[ 12.289114] [<c03ea768>] (driver_probe_device) from [<c03e87d0>] (bus_for_each_drv+0x58/0xbc)
[ 12.289161] [<c03e87d0>] (bus_for_each_drv) from [<c03ea28c>] (__device_attach+0xd4/0x148)
[ 12.289207] [<c03ea28c>] (__device_attach) from [<c03e963c>] (bus_probe_device+0x88/0x90)
[ 12.289255] [<c03e963c>] (bus_probe_device) from [<c03e9acc>] (deferred_probe_work_func+0x60/0x8c)
[ 12.289317] [<c03e9acc>] (deferred_probe_work_func) from [<c0031f9c>] (process_one_work+0x1fc/0x480)
[ 12.289376] [<c0031f9c>] (process_one_work) from [<c00324bc>] (worker_thread+0x29c/0x604)
[ 12.289434] [<c00324bc>] (worker_thread) from [<c00380b8>] (kthread+0x144/0x16c)
[ 12.289485] [<c00380b8>] (kthread) from [<c0008340>] (ret_from_fork+0x14/0x34)
[ 12.289529] Exception stack(0xc7991fb0 to 0xc7991ff8)
[ 12.289623] 1fa0: 00000000 00000000 00000000 00000000
[ 12.289774] 1fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 12.289897] 1fe0: 00000000 00000000 00000000 00000000 00000013 00000000
[ 12.289946] ---[ end trace e6cdffd937d0ff68 ]--- |
It may be because the system is too busy to drive the display properly at startup.
Code: | [ 112.918429] ipw2200 0000:00:0c.0: Direct firmware load for ipw2200-bss.fw failed with error -2
[ 112.918745] ipw2200: ipw2200-bss.fw request_firmware failed: Reason -2
[ 112.918770] ipw2200: Unable to load firmware: -2
[ 113.073044] ipw2200: probe of 0000:00:0c.0 failed with error -5 | you are missing the firmware for your wifi.
Its in linux-firmware but its huge and you only want a few files.
After its installed, you can configure it to only install the files you want in future.
Nothing about portage though.
I was bitten by something like this and i notice that portage-3.0.4 has been replaced by portage-3.0.4-r1.
That may mean that portage-3.0.4 had a bug. Its worth trying a different portage version. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
gtbX Tux's lil' helper
Joined: 11 Oct 2003 Posts: 126
|
Posted: Sat Oct 10, 2020 1:26 pm Post subject: |
|
|
Finally got time to look at this again, and I found a bug in my qemu-wrapper program: it was totally ignoring the -cpu argument being passed to qemu-arm.
Not sure how that happened, nor how it even worked at all with that bug, but after fixing it (I'm specifying the SA1100 cpu as it seems closest to the FA526) emerge crashes in qemu exactly the same way as it does on real hardware. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|