aMule Forum

English => Compilation problems => Topic started by: Festor on December 22, 2007, 09:31:04 AM

Title: Compile error with CVS 20071222
Post by: Festor on December 22, 2007, 09:31:04 AM
Again  :-\

Ubuntu 7.10, gcc versión 4.1.3, wxWidgets 2.8.4

Quote
i486-linux-gnu-g++  -DUSE_EMBEDDED_CRYPTO  -W -Wall -Wshadow -Wundef -O2  -DUSE_WX_EXTENSIONS  -Wl,-z,defs -lGeoIP  -lpthread -o amuled  amuled-amuled.o amuled-Timer.o amuled-RC4Encrypt.o amuled-amule.o amuled-BaseClient.o amuled-ClientList.o amuled-ClientCreditsList.o amuled-ClientTCPSocket.o amuled-ClientUDPSocket.o amuled-DownloadClient.o amuled-DownloadQueue.o amuled-ECSpecialCoreTags.o amuled-EMSocket.o amuled-EncryptedStreamSocket.o amuled-EncryptedDatagramSocket.o amuled-ExternalConn.o amuled-Friend.o amuled-FriendList.o amuled-HTTPDownload.o amuled-IPFilter.o amuled-KnownFileList.o amuled-ListenSocket.o amuled-MuleUDPSocket.o amuled-SearchFile.o amuled-SearchList.o amuled-ServerConnect.o amuled-ServerList.o amuled-ServerSocket.o amuled-ServerUDPSocket.o amuled-SharedFileList.o amuled-ThreadTasks.o amuled-UploadBandwidthThrottler.o amuled-UploadClient.o amuled-UploadQueue.o amuled-Kademlia.o amuled-Search.o amuled-Indexed.o amuled-KademliaUDPListener.o amuled-Prefs.o amuled-RoutingZone.o amuled-Contact.o amuled-UPnP.o amuled-UPnPCompatibility.o amuled-ClientCredits.o amuled-ECSpecialMuleTags.o amuled-KnownFile.o amuled-GetTickCount.o amuled-GuiEvents.o amuled-Logger.o amuled-PartFile.o amuled-Preferences.o amuled-Proxy.o amuled-Server.o amuled-Statistics.o amuled-StatTree.o amuled-SHAHashSet.o amuled-TerminationProcess.o amuled-UserEvents.o amuled-OtherFunctions.o amuled-NetworkFunctions.o  -L. -lmuleappcommon -Llibs/common -Llibs/ec/cpp -lmulecommon -lec     -L. -lmuleappcore -pthread   -lwx_baseu_net-2.8 -lwx_baseu-2.8  -lz
./libmuleappcommon.a(libmuleappcommon_a-ED2KLink.o): In function `wxTransform2D::Transform(wxRect2DInt*) const':
/usr/include/wx-2.8/wx/geometry.h:794: undefined reference to `wxRect2DInt::operator=(wxRect2DInt const&)'
./libmuleappcommon.a(libmuleappcommon_a-ED2KLink.o): In function `wxTransform2D::InverseTransform(wxRect2DInt*) const':
/usr/include/wx-2.8/wx/geometry.h:803: undefined reference to `wxRect2DInt::operator=(wxRect2DInt const&)'
collect2: ld devolvió el estado de salida 1
make[4]: *** [amuled] Error 1
make[4]: se sale del directorio `/home/festor/amule-20071222/src'
make[3]: *** [all-recursive] Error 1
make[3]: se sale del directorio `/home/festor/amule-20071222/src'
make[2]: *** [all-recursive] Error 1
make[2]: se sale del directorio `/home/festor/amule-20071222'
make[1]: *** [all] Error 2
make[1]: se sale del directorio `/home/festor/amule-20071222'
make: *** [build-stamp] Error 2
Title: Re: Compile error with CVS 20071222
Post by: wuischke on December 22, 2007, 11:10:27 AM
Please upgrade to wxGTK 2.8.7 and try it again to see if it is caused by te wx version. (it works here with wx 2.8.7)
Title: Re: Compile error with CVS 20071222
Post by: Festor on December 22, 2007, 11:52:28 AM
Ubuntu 7.10 uses only wxGTK 2.8.4

