Bug#849370: aptitude: Aptitude crashes with SIGABRT on install command

2017-02-16 Thread Manuel A. Fernandez Montecelo

Control: tags -1 - moreinfo


--
Manuel A. Fernandez Montecelo 



Bug#849370: aptitude: Aptitude crashes with SIGABRT on install command

2017-02-16 Thread Manuel A. Fernandez Montecelo

Control: tags -1 + pending


2017-01-03 18:51 Jean-Luc Coulon:

Hi Samuel,

And if I apply the patch proposed by #836567 suubmitter to aptitude 
8.4.1 this maybe does resolve the problem but "allow aptitude not to 
crash" :)


I modified the patch a bit (attached), but hope that it works well.  I
will try to get it into the next stable release.

It would be great if you could test it and check that it fixes the
problem.


Thanks.
--
Manuel A. Fernandez Montecelo 
>From 867141bbd4c2ba26c7c3f86923b7177958ac3d9b Mon Sep 17 00:00:00 2001
From: "Manuel A. Fernandez Montecelo" 
Date: Thu, 16 Feb 2017 23:40:03 +0100
Subject: [PATCH] Use a more strict mask for comparison of dependency operators
 (Closes: #836567, #849370)

Use a more strict mask for comparison of dependency operators, thanks to
Aaron M. Ucko for the initial patch (Closes: #836567, #849370)

Recently apt started to use more values in an enum used for dependency
operator comparisons, which causes some problems because aptitude's code
from many years ago, which did not expect new values.

Using a stricter mask to capture only the operators, as per the
documentation of the enum (lower 4 bits).
---
 NEWS   | 12 
 src/generic/apt/apt.cc |  7 +--
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/NEWS b/NEWS
index f22ea692..58529ba6 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,18 @@
 [2017-01-xx]
 Version 0.8.6 UNRELEASED
 
+- Bug fixes:
+
+  * Use a more strict mask for comparison of dependency operators, thanks to
+Aaron M. Ucko for the initial patch (Closes: #836567, #849370)
+
+Recently apt started to use more values in an enum used for dependency
+operator comparisons, which causes some problems because aptitude's code
+from many years ago, which did not expect new values.
+
+Using a stricter mask to capture only the operators, as per the
+documentation of the enum (lower 4 bits).
+
 - Translation updates:
 
   * ru.po: Russian translation by Lev Lamberov (Closes: #855329)
diff --git a/src/generic/apt/apt.cc b/src/generic/apt/apt.cc
index 1850825d..68c0e49c 100644
--- a/src/generic/apt/apt.cc
+++ b/src/generic/apt/apt.cc
@@ -1141,8 +1141,11 @@ static bool subsumes(const pkgCache::DepIterator ,
   if(!d2.TargetVer())
 	return false;
 
-  pkgCache::Dep::DepCompareOp t1 = (pkgCache::Dep::DepCompareOp) (d1->CompareOp &~ pkgCache::Dep::Or);
-  pkgCache::Dep::DepCompareOp t2 = (pkgCache::Dep::DepCompareOp) (d2->CompareOp &~ pkgCache::Dep::Or);
+  // the lower 4 bits are the actual operator (from documentation of the
+  // data type)
+  int comp_mask = 0xf;
+  pkgCache::Dep::DepCompareOp t1 = (pkgCache::Dep::DepCompareOp) (d1->CompareOp & comp_mask);
+  pkgCache::Dep::DepCompareOp t2 = (pkgCache::Dep::DepCompareOp) (d2->CompareOp & comp_mask);
 
   int cmpresult = _system->VS->DoCmpVersion(d1.TargetVer(), d1.TargetVer()+strlen(d1.TargetVer()),
 		d2.TargetVer(), d2.TargetVer()+strlen(d2.TargetVer()));
-- 
2.11.0



Bug#849370: aptitude: Aptitude crashes with SIGABRT on install command

2017-02-16 Thread Manuel A. Fernandez Montecelo

2017-01-03 08:49 Jean-Luc Coulon:

Hi Manuel,

1 - Happy 2017 for you and your family :)


Thanks!


2 - I've not always the problem, this explains the late answer. I get 
it 100% with the curses interface, but not with the command line.


3 - Yes this occurs also with 0.8.4-1

4 - I had to rebuild the package because it is supplied stripped (the 
dbgsyms package is not supplied in the repositories).


They are in a different repository now:
http://debug.mirrors.debian.org/debian-debug/



5 - Please find attached the backtrace for "aptitude upgrade"

6 - the same with "aptitude install ssh"


Thanks for the backtraces.


--
Manuel A. Fernandez Montecelo 



Bug#849370: aptitude: Aptitude crashes with SIGABRT on install command

2017-01-03 Thread Jean-Luc Coulon

Hi Samuel,

And if I apply the patch proposed by #836567 suubmitter to aptitude 
8.4.1 this maybe does resolve the problem but "allow aptitude not to 
crash" :)


Regards

Jean-Luc

Le 03/01/2017 à 13:38, Samuel Mimram a écrit :

Hi,

Same bug here. From the stacktrace, it looks quite related to #836567...

Cheers,

Samuel

On Tue, Jan 3, 2017 at 8:49 AM, Jean-Luc Coulon
 wrote:

Hi Manuel,

1 - Happy 2017 for you and your family :)

2 - I've not always the problem, this explains the late answer. I get it
100% with the curses interface, but not with the command line.

3 - Yes this occurs also with 0.8.4-1

4 - I had to rebuild the package because it is supplied stripped (the
dbgsyms package is not supplied in the repositories).

5 - Please find attached the backtrace for "aptitude upgrade"

6 - the same with "aptitude install ssh"

Best regards

Jean-Luc
Le 31/12/2016 à 17:16, Manuel A. Fernandez Montecelo a écrit :


--args aptitude install pkgs_that_you_want_installed




Bug#849370: aptitude: Aptitude crashes with SIGABRT on install command

2017-01-03 Thread Jonathan Seeley
I just built aptitude with the patch referenced by #836567 and it has
eliminated the crash, so it seems you were right and it is working as a
stop-gap measure.

'virtualbox' is one package which seems to consistently cause the crash for
me, even when using the CLI.

On Tue, Jan 3, 2017 at 7:38 AM, Samuel Mimram  wrote:

> Hi,
>
> Same bug here. From the stacktrace, it looks quite related to #836567...
>
> Cheers,
>
> Samuel
>
> On Tue, Jan 3, 2017 at 8:49 AM, Jean-Luc Coulon
>  wrote:
> > Hi Manuel,
> >
> > 1 - Happy 2017 for you and your family :)
> >
> > 2 - I've not always the problem, this explains the late answer. I get it
> > 100% with the curses interface, but not with the command line.
> >
> > 3 - Yes this occurs also with 0.8.4-1
> >
> > 4 - I had to rebuild the package because it is supplied stripped (the
> > dbgsyms package is not supplied in the repositories).
> >
> > 5 - Please find attached the backtrace for "aptitude upgrade"
> >
> > 6 - the same with "aptitude install ssh"
> >
> > Best regards
> >
> > Jean-Luc
> > Le 31/12/2016 à 17:16, Manuel A. Fernandez Montecelo a écrit :
> >>
> >> --args aptitude install pkgs_that_you_want_installed
>
> --
> To unsubscribe, send mail to 849370-unsubscr...@bugs.debian.org.
>


Bug#849370: aptitude: Aptitude crashes with SIGABRT on install command

2017-01-03 Thread Samuel Mimram
Hi,

Same bug here. From the stacktrace, it looks quite related to #836567...

Cheers,

Samuel

On Tue, Jan 3, 2017 at 8:49 AM, Jean-Luc Coulon
 wrote:
> Hi Manuel,
>
> 1 - Happy 2017 for you and your family :)
>
> 2 - I've not always the problem, this explains the late answer. I get it
> 100% with the curses interface, but not with the command line.
>
> 3 - Yes this occurs also with 0.8.4-1
>
> 4 - I had to rebuild the package because it is supplied stripped (the
> dbgsyms package is not supplied in the repositories).
>
> 5 - Please find attached the backtrace for "aptitude upgrade"
>
> 6 - the same with "aptitude install ssh"
>
> Best regards
>
> Jean-Luc
> Le 31/12/2016 à 17:16, Manuel A. Fernandez Montecelo a écrit :
>>
>> --args aptitude install pkgs_that_you_want_installed



Bug#849370: aptitude: Aptitude crashes with SIGABRT on install command

2017-01-02 Thread Jean-Luc Coulon

Hi Manuel,

1 - Happy 2017 for you and your family :)

