FS#12000 - Pacman segfault when trying update package

Attached to Project: Pacman
Opened by Vitaliy Berdinskikh (skipper13) - Wednesday, 05 November 2008, 08:06 GMT
Last edited by Dan McGee (toofishes) - Friday, 05 December 2008, 02:28 GMT
Task Type Bug Report
Category General
Status Closed
Assigned To Dan McGee (toofishes)
Architecture i686
Severity Medium
Priority Normal
Reported Version 3.2.1
Due in Version 3.2.2
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Summary and Info:
When I update package from my own repo pacman shutdown with segfault.

Steps to Reproduce:
my repo: http://skipper13.root.ua/packages/i686
package: mysql-jdbc
command: sudo pacman -S mysql-jdbc
This task depends upon

Closed by  Dan McGee (toofishes)
Friday, 05 December 2008, 02:28 GMT
Reason for closing:  Fixed
Additional comments about closing:  Commit b99bebc008dcf944a88f99bb44ac9029557e414 9
Comment by Nagy Gabor (combo) - Wednesday, 05 November 2008, 16:56 GMT
I downloaded your repo's db.tar.gz, and I saw that mysql-jdbc package uses delta.

Delta support in pacman is quite broken atm (off-topic question: or does delta work for you?). However, your log doesn't show any delta related stuff. I guess compute_download_size causes this segfault in sync.c, but this is just a random idea (ALPM_LOG_DEBUG is missing from that function!)
Comment by Vitaliy Berdinskikh (skipper13) - Wednesday, 05 November 2008, 17:29 GMT
Hmm.

I removed previous version of package, rebuit package (without delta) and repo-db, uploaded all to host. Package successfully updated. :(
Comment by Dan McGee (toofishes) - Wednesday, 05 November 2008, 17:55 GMT
Can we avoid a segfault in this case, Nagy? I may not have a chance for a bit (and now that this package has been wiped I really won't, so I will need that original file). Stepping through in GDB should pinpoint the problem.
Comment by Nagy Gabor (combo) - Thursday, 06 November 2008, 15:01 GMT
Dan: Steps to reproduce (Vitaliy, please do not change your repo atm):
pacman.conf:
------------
UseDelta
...
[skipper13]
Server=http://skipper13.root.ua/packages/i686
------------
# pacman -Ud http://skipper13.root.ua/packages/i686/jna-3.0.4-2-i686.pkg.tar.gz
# pacman -Sd jna
------------
gdb says:
Program received signal SIGSEGV, Segmentation fault.
_alpm_delta_parse (line=0xbfe440d7 "3.0.4-2") at delta.c:285
285 *(tmp++) = '\0';
Comment by Nagy Gabor (combo) - Thursday, 06 November 2008, 15:19 GMT
Probably the problem is described here: http://www.archlinux.org/pipermail/pacman-dev/2008-September/012968.html

Maybe we should completely remove our not-yet-complete delta implementation (and move into a new branch)...
Comment by Henning Garus (garns) - Sunday, 09 November 2008, 01:59 GMT
You are right, the segfault occurs, because the current implementation in repo-add does not provide a deltas file formatted the way libalpm expects it. I modified the synch db by hand and got pacman to patch an old package with a delta successfully. It wouldn't install because of a mismatching md5sum, but that is another problem.

So basically the current delta implementation is working. Only the support in makepkg/repo-add is wrong. I am not exactly sure though, why libalpm expects the md5sums of the old and the new package. I am not sure if these are even used anywhere. I would feel save enough with xdelta checking those and then libalpm checking the md5sum of the final patched package.
Comment by Dan McGee (toofishes) - Sunday, 30 November 2008, 23:18 GMT
Should this fix the issue for now?

Loading...