opkg sometimes ends with segfault, corrupting database
I've tried to reproduce the opkg segfault issues that ended with corrupted database. I have been successfully able to make it crash when installing a package with
--force-reinstall flag and local
*.ipk file. Here's a stack trace of that error:
#0 0xb6f38c88 in strcmp () from /lib/ld-musl-armhf.so.1 #1 0x00018444 in check_data_file_clashes (pkg=0x82f610, old_pkg=0x0) at opkg_install.c:808 #2 0x00019920 in opkg_install_pkg (pkg=0x82f610, from_upgrade=0) at opkg_install.c:1457 #3 0x00018ff4 in opkg_install_by_name (pkg_name=0x82e6a0 "lighttpd") at opkg_install.c:1209 #4 0x00013b68 in opkg_install_cmd (argc=1, argv=0xbebade50) at opkg_cmd.c:446 #5 0x00015bc0 in opkg_cmd_exec (cmd=0x4f3c0 <cmds+192>, argc=1, argv=0xbebade50) at opkg_cmd.c:1282 #6 0x00012bf4 in main (argc=4, argv=0xbebade44) at opkg-cl.c:416
Obviously the old_pkg is a null pointer here. I'm not sure if the same bug is triggered in other reported cases - but if somebody gives me a well-defined test case, I can try to get a backtrace too. Also the core dump is available on the router if needed.