Solved Amule won't run on FreeBSD-13.1-RELEASE because "segmentation fault" error.

Hello.

Today I installed and tried to run net-p2p/amule and I saw that it didn't work. It caused the segmentation fault error. I've sent an email to the package maintainer and he replied to me like this:


I've added the line manually on the file where it was missing: /usr/src/stand/efi/libefi/devicename.c

Can someone tell me if the procedure below is the correct one to apply the fix?
Code:
cd /usr/src
make -j 8

Should I recompile everything inside the src folder or only a smaller part? What's the correct procedure to apply only that fix? thanks.
 
I've sent an email to the package maintainer and he replied to me like this :
Fore sure that bug report has nothing to do with net-p2p/amule segfault, totally unrelated. I suspect the port maintainer pasted a wrong link.

Also, there are already two opened PRs addressing the issue:

Reported: 2022-10-06 PR 266866 - net-p2p/amule-2.3.3_4: executable amuled segfaults immediately after launch
Reported: 2022-10-20 PR 267216 - net-p2p/amule: amuled 2.3.3 core dumps
 
I can reproduce the segmentation fault here. But it is deep in C++ crypto libraries doing hashes.

This looks related:
This sounds right. I have had a version of amule running within the last 6 months made from ports. Unfortunately I lost my pkg configs in a recent reinstall. It is not amule itself it is in one of the libraries that amule is depending on that is causing this. But n. Very likely the crypto. It has nothing to do with boot on zfs to do whatsoever!!. I am using ufs2 :D,
 
try building cryptopp yourself
look like the package build may have had LTO enabled which seems to break cryptopp
 
I just built cryptopp and amule from sources and the segfault is still there.
from one of the links above i found this test program
C++:
#include <iostream>
#include <string>

#include "cryptlib.h"
#include "pwdbased.h"
#include "sha.h"
#include "hex.h"

int main(int argc, char* argv[])
{
    using namespace CryptoPP;

    byte password[] ="password";
    size_t plen = strlen((const char*)password);

    byte salt[] = "salt";
    size_t slen = strlen((const char*)salt);

    byte derived[SHA256::DIGESTSIZE];

    PKCS12_PBKDF<SHA256> pbkdf;
    byte purpose = 0;

    pbkdf.DeriveKey(derived, sizeof(derived), purpose, password, plen, salt, slen, 1024, 0.0f);

    std::string result;
    HexEncoder encoder(new StringSink(result));

    encoder.Put(derived, sizeof(derived));
    encoder.MessageEnd();

    std::cout << "Derived: " << result << std::endl;

    return 0;
}
build with
c++ -o crypto_test -I/usr/local/include/cryptopp -L/usr/local/lib/ -lcryptopp crypto_test1.cc
it bombs with pkg, works with my build
 
from one of the links above i found this test program
C++:
#include <iostream>
#include <string>

#include "cryptlib.h"
#include "pwdbased.h"
#include "sha.h"
#include "hex.h"

int main(int argc, char* argv[])
{
    using namespace CryptoPP;

    byte password[] ="password";
    size_t plen = strlen((const char*)password);

    byte salt[] = "salt";
    size_t slen = strlen((const char*)salt);

    byte derived[SHA256::DIGESTSIZE];

    PKCS12_PBKDF<SHA256> pbkdf;
    byte purpose = 0;

    pbkdf.DeriveKey(derived, sizeof(derived), purpose, password, plen, salt, slen, 1024, 0.0f);

    std::string result;
    HexEncoder encoder(new StringSink(result));

    encoder.Put(derived, sizeof(derived));
    encoder.MessageEnd();

    std::cout << "Derived: " << result << std::endl;

    return 0;
}
build with
c++ -o crypto_test -I/usr/local/include/cryptopp -L/usr/local/lib/ -lcryptopp crypto_test1.cc
it bombs with pkg, works with my build

For me, this test program also segfaults with a self-build cryptopp. 14-current/amd64.
 
from one of the links above i found this test program
C++:
#include <iostream>
#include <string>

