Hi!
Here is another solusion!!
Use Doug Lea's dlmalloc and dlfree!!
And say goodbye to glibc's malloc!!
Usage:
tar xvf djbdns-1.05.tar.gz
wget
http://hasiru.net/djbdns-malloc.patch patch -p0 <djbdns-malloc.patch
cd djbdns-1.05
echo gcc -O2 -include /usr/include/errno.h > conf-cc
wget
http://gee.cs.oswego.edu/pub/misc/malloc.c wget
http://gee.cs.oswego.edu/pub/misc/malloc.h make setup check
This is my patch
diff -puNr djbdns-1.05.org/Makefile djbdns-1.05/Makefile
--- djbdns-1.05.org/Makefile 2001-02-12 06:11:45.000000000 +0900
+++ djbdns-1.05/Makefile 2020-11-22 16:19:26.553298861 +0900
@@ -7,16 +7,20 @@ default: it
alloc.a: \
makelib alloc.o alloc_re.o getln.o getln2.o stralloc_cat.o \
stralloc_catb.o stralloc_cats.o stralloc_copy.o stralloc_eady.o \
-stralloc_num.o stralloc_opyb.o stralloc_opys.o stralloc_pend.o
+stralloc_num.o stralloc_opyb.o stralloc_opys.o stralloc_pend.o malloc.o
./makelib alloc.a alloc.o alloc_re.o getln.o getln2.o \
stralloc_cat.o stralloc_catb.o stralloc_cats.o \
stralloc_copy.o stralloc_eady.o stralloc_num.o \
- stralloc_opyb.o stralloc_opys.o stralloc_pend.o
+ stralloc_opyb.o stralloc_opys.o stralloc_pend.o malloc.o
alloc.o: \
compile alloc.c alloc.h error.h
./compile alloc.c
+malloc.o: \
+compile malloc.c malloc.h
+ ./compile malloc.c
+
alloc_re.o: \
compile alloc_re.c alloc.h byte.h
./compile alloc_re.c
diff -puNr djbdns-1.05.org/alloc.c djbdns-1.05/alloc.c
--- djbdns-1.05.org/alloc.c 2001-02-12 06:11:45.000000000 +0900
+++ djbdns-1.05/alloc.c 2020-11-22 16:19:08.746255487 +0900
@@ -1,6 +1,6 @@
-#include <stdlib.h>
#include "alloc.h"
#include "error.h"
+#include "malloc.h"
#define ALIGNMENT 16 /* XXX: assuming that this alignment is enough */
#define SPACE 2048 /* must be multiple of ALIGNMENT */
@@ -16,7 +16,7 @@ unsigned int n;
char *x;
n = ALIGNMENT + n - (n & (ALIGNMENT - 1)); /* XXX: could overflow */
if (n <= avail) { avail -= n; return space + avail; }
- x = malloc(n);
+ x = dlmalloc(n);
if (!x) errno = error_nomem;
return x;
}
@@ -27,5 +27,5 @@ char *x;
if (x >= space)
if (x < space + SPACE)
return; /* XXX: assuming that pointers are flat */
- free(x);
+ dlfree(x);
}
Reinin Oyama <lenin@hasiru.net>???
> Hi! All!
>
> I use 'MUSL' instead of glic-2.32 in ArchLinux.
>
> pacman -Syu musl
>
> And I changed conf-cc and conf-ld to
>
> conf-cc:
> musl-gcc -static -include /usr/lib/musl/include/errno.h
>
> conf-ld:
> musl-gcc -static -s
>
> svc -d /service/tinydns
>
> make setup check
>
> svc -u /service/tinydns
>
> dnsq any mydomain.net 127.0.0.1
> !!
> !!
> !!
> !!
> !!
> !!
> !!
> !!
> !!
> !!
> !!
> !!
> ........
>
> tinydns WORKS VERY FINE !!!!!!!!!
>
>
>
> Reinin Oyama <lenin@hasiru.net>???
> > Hi!
> >
> > I found the CAUSE of this problem!!!!!!
> >
> > glibc-2.32's malloc function has a BUG!!!!
> >
> > djbdns errors in alloc funtion in malloc function.
> >
> > We will use sbrk() systemcall instead???????
> >
> >
> > lenin@hasiru.net???
> > > Hi!
> > >
> > > I found the reason why. [ /etc/tinydns/root: file does not exist]
> > > Chroot /etc/tinydns/root has done!
> > >
> > > But I cannot solve the problem.
> > >
> > > Why tinydns stops answering afer 6 times.
> > > The other hand dnscache works very fine.
> > >
> > > Very Very confused.
> > >
> > >
> > > lenin@hasiru.net???
> > > > Hi!
> > > >
> > > > I try to find solution.
> > > > I edit server.c main function.
> > > >
> > > > for (;;) {
> > > > len = socket_recv4(udp53,buf,sizeof buf,ip,&port);
> > > > if (len < 0) continue;
> > > > if (!doit()) continue;
> > > > if (response_len > 512) response_tc();
> > > > socket_send4(udp53,response,response_len,ip,port);
> > > > /* may block for buffer space; if it fails, too bad */
> > > > }
> > > >
> > > > Try to change like this
> > > >
> > > > for (;;) {
> > > > len = socket_recv4(udp53,buf,sizeof buf,ip,&port);
> > > > if (len < 0) continue;
> > > > if (!doit()){
> > > > droproot(fatal);
> > > > initialize();
> > > > ndelay_off(udp53);
> > > > socket_tryreservein(udp53,65536);
> > > > buffer_putsflush(buffer_2,starting);
> > > > continue;
> > > > }
> > > > if (response_len > 512) response_tc();
> > > > socket_send4(udp53,response,response_len,ip,port);
> > > > /* may block for buffer space; if it fails, too bad */
> > > > }
> > > >
> > > > And I find it working(but slow).
> > > >
> > > > And find multilog's current like follows
> > > >
> > > > @400000005fb72058371301b4 7f000001:9f4a:5c9a + 00ff mydomain.net
> > > > @400000005fb7205925c7bae4 7f000001:dc36:255b - 00ff mydomain.net
> > > > @400000005fb7205925c7c69c tinydns: fatal: unable to chdir to /
etc/
> > > > tinydns/root: file does not exist
> > > > @400000005fb72059263355c4 starting tinydns
> > > > @400000005fb7205a26fab0ec 7f000001:eab4:b342 + 00ff mydomain.net
> > > >
> > > > /etc/tinydns/root not exist????
> > > > Why??? Very strange.
> > > >
> > > >
> > > >
> > > > Reinin Oyama <lenin@hasiru.net>???
> > > > > I never use nslookup. nslookup is a crazy tool.
> > > > >
> > > > > I use "" dnsq ""
> > > > >
> > > > >
> > > > >
> > > > > Erwin Hoffmann <feh@fehcom.de>???
> > > > > > Hi Reinin,
> > > > > >
> > > > > > maybe you just use another DNS lookup tool like nslookup or
> dig
> > to
> > > > > verify that tinydns is not responding.
> > > > > >
> > > > > > The log file content of tinydns is explained here:
> > > > > >
> > > > > > https://www.fehcom.de/ipnet/djbdnscurve6/man/tinydns-log.5.html
> > > > > >
> > > > > > (ok, this is my version of tinydns; but this should not
matter
> > > here)
> > > > > >
> > > > > > It could be a communication/network failure not due to
tinydns
> > but
> > > > > dnsq you have used.
> > > > > >
> > > > > >
> > > > > > Apart from that: Recompiling and re-installation of djbdns
> would
> > > be
> > > > my
> > > > > first attempt.
> > > > > >
> > > > > > Regards.
> > > > > > --eh.
> > > > > >
> > > > > >
> > > > > > > Am 18.11.2020 um 11:51 schrieb Reinin Oyama <lenin@hasiru.net
> >
> > :
> > > > > > >
> > > > > > > Hi
> > > > > > >
> > > > > > > dnscache is not setting up.
> > > > > > > I run only tinydns.
> > > > > > > and My /service/tinydns/log/main/current is follows.
> > > > > > >
> > > > > > > @400000005fb4fb7725ff9b94 starting tinydns
> > > > > > > @400000005fb4fb8817385024 7f000001:19df:41d7 + 00ff
mydomain.
> > net
> > > > > > > @400000005fb4fb891eea44bc 7f000001:1524:a933 + 00ff
mydomain.
> > net
> > > > > > > @400000005fb4fb8a1098d914 7f000001:af96:54ac + 00ff
mydomain.
> > net
> > > > > > > @400000005fb4fb8b00db8d14 7f000001:6d09:ae80 + 00ff
mydomain.
> > net
> > > > > > > @400000005fb4fb8b29602f9c 7f000001:8ba6:c3ca + 00ff
mydomain.
> > net
> > > > > > > @400000005fb4fb8c173379dc 7f000001:8801:1823 + 00ff
mydomain.
> > net
> > > > > > > @400000005fb4fb8d03300464 7f000001:8354:cc58 - 00ff
mydomain.
> > net
> > > > > > > @400000005fb4fb8e0467308c 7f000001:8a7f:844f - 00ff
mydomain.
> > net
> > > > > > >
> > > > > > > I think they have no anwer.......
> > > > > > >
> > > > > > > John Conover <conover@rahul.net>???
> > > > > > >> lenin@hasiru.net writes:
> > > > > > >>> Multilog process is running very well.
> > > > > > >>> cd /service/tinydns
> > > > > > >>> svc -t .
> > > > > > >>>
> > > > > > >>> Then tinydns runs normally again.
> > > > > > >>> but after 6-8 query(dnsq) , it stops working.
> > > > > > >>> The other hand, multilog is running very well.
> > > > > > >>>
> > > > > > >>>
> > > > > > >>> Paul Jarc <prj@case.edu>ã•ã‚“:
> > > > > > >>>> This would be more appropriate for the dns list:
> > > > > > >>>> https://cr.yp.to/lists.html#dns
> > > > > > >>>>
> > > > > > >>>> Reinin Oyama <lenin@hasiru.net> wrote:
> > > > > > >>>>> It stops working after 10 or 20 query.
> > > > > > >>>>
> > > > > > >>>> Is the logger working? This sounds like the log pipe
> might
> > > be
> > > > > > > full.
> > > > > > >>
> > > > > > >> Perhaps
> > > > > > >>
> > > > > > >> /service/tinydns/log/main/current
> > > > > > >> /service/dnscache/log/main/tinydns
> > > > > > >>
> > > > > > >> might provide an answer.
> > > > > > >>
> > > > > > >> John
> > > > > > >>
> > > > > > >> --
> > > > > > >>
> > > > > > >> John Conover, conover@rahul.net, http://www.johncon.com/
> > > > > > >
> > > > > > >
> > > > > > > ----------------------------------------------------------
--
> --
> > > > > > > ????????????
> > > > > > > ??????????
> > > > > > > email: lenin@hasiru.net
> > > > > > > web: https://www.hasiru.net
> > > > > >
> > > > > > Dr. Erwin Hoffmann | FEHCom | http://www.fehcom.de | PGP
Key-
> Id
> > > > > 7E4034BE
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > > --------------------------------------------------------------
> > > > > ????????????
> > > > > ??????????
> > > > > email: lenin@hasiru.net
> > > > > web: https://www.hasiru.net
> >
> >
> > --------------------------------------------------------------
> > ????????????
> > ??????????
> > email: lenin@hasiru.net
> > web: https://www.hasiru.net
>
>
> --------------------------------------------------------------
> ????????????
> ??????????
> email: lenin@hasiru.net
> web: https://www.hasiru.net
--------------------------------------------------------------
????????????
??????????
email: lenin@hasiru.net
web:
https://www.hasiru.net