ygrek / mldonkey

cross-platform multi-network p2p daemon (previously at http://mldonkey.sourceforge.net/)
Other
251 stars 46 forks source link

Crash in Resolving some DNS #45

Open glechapelain opened 4 years ago

glechapelain commented 4 years ago

Hi!

I am getting a crash on start-up:

2020/05/08 21:36:26 [DNS] Resolving [germ] ... 2020/05/08 21:36:26 [DNS] Resolving [www.mldonkey.org] ...

0 in alloc_host_entry 1 in unix_gethostbyname 2 in camlIpmake_entry_from_name_1176 of src/utils/net/ip.ml:172 3 in camlIpget_entry_cached_1185 of src/utils/net/ip.ml:226 4 in camlIpfrom_name_1198 of src/utils/net/ip.ml:240 5 in camlDriverMainresolve_name_1142 of src/daemon/driver/driverMain.ml:378 6 in camlList__exists_1136 of list.ml:131

GDB is on line 390 of driverMain.ml: in let hostnames = ["www.mldonkey.org"; "mldonkey.sf.net"; "www.mldonkey.net"; "www.google.com"] in => DriverInteractive.dns_works := List.exists resolve_name hostnames;

I can (and may) dig deeper by debugging in OCaml as well. I am rolling on the old one though, that OCaml auto-install: 4.01.0)

I updated http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=54695 as it could be NetBSD specific

ygrek commented 4 years ago

4.01.0 is too archaic there were fixes to unix_gethostbyname in newer versions (e.g. ocaml/ocaml@0178ea4e8e1d2377432ece01cb0d9bd83d20d6d2), please try building with at least 4.03

glechapelain commented 4 years ago

Thank you!

So I change config/configure.in to use ocaml 4.03 but I get the error

gmake: /usr/pkgsrc/net/mldonkey/work/mldonkey-3.1.7/patches/local/bin/camlp4: Command not found
gmake: *** [Makefile:5470: tools/ocamlpp.ml] Error 127
*** Error code 2

I'll keep looking..

I'm leveraging from the local build system for ocaml to try decoupling the packages mldonkey & ocaml in NetBSD's pkgsrc

ygrek commented 4 years ago
  1. why do you need to make changes to configure.in? what exact changes? did you run autoconf after that?
  2. the log says you are using ocaml installed by mldonkey, but your comment says that you use ocaml from netbsd, I am confused
  3. please always show full configure and make log for such issues
ygrek commented 4 years ago

(in general - the newer ocaml you can use - the better)

glechapelain commented 4 years ago

Hi ! Thank you for attending my problem, sorry for the confusion:

I was getting the release 3.1.7 which I made myself by forking your repo, which is probably not the right way to go... I think I did that because another issue was already fixed in the current repo. When using the local-building of OCaml mechanism, it was taking OCaml 4.01, you said take 4.03 so that's what I changed to where I found it mentioned.

I am trying to not use the OCaml from pkgsrc, (that's what I meant by decoupling) but I am still using a locally modified version of mldonkey's pkgsrc.

ygrek commented 4 years ago

It should build locally without problems via opam. Install opam with your package manager, then :

git clone git://github.com/ygrek/mldonkey.git
cd mldonkey
opam init # if needed
opam sw create . 4.09.0
eval $(opam env)
opam install camlp4 num
./configure --enable-upnp-natpmp
make