[FS#1505] The "Replaces" tag on the Packages files make opkg hang

LEDE Bugs lede-bugs at lists.infradead.org
Thu Apr 19 01:31:03 PDT 2018


A new Flyspray task has been opened.  Details are below. 

User who did this - Sébastien DA ROCHA (sebastiendarocha) 

Attached to Project - OpenWrt/LEDE Project
Summary - The "Replaces" tag on  the Packages files make opkg hang
Task Type - Bug Report
Category - Base system
Status - Unconfirmed
Assigned To - 
Operating System - All
Severity - Low
Priority - Very Low
Reported Version - Trunk
Due in Version - Undecided
Due Date - Undecided
Details - Supply the following if possible:
 - Device problem occurs on
When building a image of the firmware (for example a TP-Link Archer C7 v2/v4 or a WR1043NDv4). The problems occurs on the compiling host (Ubuntu 16.04 on a x86_64)

 - Software versions of OpenWrt/LEDE release, packages, etc.
I used several snapshots of the image builder and even the trunk (commit a18d88e8630acd7fd276caa50811b57470a01f9d), used to work on LEDE 17.1.0

 - Steps to reproduce
0) untar the imagebuilder
1) add "src/gz wifirover http://downloads.altsysnet.com/wifirover/lede/testing/" to the repositories.conf of the imagebuilder.
2) make a image, say for Archer C7v4:
make image PROFILE=archer-c7-v4 PACKAGES="wifirover"

Expected: Compilation succeeds
Happens: opkg segfaults


10:10 sebastien at ubuntu-N750HU: /tmp/17010/openwrt-imagebuilder-ar71xx-generic.Linux-x86_64$ LANG=C make image PROFILE=archer-c7-v4 PACKAGES="wifirover" 
Building images for ar71xx - TP-LINK Archer C7 v4
Packages: wifirover ath10k-firmware-qca988x base-files busybox dnsmasq dropbear firewall fstools ip6tables iptables kernel kmod-ath10k kmod-ath9k kmod-gpio-button-hotplug libc libgcc logd mtd netifd odhcp6c odhcpd-ipv6only opkg ppp ppp-mod-pppoe swconfig uboot-envtools uci uclient-fetch wpad-mini

bash: line 6:   841 Segmentation fault      (core dumped) IPKG_NO_SCRIPT=1 IPKG_INSTROOT=/tmp/17010/openwrt-imagebuilder-ar71xx-generic.Linux-x86_64/build_dir/target-mips_24kc_musl/root-ar71xx TMPDIR=/tmp/17010/openwrt-imagebuilder-ar71xx-generic.Linux-x86_64/build_dir/target-mips_24kc_musl/root-ar71xx/tmp /tmp/17010/openwrt-imagebuilder-ar71xx-generic.Linux-x86_64/staging_dir/host/bin/opkg --offline-root /tmp/17010/openwrt-imagebuilder-ar71xx-generic.Linux-x86_64/build_dir/target-mips_24kc_musl/root-ar71xx --force-postinstall --add-dest root:/ --add-arch all:100 --add-arch mips_24kc:200 -f /tmp/17010/openwrt-imagebuilder-ar71xx-generic.Linux-x86_64/repositories.conf --cache /tmp/17010/openwrt-imagebuilder-ar71xx-generic.Linux-x86_64/dl --lists-dir ../../../../../../tmp/17010/openwrt-imagebuilder-ar71xx-generic.Linux-x86_64/dl update 1>&2

Installing packages...
Makefile:134: recipe for target 'package_install' failed
make[2]: *** [package_install] Segmentation fault (core dumped)
Makefile:100: recipe for target '_call_image' failed
make[1]: *** [_call_image] Error 2
Makefile:175: recipe for target 'image' failed
make: *** [image] Error 2


the Packages files is like this 
Package: wifirover
Version: 2017-05-1
Description: WifiRover Captive portal
Section: extras
Priority: optional
Maintainer: Olivier Fontes , Sebastien DA ROCHA 
License: LGPL 2.1
Architecture: all
OE: wifirover
Source: https://github.com/altsysnet/wifirover
Depends: firewall, base-files, base-files, php7, dnsmasq-full
Replaces: firewall, base-files, base-files, php7, dnsmasq-full
MD5Sum: 38f9caf3692ae69ac04c3a7d6ab6908a
Size: 20757
Filename: wifirover_2017-05-1.ipk

If I remove the "Replaces:" tag the run go on, but it fails because I've put custom files on my wifirover package, such as php.ini, /etc/firewall.user...

 - my analysis :
I've compiled opkg based on https://git.openwrt.org/project/opkg-lede.git with debug enabled.

The segfaults happens just by making :
sudo opkg-cl -f repositories.conf update
opkg-cl -f repositories.conf install wifirover

using gdb, I get

10:22 sebastien at ubuntu-N750HU: /tmp/17010/openwrt-imagebuilder-ar71xx-generic.Linux-x86_64$ gdb opkg-cl 
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
.
Find the GDB manual and other documentation resources online at:
.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from opkg-cl...done.
(gdb) run -f repositories.conf install wifirover
Starting program: /usr/local/bin/opkg-cl -f repositories.conf install wifirover
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
pkg_conflicts_abstract (pkg=pkg at entry=0x6278e0, conflictee=conflictee at entry=0x62d1c0)
    at /home/sebastien/Sources/opkg-lede/libopkg/pkg_depends.c:472
472		for (conflict = conflicts; conflict->type; conflict++) {
(gdb) 


And thats where I'm stuck on my analysis :-(

More information can be found at the following URL:
https://bugs.openwrt.org/index.php?do=details&task_id=1505



More information about the lede-bugs mailing list