2 - I've not always the problem, this explains the late answer. I get it 
100% with the curses interface, but not with the command line.


3 - Yes this occurs also with 0.8.4-1

4 - I had to rebuild the package because it is supplied stripped (the 
dbgsyms package is not supplied in the repositories).


5 - Please find attached the backtrace for "aptitude upgrade"

6 - the same with "aptitude install ssh"

Best regards

Jean-Luc
Le 31/12/2016 à 17:16, Manuel A. Fernandez Montecelo a écrit :

--args aptitude install pkgs_that_you_want_installed
Starting program: /usr/bin/aptitude install ssh
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffefb00700 (LWP 10942)]

Thread 1 "aptitude" received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:58
58  ../sysdeps/unix/sysv/linux/raise.c: Aucun fichier ou dossier de ce type.
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:58
#1  0x7556040a in __GI_abort () at abort.c:89
#2  0x55732a45 in subsumes (d2=..., d1=...)
at ../../../../src/generic/apt/apt.cc:1182
#3  or_group_subsumes (d1=..., d2=..., cache=)
at ../../../../src/generic/apt/apt.cc:1205
#4  0x55734b5f in internal_is_interesting_dep (cache=0x55c41220, 
d=...) at ../../../../src/generic/apt/apt.cc:1303
#5  is_interesting_dep (d=..., cache=0x55c41220)
at ../../../../src/generic/apt/apt.cc:1344
#6  0x557564e0 in aptitude_resolver_version::dep_iterator::applicable (
dep=..., prv=..., prv_open=, cache=)
at ../../../../src/generic/apt/aptitude_resolver_universe.cc:283
#7  0x557509ad in aptitude_resolver_version::dep_iterator::applicable (
this=this@entry=0x7fffbcf0)
at ../../../../src/generic/apt/aptitude_resolver_universe.cc:302
#8  0x55750a98 in aptitude_resolver_version::dep_iterator::normalize (
this=this@entry=0x7fffbcf0)
at ../../../../src/generic/apt/aptitude_resolver_universe.cc:317
#9  0x55751c5a in aptitude_resolver_version::dep_iterator::operator++ (
this=this@entry=0x7fffbcf0)
at ../../../../src/generic/apt/aptitude_resolver_universe.cc:529
#10 0x558286c6 in aptitude_universe::dep_iterator::operator++ (
this=0x7fffbcc0)
at ../../../../src/generic/apt/aptitude_resolver_universe.h:1246
#11 generic_problem_resolver::generic_problem_resolver (
this=this@entry=0x56a52070, _step_score=_step_score@entry=-10, 
_broken_score=_broken_score@entry=-100, 
_unfixed_soft_score=_unfixed_soft_score@entry=-200, 
infinity=infinity@entry=100, 
_full_solution_score=_full_solution_score@entry=50, 
_unfixed_soft_cost=..., _future_horizon=50, _initial_state=..., 
_universe=...)
at ../../../../src/generic/problemresolver/problemresolver.h:3782
#12 0x558187d4 in aptitude_resolver::aptitude_resolver (
this=0x56a52070, step_score=-10, broken_score=-100, 
unfixed_soft_score=-200, infinity=100, resolution_score=50, 
unfixed_soft_cost=..., future_horizon=50, _cost_settings=..., 
initial_installations=..., cache=0x55c41220, _policy=0x55ba6f00)
at ../../../../src/generic/apt/aptitude_resolver.cc:731
#13 0x557a0066 in resolver_manager::create_resolver (
this=this@entry=0x55c330d0)
at ../../../../src/generic/apt/resolver_manager.cc:968
#14 0x557a1c71 in resolver_manager::maybe_create_resolver (
this=0x55c330d0, consider_policybroken=)
at ../../../../src/generic/apt/resolver_manager.cc:805
#15 0x5569693a in sigc::internal::signal_emit0::emit (
impl=0x55c33410) at /usr/include/sigc++-2.0/sigc++/signal.h:798
#16 0x55727443 in sigc::signal0::emit (
this=0x55c41380) at /usr/include/sigc++-2.0/sigc++/signal.h:2804
#17 sigc::signal0::operator() (this=0x55c41380)
at /usr/include/sigc++-2.0/sigc++/signal.h:2820
#18 aptitudeDepCache::end_action_group (this=0x55c41220, undo=0x0)
at ../../../../src/generic/apt/aptcache.cc:2336
#19 0x556b12bb in cmdline_do_action (argc=, 
argv=, status_fname=, 
simulate=, assume_yes=, 
download_only=, fix_broken=false, showvers=false, 
showdeps=false, showsize=false, showwhy=false, visual_preview=false, 
always_prompt=false, resolver_mode=resolver_mode_full, 
safe_resolver_show_actions=false, no_new_installs=false, 
no_new_upgrades=false, user_tags=std::vector of length 0, capacity 0, 
arch_only=false, queue_only=false, verbose=)
at ../../../src/cmdline/cmdline_do_action.cc:249
#20 0x555b4250 in main (argc=3, argv=)
at ../../src/main.cc:1278
Starting program: /usr/bin/aptitude install pkgs_that_you_want_installed
[Thread debugging using libthread_db enabled]
Using host libthread_db library 