#include "cryptlib.h"
#include "pwdbased.h"
#include "sha.h"
#include "hex.h"

int main(int argc, char* argv[])
{
    using namespace CryptoPP;

    byte password[] ="password";
    size_t plen = strlen((const char*)password);

    byte salt[] = "salt";
    size_t slen = strlen((const char*)salt);

    byte derived[SHA256::DIGESTSIZE];

    PKCS12_PBKDF<SHA256> pbkdf;
    byte purpose = 0;

    pbkdf.DeriveKey(derived, sizeof(derived), purpose, password, plen, salt, slen, 1024, 0.0f);

    std::string result;
    HexEncoder encoder(new StringSink(result));

    encoder.Put(derived, sizeof(derived));
    encoder.MessageEnd();

    std::cout << "Derived: " << result << std::endl;

    return 0;
}
build with
c++ -o crypto_test -I/usr/local/include/cryptopp -L/usr/local/lib/ -lcryptopp crypto_test1.cc
it bombs with pkg, works with my build

Can you explain better what shoud I do make amule work correctly ? I've created a file called "crypto_test1.cc" with the following code inside :

Code:
#include <iostream>
#include <string>

#include "cryptlib.h"
#include "pwdbased.h"
#include "sha.h"
#include "hex.h"

int main(int argc, char* argv[])
{
    using namespace CryptoPP;

    byte password[] ="password";
    size_t plen = strlen((const char*)password);

    byte salt[] = "salt";
    size_t slen = strlen((const char*)salt);

    byte derived[SHA256::DIGESTSIZE];

    PKCS12_PBKDF<SHA256> pbkdf;
    byte purpose = 0;

    pbkdf.DeriveKey(derived, sizeof(derived), purpose, password, plen, salt, slen, 1024, 0.0f);

    std::string result;
    HexEncoder encoder(new StringSink(result));

    encoder.Put(derived, sizeof(derived));
    encoder.MessageEnd();

    std::cout << "Derived: " << result << std::endl;

    return 0;
}

and I've compiled it with your command :

Code:
# c++ -o crypto_test -I/usr/local/include/cryptopp -L/usr/local/lib/ -lcryptopp crypto_test1.cc

it produced the compiled file called "crypto_test". Now,what should I do now ?
 
Yeah, that simply posts your email to the freebsd-ports mailing list. The person that responded is probably just someone that subscribed to it. It's not the maintainer that responded, because this port doesn't have one.
 
No doubt aMule has functional limitations on all platforms. High CPU usage and unusual speed drops within a few minutes. I recommend using net-p2p/mldonkey via http://localhost:4080/, at least it worked fine on other platforms. Not tested on FreeBSD.

I've installed mldonkey-gui (because I prefer to have the gui when there is one :p),but I don't understand how to run it. How is called the executable? I looked for the file mldonkey-gui all over the disk,but I didn't find it.
 
If you look at pkg info -l mldonkey-gui, you'll notice the executable is called mlgui.
 
This sounds right. I have had a version of amule running within the last 6 months made from ports. Unfortunately I lost my pkg configs in a recent reinstall. It is not amule itself it is in one of the libraries that amule is depending on that is causing this. But n. Very likely the crypto. It has nothing to do with boot on zfs to do whatsoever!!. I am using ufs2 :D,

Can you check better for the correct options ? It's nice to use amule.
 
I'm trying to add the servers listed here :


but they aren't accepted. On terminal I see this error :

Code:
2023/02/08 18:05:56 Exception (connect failed: Connection refused) before connect to host 127.0.0.1:
52575
2023/02/08 18:06:41 Exception (connect failed: Connection refused) before connect to host 127.0.0.1:
33769
2023/02/08 18:07:14 Exception (connect failed: Connection refused) before connect to host 127.0.0.1:
44655

and so on...
 
It's been several years since I last used MLDonkey, but you're supposed to run the mlnet service and have the GUI connect to that. The GUI simply allows you to control that service.
 
Back
Top