Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 220102 - dev-libs/crypto++ compiled with -O2 makes >=net-p2p/amule-2.2.0_pre* crash on amd64
Summary: dev-libs/crypto++ compiled with -O2 makes >=net-p2p/amule-2.2.0_pre* crash on...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Gentoo net-p2p team
URL:
Whiteboard:
Keywords:
: 221039 228903 234649 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-05-03 11:41 UTC by Joel
Modified: 2008-08-13 17:36 UTC (History)
8 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge--info,4.99 KB, text/plain)
2008-05-27 09:20 UTC, Bjoern Thorwirth
Details
paludis --info amule (info,15.17 KB, text/plain)
2008-06-14 04:10 UTC, Jason Lynch
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joel 2008-05-03 11:41:38 UTC
I recently upgraded to ~amd64 and when I try to run aMule, it crashes, giving me this error:
Initialising aMule
Checking if there is an instance already running...
No other instances are running.
HTTP download thread started
amule: integer.cpp:2317: void CryptoPP::MontgomeryReduce(CryptoPP::word*, CryptoPP::word*, CryptoPP::word*, const CryptoPP::word*, const CryptoPP::word*, size_t): La declaración `carry | !borrow' no se cumple.
Abortado


Reproducible: Always




Portage 2.1.5_rc6 (default/linux/amd64/2008.0/desktop, gcc-4.3.0, glibc-2.7-r2, 2.6.25-gentoo-r1 x86_64)
=================================================================
System uname: 2.6.25-gentoo-r1 x86_64 Intel(R) Core(TM)2 Duo CPU E6750 @ 2.66GHz
Timestamp of tree: Sat, 03 May 2008 11:05:01 +0000
ccache version 2.4 [enabled]
app-shells/bash:     3.2_p33
dev-java/java-config: 1.3.7, 2.1.6
dev-lang/python:     2.5.2-r2
dev-util/ccache:     2.4-r7
sys-apps/baselayout: 2.0.0
sys-apps/openrc:     0.2.3
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.62
sys-devel/automake:  1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1-r1
sys-devel/binutils:  2.18-r1
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.25-r1
ACCEPT_KEYWORDS="amd64 ~amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=core2 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config /var/lib/hsql
db"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache
2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo /etc
/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-march=core2 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="ccache distlocks parallel-fetch sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LANG="es_ES.UTF-8"
LC_ALL="es_ES.UTF-8"
LDFLAGS=""
LINGUAS="es"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats
 --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi additions alsa amd64 apache2 bash-completion berkdb bluetooth branding bzip2 cairo cdinstall                                                                                         cdr cli cracklib crypt cups daemon dbus directfb divx dri dvd dvdr dvdread dynamicplugin emboss encode evo fam fbcon                                                                                         ffmpeg firefox fortran gd gdbm gif gpm gstreamer gtk hal hardenedphp iconv ieee1394 ipv6 isdnlog java jpeg kde kerber                                                                                        os ldap libnotify lm_sensors loop-aes mad midi mikmod mmx mp3 mpeg mudflap multilib musepack mysql ncurses nls nptl n                                                                                        ptlonly nsplugin ntfs offensive ogg opengl openmp pam pcre pdf pear perl php png ppds pppd python qt3 qt3support qt4                                                                                         quicktime readline reflection remote ruby scanner sdl session spell spl sse sse2 sse3 ssl ssse3 startup-notification                                                                                         stats svg symlink tcl tcpd threads tiff tk truetype unicode vorbis wmp xml xorg xv xvid zlib" ALSA_CARDS="hda-intel"                                                                                         ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear                                                                                         meter mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic auth_digest auth                                                                                        n_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner au                                                                                        thz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter head                                                                                        ers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer                                                                                         proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" I                                                                                        NPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb nc                                                                                        urses text" LINGUAS="es" USERLAND="GNU" VIDEO_CARDS="nvidia"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC                                                                                        _EXTRA_OPTS
Comment 1 Mark Loeser (RETIRED) gentoo-dev 2008-05-03 16:47:13 UTC
Could you please change your LOCALE so the error is in english and post it here?
Comment 2 Joel 2008-05-03 17:23:31 UTC
Initialising aMule
Checking if there is an instance already running...
No other instances are running.
HTTP download thread started
amule: integer.cpp:2317: void CryptoPP::MontgomeryReduce(CryptoPP::word*, CryptoPP::word*, CryptoPP::word*, const CryptoPP::word*, const CryptoPP::word*, size_t): Assertion `carry | !borrow' failed.
Aborted
Comment 3 Raúl Porcel (RETIRED) gentoo-dev 2008-05-05 14:54:12 UTC
rename the ebuild to amule-2.2.0_pre20080505.ebuild and run `emerge -v --digest amule` and let me know
Comment 4 Joel 2008-05-05 20:46:24 UTC
It happens the same thing... But, I have got two machines, and the other one, which was no updated since thursday had no problem with amule, until today, when I run an emerge -uDN world.
Say that the two machines are Core 2 with a very similar configuration.
Comment 5 Raúl Porcel (RETIRED) gentoo-dev 2008-05-06 11:32:04 UTC
Uh...wait a second, 20080430 isn't in the tree
Comment 6 Joel 2008-05-06 12:18:54 UTC
Yes, sorry, I made a mistake when I was writing the title. It happens with amule-2.2.0_pre20080413 and amule-2.2.0_pre20080505
Comment 7 Joel 2008-05-07 20:12:29 UTC
Now I have upgraded to amule-2.2.0_pre20080507 and happens the same thing. Can it crash because I compiled it with gcc 4.3?
Comment 8 Aaron Cuevas 2008-05-08 23:08:31 UTC
(In reply to comment #7)
> Now I have upgraded to amule-2.2.0_pre20080507 and happens the same thing. Can
> it crash because I compiled it with gcc 4.3?
> 

It probably is because of 4.3. As it is said almost everywhere, using 4.3 is a risky affair with lot of fun when things stop working :P

I had the same error, but I managed to get amule to work by compiling crypto++ and amule using USE="-sse -sse2" and, of course, disabling any sse flag in CXXFLAGS. It appears to be a bug related with crypto++ being compiled with sse (compiling only that library didn't help, though).

I hope this helps.
Comment 9 Joel 2008-05-09 08:13:51 UTC
(In reply to comment #8)
> (In reply to comment #7)
> > Now I have upgraded to amule-2.2.0_pre20080507 and happens the same thing. Can
> > it crash because I compiled it with gcc 4.3?
> > 
> 
> It probably is because of 4.3. As it is said almost everywhere, using 4.3 is a
> risky affair with lot of fun when things stop working :P
> 
> I had the same error, but I managed to get amule to work by compiling crypto++
> and amule using USE="-sse -sse2" and, of course, disabling any sse flag in
> CXXFLAGS. It appears to be a bug related with crypto++ being compiled with sse
> (compiling only that library didn't help, though).
> 
> I hope this helps.
> 

Sorry, but I have tried to do that, and the result is the same :(
Comment 10 Aaron Cuevas 2008-05-10 02:37:16 UTC
Did you try to unmerge both of the packages and remerge them both with the "-sse -sse2" use and withouth sse flags in the cxxflags?

The error I had was exactly the same as yours, I use also gcc-4.3 (the latest ebuild in the main tree, with the multilib patch to be able to compile it) and that worked for me.
Comment 11 Joel 2008-05-10 10:02:48 UTC
(In reply to comment #10)
> Did you try to unmerge both of the packages and remerge them both with the
> "-sse -sse2" use and withouth sse flags in the cxxflags?
> 
> The error I had was exactly the same as yours, I use also gcc-4.3 (the latest
> ebuild in the main tree, with the multilib patch to be able to compile it) and
> that worked for me.
> 

(In reply to comment #10)
> Did you try to unmerge both of the packages and remerge them both with the
> "-sse -sse2" use and withouth sse flags in the cxxflags?
> 
> The error I had was exactly the same as yours, I use also gcc-4.3 (the latest
> ebuild in the main tree, with the multilib patch to be able to compile it) and
> that worked for me.
> 

Multilib patch? I've used the gcc-4.3 that is in the tree, and I haven't see an epatch for it in the ebuild.

Comment 12 Joel 2008-05-10 15:15:43 UTC
(In reply to comment #10)
> Did you try to unmerge both of the packages and remerge them both with the
> "-sse -sse2" use and withouth sse flags in the cxxflags?
> 
> The error I had was exactly the same as yours, I use also gcc-4.3 (the latest
> ebuild in the main tree, with the multilib patch to be able to compile it) and
> that worked for me.
> 

I've unmerged crypto++, amule, removed the cxxflags... nothing, the result is the same...
Comment 13 Bjoern Thorwirth 2008-05-27 09:19:09 UTC
SAme here can't get any amule version to work .. getting the same message. Even with the stable one.
Comment 14 Bjoern Thorwirth 2008-05-27 09:20:41 UTC
Created attachment 154445 [details]
emerge --info

and btw .. no sse sse2 use flags here and gcc 4.1.2
Comment 15 Raúl Porcel (RETIRED) gentoo-dev 2008-06-13 15:39:49 UTC
Check with 2.2.1
Comment 16 Jason Lynch 2008-06-14 04:05:55 UTC
This crash is happening for me, even in 2.2.1.
Comment 17 Jason Lynch 2008-06-14 04:10:39 UTC
Created attachment 156699 [details]
paludis --info amule
Comment 18 Jason Lynch 2008-06-14 05:49:44 UTC
Ok, it definitely looks like a problem in crypto++ itself. (I've manually compiled crypto++ outside the tree and it fails its own test suite on my system.)

However, I have managed to work around the problem by compiling crypto++ with CXXFLAGS="-O1 -march=native -pipe" instead of "-O2 -march=native -pipe". (You'll need to recompile aMule after reinstalling crypto++ because it's a static linkage.)

Now, as far as crypto++ goes, I have no idea why -O1 leads to a working library while -O2 doesn't. It may be worth bringing this to the attention of the crypto++ devs. I also haven't tested with any compiler other than 4.3.1 so I don't know if it's GCC-related or not.
Comment 19 Piotr 2008-06-15 14:24:08 UTC
(In reply to comment #18)
> Ok, it definitely looks like a problem in crypto++ itself. (I've manually
> compiled crypto++ outside the tree and it fails its own test suite on my
> system.)
> 
> However, I have managed to work around the problem by compiling crypto++ with
> CXXFLAGS="-O1 -march=native -pipe" instead of "-O2 -march=native -pipe".
> (You'll need to recompile aMule after reinstalling crypto++ because it's a
> static linkage.)
> 
> Now, as far as crypto++ goes, I have no idea why -O1 leads to a working library
> while -O2 doesn't. It may be worth bringing this to the attention of the
> crypto++ devs. I also haven't tested with any compiler other than 4.3.1 so I
> don't know if it's GCC-related or not.
> 

This solution works for me.
Comment 20 Jure Repinc 2008-06-22 15:11:01 UTC
*** Bug 228903 has been marked as a duplicate of this bug. ***
Comment 21 Joel 2008-06-25 08:45:54 UTC
(In reply to comment #18)
> Ok, it definitely looks like a problem in crypto++ itself. (I've manually
> compiled crypto++ outside the tree and it fails its own test suite on my
> system.)
> 
> However, I have managed to work around the problem by compiling crypto++ with
> CXXFLAGS="-O1 -march=native -pipe" instead of "-O2 -march=native -pipe".
> (You'll need to recompile aMule after reinstalling crypto++ because it's a
> static linkage.)
> 
> Now, as far as crypto++ goes, I have no idea why -O1 leads to a working library
> while -O2 doesn't. It may be worth bringing this to the attention of the
> crypto++ devs. I also haven't tested with any compiler other than 4.3.1 so I
> don't know if it's GCC-related or not.
> 

Yes, it also works for me. Thanks
Comment 22 Alexander Huemer 2008-07-14 19:02:45 UTC
is there already a non-hacking solution for the problem?
i just emerged amule, saw that is not working and found this bug, which is several weeks old now.
wouldn't a it be sufficient to disable O levels >2 for crypto++? in the ebuild until the the problem is fixed upstream?
Comment 23 Raúl Porcel (RETIRED) gentoo-dev 2008-08-01 18:23:23 UTC
Reopening since this is not fixed.

And regarding the fix, i don't think there's a way to check if something was compiled with certain CFLAGS :/
Guess a warning in the ebuild is the maximum we can do.
Comment 24 Raúl Porcel (RETIRED) gentoo-dev 2008-08-01 18:25:30 UTC
*** Bug 221039 has been marked as a duplicate of this bug. ***
Comment 25 Santiago M. Mola (RETIRED) gentoo-dev 2008-08-01 21:30:41 UTC
crypto++ is severly broken with optimization above -O1. When it causes problems it'll fail tests and print an error recommending trying lower optimization.

Since we can't make users run test suite by default, probably dev-libs/crypto++ should force -O1.

I doubt there's any aMule fault at all. So it's crypto's team call.
Comment 26 Daniel Black (RETIRED) gentoo-dev 2008-08-02 02:32:32 UTC
(In reply to comment #25)
> crypto++ is severly broken with optimization above -O1. When it causes problems
> it'll fail tests and print an error recommending trying lower optimization.
> 
> Since we can't make users run test suite by default, probably dev-libs/crypto++
> should force -O1.

sounds good.

> I doubt there's any aMule fault at all. So it's crypto's team call.

on behalf of crypto i concur. I'll a little to sick be thinking about commiting stuff however I'm happy if anyone else does.
Comment 27 Raúl Porcel (RETIRED) gentoo-dev 2008-08-05 18:06:11 UTC
I've forced -O1 on crypto++, for those having issues, please sync in an hour or so and recompile crypto++.
Comment 28 Raúl Porcel (RETIRED) gentoo-dev 2008-08-13 17:36:36 UTC
*** Bug 234649 has been marked as a duplicate of this bug. ***