FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian dpkg

 
 
LinkBack Thread Tools
 
Old 07-21-2010, 02:31 PM
Guillem Jover
 
Default Two quick bug reports

Hi!

On Wed, 2010-07-21 at 09:01:47 -0500, Jonathan Nieder wrote:
> Trying to remove iceweasel causes update-alternatives to segfault
> for me. iceweasel prerm does
>
> update-alternatives --remove x-www-browser /usr/bin/iceweasel
> update-alternatives --remove gnome-www-browser /usr/bin/iceweasel
>
> Maybe the problem has to do with slave links.
>
> $ cat /var/lib/dpkg/alternatives/x-www-browser
> auto
> /usr/bin/x-www-browser
> x-www-browser.1.gz
> /usr/share/man/man1/x-www-browser.1.gz
>
> /usr/bin/chromium-browser
> 40
>
> /usr/bin/iceweasel
> 70
> /usr/share/man/man1/iceweasel.1.gz
>
> This is with dpkg (and u-a) built from commit f86ff414.

I'll take a look into this later today if no one has done so.

> So, I think, I should try ‘master’ instead. dpkg master fails some
> dpkg-divert tests, so I haven’t tried using it.
>
> Test Summary Report
> -------------------
> ../../src/t/100_dpkg_divert.t (Wstat: 1792 Tests: 235 Failed: 7)
> Failed tests: 143-144, 158, 161-162, 175, 184
> Non-zero exit status: 7
> Files=1, Tests=235, 3 wallclock secs ( 0.21 usr 0.05 sys + 0.54 cusr 0.49 csys = 1.29 CPU)
> Result: FAIL

The dpkg-divert tests do not fail for me, neither in-tree or out of
tree. I've fixed the out of tree tests for scripts/ for which I forgot
to add a variable in the check-local rule, now in master. So debuild
works for me now too.

> Unfortunately I do not have time to investigate beyond this at the
> moment. Are these known problems?

Nope.

And thanks for testing! Once these have been looked at, I'll probably
ask for some more testing and announce the next upload.

regards,
guillem


--
To UNSUBSCRIBE, email to debian-dpkg-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20100721143141.GA2989@gaara.hadrons.org">http://lists.debian.org/20100721143141.GA2989@gaara.hadrons.org
 
Old 07-22-2010, 01:46 AM
Guillem Jover
 
Default Two quick bug reports

On Wed, 2010-07-21 at 16:31:41 +0200, Guillem Jover wrote:
> On Wed, 2010-07-21 at 09:01:47 -0500, Jonathan Nieder wrote:
> > Trying to remove iceweasel causes update-alternatives to segfault
> > for me. iceweasel prerm does
> >
> > update-alternatives --remove x-www-browser /usr/bin/iceweasel
> > update-alternatives --remove gnome-www-browser /usr/bin/iceweasel
> >
> > Maybe the problem has to do with slave links.
> >
> > $ cat /var/lib/dpkg/alternatives/x-www-browser
> > auto
> > /usr/bin/x-www-browser
> > x-www-browser.1.gz
> > /usr/share/man/man1/x-www-browser.1.gz
> >
> > /usr/bin/chromium-browser
> > 40
> >
> > /usr/bin/iceweasel
> > 70
> > /usr/share/man/man1/iceweasel.1.gz
> >
> > This is with dpkg (and u-a) built from commit f86ff414.
>
> I'll take a look into this later today if no one has done so.