Bug#849370: aptitude: Aptitude crashes with SIGABRT on install command

2016-12-31 Thread Manuel A. Fernandez Montecelo

Hi,

2016-12-31 09:45 Jean-Luc Coulon:

Hi Manuel,

Please tell me how I can debug the aptitude commannd line from gdb.
When I load and run it from gdb, it always pop up the curses interfaces.


 # gdb --args aptitude install pkgs_that_you_want_installed
 [inside gdb's "shell"]
 run


Also, do you have the same issues with the latest version that I
released a few days ago?


Cheers.
--
Manuel A. Fernandez Montecelo 



Bug#849370: aptitude: Aptitude crashes with SIGABRT on install command

2016-12-31 Thread Jean-Luc Coulon

Hi Manuel,

Please tell me how I can debug the aptitude commannd line from gdb.
When I load and run it from gdb, it always pop up the curses interfaces.

Regards

Jean-Luc

Le 27/12/2016 à 19:08, Manuel A. Fernandez Montecelo a écrit :

2016-12-26 11:18 Jean-Luc Coulon (f5ibh):

Package: aptitude
Version: 0.8.3-1+b2
Severity: grave
Justification: renders package unusable

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,

Aptitude crashes with SIGABRT on apt-get install command line or in the
"G" command in curses mode.


I assume that you mean "aptitude install"?

Can you please provide a backtrace of a crash with the "aptitude
install"?



Cheers.




Bug#849370: aptitude: Aptitude crashes with SIGABRT on install command

2016-12-29 Thread Manuel A. Fernandez Montecelo

Control: tags -1 + moreinfo
Control: severity -1 important


Setting metadata correctly, at least while there's no reply... and
assuming that it doesn't affect /many/ people...

 https://www.debian.org/Bugs/Developer#severities

 important

 a bug which has a major effect on the usability of a package, without
 rendering it completely unusable to everyone.


--
Manuel A. Fernandez Montecelo 



Bug#849370: aptitude: Aptitude crashes with SIGABRT on install command

2016-12-27 Thread Manuel A. Fernandez Montecelo

2016-12-26 11:18 Jean-Luc Coulon (f5ibh):

Package: aptitude
Version: 0.8.3-1+b2
Severity: grave
Justification: renders package unusable

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,

Aptitude crashes with SIGABRT on apt-get install command line or in the
"G" command in curses mode.


I assume that you mean "aptitude install"?

Can you please provide a backtrace of a crash with the "aptitude
install"?



Cheers.
--
Manuel A. Fernandez Montecelo 



Bug#849370: aptitude: Aptitude crashes with SIGABRT on install command

2016-12-26 Thread Jean-Luc Coulon (f5ibh)
Package: aptitude
Version: 0.8.3-1+b2
Severity: grave
Justification: renders package unusable

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,

Aptitude crashes with SIGABRT on apt-get install command line or in the
"G" command in curses mode.

Attached the gdb backtrace.

Regards

Jean-Luc


- -- Package-specific info:
Terminal: xterm-256color
$DISPLAY is set.
which aptitude: /usr/bin/aptitude

aptitude version information:
aptitude 0.8.3
Compiler: g++ 6.2.0 20161103
Compiled against:
  apt version 5.0.0
  NCurses version 6.0
  libsigc++ version: 2.10.0
  Gtk+ support disabled.
  Qt support disabled.

Current library versions:
  NCurses version: ncurses 6.0.20161126
  cwidget version: 0.5.17
  Apt version: 5.0.1

aptitude linkage:
linux-vdso.so.1 (0x7ffcd1d8c000)
libapt-pkg.so.5.0 => /lib/x86_64-linux-gnu/libapt-pkg.so.5.0 
(0x7fce635c8000)
libncursesw.so.5 => /lib/x86_64-linux-gnu/libncursesw.so.5 
(0x7fce63398000)
libtinfo.so.5 => /lib/x86_64-linux-gnu/libtinfo.so.5 
(0x7fce6316e000)
libsigc-2.0.so.0 => /lib/x86_64-linux-gnu/libsigc-2.0.so.0 
(0x7fce62f67000)
libcwidget.so.3 => /lib/x86_64-linux-gnu/libcwidget.so.3 
(0x7fce62c6a000)
libsqlite3.so.0 => /lib/x86_64-linux-gnu/libsqlite3.so.0 
(0x7fce62961000)
libboost_iostreams.so.1.62.0 => 
/lib/x86_64-linux-gnu/libboost_iostreams.so.1.62.0 (0x7fce62749000)
libboost_filesystem.so.1.62.0 => 
/lib/x86_64-linux-gnu/libboost_filesystem.so.1.62.0 (0x7fce6253)
libboost_system.so.1.62.0 => 
/lib/x86_64-linux-gnu/libboost_system.so.1.62.0 (0x7fce6232c000)
libxapian.so.30 => /lib/x86_64-linux-gnu/libxapian.so.30 
(0x7fce61f1e000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 
(0x7fce61d01000)
libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 
(0x7fce6197d000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x7fce61679000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 
(0x7fce61462000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x7fce610c4000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x7fce60ec)
libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 
(0x7fce60ca9000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x7fce60a8d000)
libbz2.so.1.0 => /lib/x86_64-linux-gnu/libbz2.so.1.0 
(0x7fce6087d000)
liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x7fce60657000)
liblz4.so.1 => /lib/x86_64-linux-gnu/liblz4.so.1 (0x7fce60445000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x7fce6023d000)
libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x7fce60036000)
/lib64/ld-linux-x86-64.so.2 (0x560ffd83b000)

- -- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (600, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 4.9.0-i7-0.1 (SMP w/8 CPU cores; PREEMPT)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages aptitude depends on:
ii  aptitude-common0.8.3-1
ii  libapt-pkg5.0  1.4~beta2
ii  libboost-filesystem1.62.0  1.62.0+dfsg-4
ii  libboost-iostreams1.62.0   1.62.0+dfsg-4
ii  libboost-system1.62.0  1.62.0+dfsg-4
ii  libc6  2.24-8
ii  libcwidget3v5  0.5.17-4+b1
ii  libgcc11:6.2.1-7
ii  libncursesw5   6.0+20161126-1
ii  libsigc++-2.0-0v5  2.10.0-1
ii  libsqlite3-0   3.15.2-2
ii  libstdc++6 6.2.1-7
ii  libtinfo5  6.0+20161126-1
ii  libxapian301.4.1-1

Versions of packages aptitude recommends:
ii  libparse-debianchangelog-perl  1.2.0-12
ii  sensible-utils 0.0.9

Versions of packages aptitude suggests:
ii  apt-xapian-index0.49
ii  aptitude-doc-en [aptitude-doc]  0.8.3-1
ii  aptitude-doc-fr [aptitude-doc]  0.8.3-1
ii  debtags 2.1.2
ii  tasksel 3.39

- -- no debconf information

-BEGIN PGP SIGNATURE-

iF0EARECAB0WIQT5el3FKLtmYO4UlQtR0YZfPMac0AUCWGDubAAKCRBR0YZfPMac
0FCNAKCTmYj6qEjIvupZjnkfVQbhWRaddQCfUy0uyd4S2Smn247xuvAximgA/wo=
=PbgW
-END PGP SIGNATURE-
You can't do that when your target is `None'
Reading symbols from /usr/bin/aptitude...Reading symbols from 
/usr/lib/debug/.build-id/9f/c1cdf810eeccd5951cee98a12a8d23d9d78a0f.debug...done.
done.
Starting program: /usr/bin/aptitude 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x73acb700 (LWP 8224)]
[New Thread 0x732ca700 (LWP 8225)]
[New Thread 0x72ac9700 (LWP 8226)]
[New Thread 0x7fffee2ad700 (LWP 8230)]

Thread 1 "aptitude" received signal SIGABRT,