Bug 9146 - SIGSEGV in opkg_install_pkg() -> strcmp() when using install with --force-reinstall and local package
Summary: SIGSEGV in opkg_install_pkg() -> strcmp() when using install with --force-rei...
Status: RESOLVED FIXED
Alias: None
Product: opkg
Classification: Yocto Project Subprojects
Component: opkg (show other bugs)
Version: 1.0
Hardware: Other mips
: Undecided normal
Target Milestone: ---
Assignee: Alejandro del Castillo
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2016-02-19 19:16 UTC by Ivan K
Modified: 2016-03-03 00:19 UTC (History)
0 users

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan K 2016-02-19 19:16:35 UTC
Preconditions/Environment
-------------------------
OpenWRT mips_34kc_musl-1.1.12
opkg-9c97d5ecd795709c8584e972bfdf3aee3a5b846d


Triggering Action/Cause
-----------------------
Tried to re-install package from local file:
opkg install /tmp/my-package-name_package-version_ar71xx.ipk -V2 --force-reinstall


Expectation
-----------
Expected to have package re-installed with fresher version.


Actual Result
-------------
In GDB:
Program received signal SIGSEGV, Segmentation fault.
strcmp (l=0x2f757372 <error: Cannot access memory at address 0x2f757372>, r=0x4436c0 "my-package-name") at src/string/strcmp.c:5

Stack trace:
(gdb) bt
#0  strcmp (l=0x2f757372 <error: Cannot access memory at address 0x2f757372>, r=0x4436c0 "wc-agent") at src/string/strcmp.c:5
#1  0x00404a51 in opkg_install_pkg ()
#2  0x099fdc48 in ?? ()

Without GDB:
root@OpenWrt:~# opkg install /tmp/my-package-name_package-version_ar71xx.ipk --force-reinstall
No packages removed.
Installing my-package-name (package-version) to root...
Segmentation fault
root@OpenWrt:~#

Flag -V does not affect reproducibility.
The issue is not reproduced without --force-reinstall flag.


Reproducibility
---------------
10/10
Comment 1 Alejandro del Castillo 2016-03-03 00:19:14 UTC
Open WRT is using a very old version of opkg based on an arbitrary commit (9c97d5ecd795709c8584e972bfdf3aee3a5b846d). New versions (at least since 0.2.2) doesn't show this problem.

To fix this, Open WRT should upgrade to a newer version of opkg. I would be very happy to assist if there are concerns with an upgrade.