So, I took a quick look by removing x-www-browser, and it didn't fail
for me, a reproducible test case would help (or a patch

thanks,
guillem


--
To UNSUBSCRIBE, email to debian-dpkg-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20100722014601.GA8615@gaara.hadrons.org">http://lists.debian.org/20100722014601.GA8615@gaara.hadrons.org
 
Old 07-22-2010, 08:27 PM
Raphael Hertzog
 
Default Two quick bug reports

Hi Jonathan,

On Wed, 21 Jul 2010, Jonathan Nieder wrote:
> Trying to remove iceweasel causes update-alternatives to segfault
> for me. iceweasel prerm does
>
> update-alternatives --remove x-www-browser /usr/bin/iceweasel
> update-alternatives --remove gnome-www-browser /usr/bin/iceweasel

Can't reproduce here.

> This is with dpkg (and u-a) built from commit f86ff414.
>
> So, I think, I should try ‘master’ instead. dpkg master fails some
> dpkg-divert tests, so I haven’t tried using it.

I fixed the test-suite, it was failing for me too. The bug triggered
only on i386 and not on amd64 for some weird reason.

Cheers,
--
Raphaël Hertzog ◈ Debian Developer ◈ [Flattr=20693]

Follow my Debian News ▶ http://RaphaelHertzog.com (English)
▶ http://RaphaelHertzog.fr (Français)


--
To UNSUBSCRIBE, email to debian-dpkg-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20100722202732.GA24375@rivendell">http://lists.debian.org/20100722202732.GA24375@rivendell
 
Old 07-22-2010, 08:33 PM
Cyril Brulebois
 
Default Two quick bug reports

Jonathan Nieder <jrnieder@gmail.com> (21/07/2010):
> Trying to remove iceweasel causes update-alternatives to segfault
> for me. iceweasel prerm does
>
> update-alternatives --remove x-www-browser /usr/bin/iceweasel
> update-alternatives --remove gnome-www-browser /usr/bin/iceweasel

Reproduced with dpkg -P iceweasel.
,----
| kibi@bowmore:~/hack/dpkg.git$ cat /var/lib/dpkg/alternatives/gnome-www-browser
| auto
| /usr/bin/gnome-www-browser
| gnome-www-browser.1.gz
| /usr/share/man/man1/gnome-www-browser.1.gz
|
| /usr/bin/chromium-browser
| 40
|
| /usr/bin/iceweasel
| 70
| /usr/share/man/man1/iceweasel.1.gz
`----


> This is with dpkg (and u-a) built from commit f86ff414.

With current master (1.15.7.2-174-gc249251) built with noopt &
nostrip:
,----
| (gdb) run
| The program being debugged has been started already.
| Start it from the beginning? (y or n) y
|
| Starting program: /usr/sbin/update-alternatives --remove gnome-www-browser /usr/bin/iceweasel
| update-alternatives: utilisation de */usr/bin/chromium-browser* pour fournir */usr/bin/gnome-www-browser* (gnome-www-browser) en mode automatique.
|
| Program received signal SIGSEGV, Segmentation fault.
| 0x0000000000404629 in alternative_save (a=0x60e030,
| file=0x7063c0 "/var/lib/dpkg/alternatives/gnome-www-browser.dpkg-tmp")
| at ../../utils/update-alternatives.c:1217
| 1217 for (sl = a->slaves; sl; sl_prev = sl, sl = sl->next) {
| (gdb) bt
| #0 0x0000000000404629 in alternative_save (a=0x60e030,
| file=0x7063c0 "/var/lib/dpkg/alternatives/gnome-www-browser.dpkg-tmp")
| at ../../utils/update-alternatives.c:1217
| #1 0x00000000004089f5 in main (argc=4, argv=0x7fffffffe6d8)
| at ../../utils/update-alternatives.c:2431
| (gdb) bt full
| #0 0x0000000000404629 in alternative_save (a=0x60e030,
| file=0x7063c0 "/var/lib/dpkg/alternatives/gnome-www-browser.dpkg-tmp")
| at ../../utils/update-alternatives.c:1217
| ctx = {fh = 0x7ffff7af4900,
| filename = 0x7ffff7af4820 "H2130571G.",
| bad_format = 0x7ffff7e635cc, on_error = {{__jmpbuf = {
| 140737488348160, 7355904, 6348912, 0, 4202506, 4233233,
| 140737488348344, 206158430240}, __mask_was_saved = -7152,
| __saved_mask = {__val = {140737488347984, 4236888, 7356944,
| 6348912, 18446744073709551504, 8243121649779630637,
| 7809575350067815471, 8532478930843755892, 6348912, 0, 0,
| 140737348847756, 6348912, 4216810, 7339520, 6348848}}}}}
| sl = 0x0
| sl_prev = 0x0
| fs = 0x0
| #1 0x00000000004089f5 in main (argc=4, argv=0x7fffffffe6d8)
| at ../../utils/update-alternatives.c:2431
| fntmp = 0x7063c0 "/var/lib/dpkg/alternatives/gnome-www-browser.dpkg-tmp"
| fn = 0x706480 "/var/lib/dpkg/alternatives/gnome-www-browser"
| a = 0x60e030
| inst_alt = 0x0
| fileset = 0x0
| ---Type <return> to continue, or q <return> to quit---
| path = 0x60e090 "/usr/bin/iceweasel"
| current_choice = 0x706460 "/usr/bin/iceweasel"
| alt_map_obj = 0x60e0b0
| alt_map_links = 0x60e0d0
| alt_map_parent = 0x60e0f0
| table = 0x6171a0
| new_choice = 0x6ffe00 "/usr/bin/chromium-browser"
| i = 104
| count = 104
`----

Enjoy.

Mraw,
KiBi.
 
Old 07-22-2010, 08:43 PM
Cyril Brulebois
 
Default Two quick bug reports

Cyril Brulebois <kibi@debian.org> (22/07/2010):
> | 1217 for (sl = a->slaves; sl; sl_prev = sl, sl = sl->next) {

Unless I'm missing something, the “increment” part is processed before
the condition is checked, meaning one can happily dereference sl
without checking for its being non-0.

For the record, adding a breakpoint on alternative_save() and stepping
shows that one loops once, then breaks at the beginning of the second
iteration. I can post the various steps before it breaks, but I think
the dereferencing issue is obvious enough.

Mraw,
KiBi.
 
Old 07-22-2010, 09:35 PM
Jonathan Nieder
 
Default Two quick bug reports

Raphael Hertzog wrote:

> Can you verify if the attached patch is enough?

I was about to send just the same thing. It works.

Thanks,
Jonathan


--
To UNSUBSCRIBE, email to debian-dpkg-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20100722213545.GA19745@burratino">http://lists.debian.org/20100722213545.GA19745@burratino
 
Old 07-22-2010, 09:35 PM
Raphael Hertzog
 
Default Two quick bug reports

Hi,

On Wed, 21 Jul 2010, Jonathan Nieder wrote:
> Maybe the problem has to do with slave links.

With disappearing slave link in fact.

On Thu, 22 Jul 2010, Cyril Brulebois wrote:
> Cyril Brulebois <kibi@debian.org> (22/07/2010):
> > | 1217 for (sl = a->slaves; sl; sl_prev = sl, sl = sl->next) {
>
> Unless I'm missing something, the “increment” part is processed before
> the condition is checked, meaning one can happily dereference sl
> without checking for its being non-0.

Except that if "sl" is NULL from the start, the loop is not executed. We
run into the problem because there's one slave but it's removed and thus
the second iteration fails, we should stop before going further in that
case.

Can you verify if the attached patch is enough?

Cheers,
--
Raphaël Hertzog ◈ Debian Developer ◈ [Flattr=20693]

Follow my Debian News ▶ http://RaphaelHertzog.com (English)
▶ http://RaphaelHertzog.fr (Français)
diff --git a/utils/update-alternatives.c b/utils/update-alternatives.c
index 972d173..0f6487a 100644
--- a/utils/update-alternatives.c
+++ b/utils/update-alternatives.c
@@ -1236,6 +1236,8 @@ alternative_save(struct alternative *a, const char *file)
sl_rm = sl;
sl = sl_prev ? sl_prev : a->slaves;
slave_link_free(sl_rm);
+ if (!sl)
+ break; /* no other slave left */
}
}
 
Old 07-22-2010, 09:46 PM
Cyril Brulebois
 
Default Two quick bug reports

Raphael Hertzog <hertzog@debian.org> (22/07/2010):
> > Unless I'm missing something, the “increment” part is processed
> > before the condition is checked, meaning one can happily
> > dereference sl without checking for its being non-0.
>
> Except that if "sl" is NULL from the start, the loop is not executed.

(There's no “except”. One *can*. I didn't write “one will necessarily
will”.)

> Can you verify if the attached patch is enough?

Yes (and yes).

Mraw,
KiBi.
 

Thread Tools




All times are GMT. The time now is 06:10 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org