It is not that we can very easily update ... :(

EDIT: I found this page (http://wiki.wxpython.org/InstallingOnUbuntuOrDebian), maybe it is possible to install the latest version using deb packages. Let me try...
Title: Re: Compile error with CVS 20071222
Post by: wuischke on December 22, 2007, 12:59:47 PM
On Ubuntu that's pretty simple: http://wiki.wxpython.org/InstallingOnUbuntuOrDebian
Title: Re: Compile error with CVS 20071222
Post by: Festor on December 22, 2007, 01:01:49 PM
ok, I will try :D
Title: Re: Compile error with CVS 20071222
Post by: Vollstrecker on December 22, 2007, 01:21:14 PM
The same with 2.8.7.1
http://vollstreckernet.dyndns.org/amule-cvs-testing-build.log
Title: Re: Compile error with CVS 20071222
Post by: Festor on December 22, 2007, 01:30:57 PM
Oh! Shit!  :'( The same problem occurs (with 2.8.7.1):

Quote
i486-linux-gnu-g++  -DUSE_EMBEDDED_CRYPTO  -W -Wall -Wshadow -Wundef -O2  -DUSE_WX_EXTENSIONS  -Wl,-z,defs -lGeoIP  -lpthread -o amuled  amuled-amuled.o amuled-Timer.o amuled-RC4Encrypt.o amuled-amule.o amuled-BaseClient.o amuled-ClientList.o amuled-ClientCreditsList.o amuled-ClientTCPSocket.o amuled-ClientUDPSocket.o amuled-DownloadClient.o amuled-DownloadQueue.o amuled-ECSpecialCoreTags.o amuled-EMSocket.o amuled-EncryptedStreamSocket.o amuled-EncryptedDatagramSocket.o amuled-ExternalConn.o amuled-Friend.o amuled-FriendList.o amuled-HTTPDownload.o amuled-IPFilter.o amuled-KnownFileList.o amuled-ListenSocket.o amuled-MuleUDPSocket.o amuled-SearchFile.o amuled-SearchList.o amuled-ServerConnect.o amuled-ServerList.o amuled-ServerSocket.o amuled-ServerUDPSocket.o amuled-SharedFileList.o amuled-ThreadTasks.o amuled-UploadBandwidthThrottler.o amuled-UploadClient.o amuled-UploadQueue.o amuled-Kademlia.o amuled-Search.o amuled-Indexed.o amuled-KademliaUDPListener.o amuled-Prefs.o amuled-RoutingZone.o amuled-Contact.o amuled-UPnP.o amuled-UPnPCompatibility.o amuled-ClientCredits.o amuled-ECSpecialMuleTags.o amuled-KnownFile.o amuled-GetTickCount.o amuled-GuiEvents.o amuled-Logger.o amuled-PartFile.o amuled-Preferences.o amuled-Proxy.o amuled-Server.o amuled-Statistics.o amuled-StatTree.o amuled-SHAHashSet.o amuled-TerminationProcess.o amuled-UserEvents.o amuled-OtherFunctions.o amuled-NetworkFunctions.o  -L. -lmuleappcommon -Llibs/common -Llibs/ec/cpp -lmulecommon -lec     -L. -lmuleappcore -pthread   -lwx_baseu_net-2.8 -lwx_baseu-2.8  -lz
./libmuleappcommon.a(libmuleappcommon_a-ED2KLink.o): In function `wxTransform2D::Transform(wxRect2DInt*) const':
/usr/include/wx-2.8/wx/geometry.h:794: undefined reference to `wxRect2DInt::operator=(wxRect2DInt const&)'
./libmuleappcommon.a(libmuleappcommon_a-ED2KLink.o): In function `wxTransform2D::InverseTransform(wxRect2DInt*) const':
/usr/include/wx-2.8/wx/geometry.h:803: undefined reference to `wxRect2DInt::operator=(wxRect2DInt const&)'
collect2: ld devolvió el estado de salida 1
make[4]: *** [amuled] Error 1
make[4]: se sale del directorio `/home/festor/amule-20071222/src'
make[3]: *** [all-recursive] Error 1
make[3]: se sale del directorio `/home/festor/amule-20071222/src'
make[2]: *** [all-recursive] Error 1
make[2]: se sale del directorio `/home/festor/amule-20071222'
make[1]: *** [all] Error 2
make[1]: se sale del directorio `/home/festor/amule-20071222'
make: *** [build-stamp] Error 2
Title: Re: Compile error with CVS 20071222
Post by: wuischke on December 22, 2007, 02:08:12 PM
Then you can downgrade your wx again if you don't want inofficial packages. I'll try to dig through Vollstrecker's logfile and the code for the reason, but I would appreciate if you could test this with other versions of a debian derived distribution.
Title: Re: Compile error with CVS 20071222
Post by: Vollstrecker on December 22, 2007, 02:15:25 PM
Here is the log of the stable build.

http://ccc-hanau.de/~vollstrecker/amule-cvs-stable-build.log

The two logs are created everyday, so you can simply check if all worked.
Title: Re: Compile error with CVS 20071222
Post by: Stu Redman on December 22, 2007, 03:20:42 PM
Builds fine here (amuled + amulegui) with wxGTK 2.8.7 (compiled it myself) on Ubuntu 7.10 .  :-*
Title: Re: Compile error with CVS 20071222
Post by: agarsab on December 22, 2007, 03:33:42 PM
I think I have the same problem.
I use Feisty x86_64 with official  wx 2.8.4.0-0ubuntu3.

Quote
/usr/include/wx-2.8/wx/image.h: In member function ‘wxImageHistogramBase_wxImplementation_HashTable::Node** wxImageHistogramBase_wxImplementation_HashTable::GetNodePtr(const long unsigned int&) const’:
/usr/include/wx-2.8/wx/image.h:136: aviso: la dereferencia de punteros de tipo castigado romperá las reglas de alias estricto
make[4]: *** [libmuleappgui_a-ChatWnd.o] Error 1
make[4]: se sale del directorio `/media/sda1/software/linux/amule-20071221/src'
Title: Re: Compile error with CVS 20071222
Post by: Festor on December 22, 2007, 03:38:19 PM
Builds fine here (amuled + amulegui) with wxGTK 2.8.7 (compiled it myself) on Ubuntu 7.10 .  :-*

Do you mean that you have compiled wxGTK, no? What parameters used?
Title: Re: Compile error with CVS 20071222
Post by: llanerosolitario on December 22, 2007, 03:59:41 PM
since  19/12/2007 i can´t  debianize (make)  sources, i have tried with debian 4.0 and ubuntu 7.10.
I  could make a .deb with the source from 24/11/2007...
I hope it will be repaired early thanks,  because it  is not a problem of debian and it's distributions (i think)
Sorry by my english it is very poor...  ???
Title: Re: Compile error with CVS 20071222
Post by: Festor on December 22, 2007, 04:05:14 PM
The latest sources that work well are those of the December 18, 2007:

http://www.hirnriss.net/files/cvs/aMule-CVS-20071218.tar.bz2
Title: Re: Compile error with CVS 20071222
Post by: Stu Redman on December 22, 2007, 04:59:52 PM
Do you mean that you have compiled wxGTK, no? What parameters used?
I have installed wxGTK-2.8.7 (http://prdownloads.sourceforge.net/wxwindows/wxGTK-2.8.7.tar.gz) in user space (but I don't think that matters):
 ./configure --prefix=/home/jars/work/wx/386 --with-gtk --enable-unicode --enable-optimise
make
make install
sudo ldconfig /home/jars/work/wx/386/lib

aMule:
 ./configure --with-wx-config=/home/jars/work/wx/386/bin/wx-config ...

Title: Re: Compile error with CVS 20071222
Post by: Attila on December 22, 2007, 05:34:23 PM
I've managed to compile 20071222 but it's very unstable and crashes shortly after starting up. I'm running Debian Lenny with a .6.22-3-686 kernel and gcc 4.1. I compiled wxALL 2.8.7 from source using the --enable-unicode switch. I then compiled amule with no errors but now I guess the error when running amule from the console:
Code: [Select]
initialising aMule
Checking if there is an instance already running...
No other instances are running.
HTTP download thread started
Loading temp files from /home/xxx/.aMule/Temp.
Loading PartFile 1 of 1
All PartFiles Loaded.
ListenSocket: Ok.

External connections disabled in config file
*** Server UDP socket (TCP+3) at 0.0.0.0:4665
*** TCP socket (TCP) listening on 0.0.0.0:4662
*** Client UDP socket (extended eMule) at 0.0.0.0:4672
Adding file /home/xxx/.aMule/Temp/007.part.met to shares
Empty dir /home/xxx/.aMule/Incoming/ shared
HTTP download thread started
Host: amule.sourceforge.net:80
URL: http://amule.sourceforge.net/lastversion
Response: 200 (Error: 0)
Download size: 6
HTTP download thread ended
Host: emulepawcio.sourceforge.net:80
URL: http://emulepawcio.sourceforge.net/nieuwe_site/Ipfilter_fakes/ipfilter.dat
Response: 302 (Error: 0)
Host: emulepawcio.sourceforge.net:80
URL: http://emulepawcio.sourceforge.net/downloads/get.php?file=ipfilter.dat
Response: 302 (Error: 0)
Host: Auto-select.dl.sourceforge.net:80
URL: http://Auto-select.dl.sourceforge.net/sourceforge/emulepawcio/ipfilter.dat
Response: 302 (Error: 0)
Host: guide.opendns.com:80
URL: http://guide.opendns.com/?url=auto-select.dl.sourceforge.net%2Fsourceforge%2Femulepawcio%2Fipfilter.dat
Response: 200 (Error: 0)
Download size: -1
HTTP download thread ended
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/debug/vector:192:
    error: attempt to subscript container with out-of-bounds index 2, but
    container only holds 2 elements.

Objects involved in the operation:
sequence "this" @ 0x0xb507c0a0 {
  type = N15__gnu_debug_def6vectorIcSaIcEEE;
}
Aborted
I can do a full debug run and post it in the backtrace forum if need be.
Cheers,
Attila
Title: Re: Compile error with CVS 20071222
Post by: Stu Redman on December 22, 2007, 06:40:38 PM
That's a bug in MuleUDPSocket.cpp line 253:
Old:
Code: [Select]
if (GetTickCount() - item.time < UDPMAXQUEUETIME) {
char sendbuffer[packet->GetPacketSize() + 2];
memcpy(sendbuffer, packet->GetUDPHeader(), 2);
memcpy(sendbuffer + 2, packet->GetDataBuffer(), packet->GetPacketSize());

New:
Code: [Select]
if (GetTickCount() - item.time < UDPMAXQUEUETIME) {
std::vector<char> sendbuffer(packet->GetPacketSize() + 2);
memcpy(&(sendbuffer[0]), packet->GetUDPHeader(), 2);
memcpy(&(sendbuffer[2]), packet->GetDataBuffer(), packet->GetPacketSize());

What's happening is a zero sized packed. memcpy works fine if it should copy zero bytes (and does nothing), but with the new code &(sendbuffer[2] fails now.
I've patched it up with
Code: [Select]
if (GetTickCount() - item.time < UDPMAXQUEUETIME && packet->GetPacketSize()) { // otherwise crash on zero sized packets (wherever they may come from)At least it hasn't crashed since.
Personally I do like plain arrays better than complicated classes, and this is a good example why.  ;)
I just hope there aren't more bugs like this, because there are quite some changes of this sort in this version.
Title: Re: Compile error with CVS 20071222
Post by: Attila on December 22, 2007, 08:36:45 PM
Thanks for that Sturedman. I'll wait a couple of days to see if there are more cases like that.
Cheers,
Attila
Title: Re: Compile error with CVS 20071222
Post by: Festor on December 23, 2007, 09:34:05 AM
Note: The problem persists in the 20071223 CVS
Title: Re: Compile error with CVS 20071222
Post by: GrayFox.i0n on December 23, 2007, 02:17:46 PM
Note: The problem persists in the 20071223 CVS

Agreed
Title: Re: Compile error with CVS 20071222
Post by: wuischke on December 24, 2007, 10:57:22 AM
sturedman: I've committed your fix, thanks a lot.
Title: Re: Compile error with CVS 20071222
Post by: Stu Redman on December 24, 2007, 12:45:48 PM
You're welcome!  :D
Title: Re: Compile error with CVS 20071222
Post by: Kry on December 24, 2007, 05:21:21 PM
My bad. The reason the plain arrays were changed to std::vector is MSVC doesn't support variable size in array initializers (and actually ANSI doesn't, either, it's a GCC extension).

Would be cool if someone reviewed it all indeed. I actually need to review this fix, because it might not be right. Thanks anyway!
Title: Re: Compile error with CVS 20071222
Post by: Attila on December 24, 2007, 05:43:53 PM
Thanks Kry. Is there any info I can provide that would be useful? If not I'll shut up and be patient.
Cheers,
Attila
Title: Re: Compile error with CVS 20071222
Post by: Kry on December 24, 2007, 06:31:19 PM
Nto right onw, I'm afraid. Just keep testing!
Title: Re: Compile error with CVS 20071222
Post by: Stu Redman on December 25, 2007, 07:11:01 PM
Would be cool if someone reviewed it all indeed. I actually need to review this fix, because it might not be right. Thanks anyway!
This bug would have slipped past any review because the code refactoring was fine and nobody would have thought of a zero sized packet beforehand probably. The fix is just a patch (literally speaking), the real fix should prevent trying to send zero sized packets.
Thank you for all the great work by the way !  :-*