scrīpsit Philipp Takacs <phil...@bureaucracy.de>:

| [2016-12-25 12:18] m...@mmmmarascio.xyz
| >
| > part 1     text/plain                 303
| > | [2016-07-29 00:26] markus schnalke <mei...@marmaro.de>
| > | >
| > | > @all: Has anyone verified that the latest version runs fine with
| > | > musl libc?
| > 
| > mmh builds without a problem on Void Linux with gcc 6.3 and
| > musl 1.1.15.
| > 
| > Output from configuration, from compilation and from testing is
| > attached.
|
| Thanks for the tests.
|
|
| > ==1665== Invalid free() / delete / delete[] / realloc()
| > ==1665==    at 0x4CABE00: free (in 
| /usr/lib/valgrind/vgpreload_memcheck-amd6
| > 4-linux.so)
| > ==1665==    by 0x406EACE: reclaim_gaps (dynlink.c:488)
| > ==1665==    by 0x406F042: map_library (dynlink.c:708)
| > ==1665==    by 0x406FC4D: load_library (dynlink.c:1014)
| > ==1665==    by 0x4070978: load_preload (dynlink.c:1112)
| > ==1665==    by 0x4070978: __dls3 (dynlink.c:1581)
| > ==1665==    by 0x40705C5: __dls2 (dynlink.c:1383)
| > ==1665==    by 0x4072C27: ??? (in /usr/lib/libc.so)
| > ==1665==    by 0x3: ???
| > ==1665==    by 0xFFF000D86: ???
| > ==1665==    by 0xFFF000D8A: ???
| > ==1665==    by 0xFFF000D92: ???
| > ==1665==    by 0xFFF000D98: ???
| > ==1665==  Address 0x4eb6200 is in a rw- mapped file 
| /usr/lib/valgrind/vgprel
| > oad_memcheck-amd64-linux.so segment
| > ==1665== 
| > ==1665== Conditional jump or move depends on uninitialised value(s)
| > ==1665==    at 0x406314C: strlen (strlen.c:15)
| > ==1665==    by 0x406FC6E: load_library (dynlink.c:1023)
| > ==1665==    by 0x407012B: load_deps (dynlink.c:1085)
| > ==1665==    by 0x4070989: __dls3 (dynlink.c:1582)
| > ==1665==    by 0x40705C5: __dls2 (dynlink.c:1383)
| > ==1665==    by 0x4072C27: ??? (in /usr/lib/libc.so)
| > ==1665==    by 0x3: ???
| > ==1665==    by 0xFFF000D86: ???
| > ==1665==    by 0xFFF000D8A: ???
| > ==1665==    by 0xFFF000D92: ???
| > ==1665==    by 0xFFF000D98: ???
| > ==1665== 
| > ==1665== Conditional jump or move depends on uninitialised value(s)
| > ==1665==    at 0x40629AF: stpcpy (stpcpy.c:20)
| > ==1665==    by 0x4062D48: strcpy (strcpy.c:8)
| > ==1665==    by 0x406FD49: load_library (dynlink.c:1043)
| > ==1665==    by 0x407012B: load_deps (dynlink.c:1085)
| > ==1665==    by 0x4070989: __dls3 (dynlink.c:1582)
| > ==1665==    by 0x40705C5: __dls2 (dynlink.c:1383)
| > ==1665==    by 0x4072C27: ??? (in /usr/lib/libc.so)
| > ==1665==    by 0x3: ???
| > ==1665==    by 0xFFF000D86: ???
| > ==1665==    by 0xFFF000D8A: ???
| > ==1665==    by 0xFFF000D92: ???
| > ==1665==    by 0xFFF000D98: ???
| > ==1665== 
| > ==1665== Conditional jump or move depends on uninitialised value(s)
| > ==1665==    at 0x406314C: strlen (strlen.c:15)
| > ==1665==    by 0x40633BF: strrchr (strrchr.c:7)
| > ==1665==    by 0x406FD5C: load_library (dynlink.c:1045)
| > ==1665==    by 0x407012B: load_deps (dynlink.c:1085)
| > ==1665==    by 0x4070989: __dls3 (dynlink.c:1582)
| > ==1665==    by 0x40705C5: __dls2 (dynlink.c:1383)
| > ==1665==    by 0x4072C27: ??? (in /usr/lib/libc.so)
| > ==1665==    by 0x3: ???
| > ==1665==    by 0xFFF000D86: ???
| > ==1665==    by 0xFFF000D8A: ???
| > ==1665==    by 0xFFF000D92: ???
| > ==1665==    by 0xFFF000D98: ???
| > ==1665== 
| > ==1665== Conditional jump or move depends on uninitialised value(s)
| > ==1665==    at 0x406314C: strlen (strlen.c:15)
| > ==1665==    by 0x402797A: setlocale (setlocale.c:55)
| > ==1665==    by 0x40249F: main (inc.c:174)
| > ==1665== 
| > ==1665== Conditional jump or move depends on uninitialised value(s)
| > ==1665==    at 0x406314C: strlen (strlen.c:15)
| > ==1665==    by 0x404001: concat (concat.c:33)
| > ==1665==    by 0x4044CF: context_read (context_read.c:97)
| > ==1665==    by 0x4024BD: main (inc.c:177)
| > ==1665== 
| > ==1665== Conditional jump or move depends on uninitialised value(s)
| > ==1665==    at 0x40629AF: stpcpy (stpcpy.c:20)
| > ==1665==    by 0x4062D48: strcpy (strcpy.c:8)
| > ==1665==    by 0x40B639: toabsdir (path.c:296)
| > ==1665==    by 0x40472D: context_read (context_read.c:140)
| > ==1665==    by 0x4024BD: main (inc.c:177)
| > ==1665== 
| > ==1665== Conditional jump or move depends on uninitialised value(s)
| > ==1665==    at 0x406314C: strlen (strlen.c:15)
| > ==1665==    by 0x404001: concat (concat.c:33)
| > ==1665==    by 0x404898: context_read (context_read.c:174)
| > ==1665==    by 0x4024BD: main (inc.c:177)
| > ==1665== 
| > ==1665== Conditional jump or move depends on uninitialised value(s)
| > ==1665==    at 0x406314C: strlen (strlen.c:15)
| > ==1665==    by 0x4062E6D: strdup (strdup.c:7)
| > ==1665==    by 0x4029B8: main (inc.c:299)
| > ==1665== 
| > ==1665== Conditional jump or move depends on uninitialised value(s)
| > ==1665==    at 0x40629AF: stpcpy (stpcpy.c:20)
| > ==1665==    by 0x4062D48: strcpy (strcpy.c:8)
| > ==1665==    by 0x40B639: toabsdir (path.c:296)
| > ==1665==    by 0x402A03: main (inc.c:307)
| > ==1665== 
| > ==1665== Conditional jump or move depends on uninitialised value(s)
| > ==1665==    at 0x40629AF: stpcpy (stpcpy.c:20)
| > ==1665==    by 0x4062D48: strcpy (strcpy.c:8)
| > ==1665==    by 0x40B639: toabsdir (path.c:296)
| > ==1665==    by 0x405CB2: folder_read (folder_read.c:36)
| > ==1665==    by 0x402A96: main (inc.c:317)
| > ==1665== 
| > ==1665== Conditional jump or move depends on uninitialised value(s)
| > ==1665==    at 0x40622AB: memchr (memchr.c:19)
| > ==1665==    by 0x405D2F3: printf_core (vfprintf.c:602)
| > ==1665==    by 0x405DAA5: vfprintf (vfprintf.c:678)
| > ==1665==    by 0x4060657: vsnprintf (vsnprintf.c:37)
| > ==1665==    by 0x405AD2E: snprintf (snprintf.c:9)
| > ==1665==    by 0x40BD7C: seq_public (seq_read.c:71)
| > ==1665==    by 0x40BCE9: seq_read (seq_read.c:44)
| > ==1665==    by 0x405FFC: folder_read (folder_read.c:154)
| > ==1665==    by 0x402A96: main (inc.c:317)
| > ==1665== 
| > ==1665== Conditional jump or move depends on uninitialised value(s)
| > ==1665==    at 0x406314C: strlen (strlen.c:15)
| > ==1665==    by 0x40BEB3: seq_private (seq_read.c:119)
| > ==1665==    by 0x40BCF5: seq_read (seq_read.c:47)
| > ==1665==    by 0x405FFC: folder_read (folder_read.c:154)
| > ==1665==    by 0x402A96: main (inc.c:317)
| > ==1665== 
| > ==1665== Conditional jump or move depends on uninitialised value(s)
| > ==1665==    at 0x406314C: strlen (strlen.c:15)
| > ==1665==    by 0x40589BE: fputs (fputs.c:6)
| > ==1665==    by 0x403650: scan (scansbr.c:118)
| > ==1665==    by 0x402E83: main (inc.c:400)
| > ==1665== 
| > ==1665== Conditional jump or move depends on uninitialised value(s)
| > ==1665==    at 0x40629AF: stpcpy (stpcpy.c:20)
| > ==1665==    by 0x4062D48: strcpy (strcpy.c:8)
| > ==1665==    by 0x40A6F0: m_getfld2 (m_getfld2.c:92)
| > ==1665==    by 0x4035A3: scan (scansbr.c:108)
| > ==1665==    by 0x402E83: main (inc.c:400)
| > ==1665== 
| > ==1665== Conditional jump or move depends on uninitialised value(s)
| > ==1665==    at 0x40629AF: stpcpy (stpcpy.c:20)
| > ==1665==    by 0x4062D48: strcpy (strcpy.c:8)
| > ==1665==    by 0x40A84A: m_getfld2 (m_getfld2.c:119)
| > ==1665==    by 0x4035A3: scan (scansbr.c:108)
| > ==1665==    by 0x402E83: main (inc.c:400)
| > ==1665== 
| > ==1665== Conditional jump or move depends on uninitialised value(s)
| > ==1665==    at 0x40629AF: stpcpy (stpcpy.c:20)
| > ==1665==    by 0x4062D48: strcpy (strcpy.c:8)
| > ==1665==    by 0x40AAC7: copyname (m_getfld2.c:207)
| > ==1665==    by 0x40A601: m_getfld2 (m_getfld2.c:79)
| > ==1665==    by 0x4035A3: scan (scansbr.c:108)
| > ==1665==    by 0x402E83: main (inc.c:400)
| > ==1665== 
| > ==1665== Conditional jump or move depends on uninitialised value(s)
| > ==1665==    at 0x406314C: strlen (strlen.c:15)
| > ==1665==    by 0x40589BE: fputs (fputs.c:6)
| > ==1665==    by 0x40381D: scan (scansbr.c:162)
| > ==1665==    by 0x402E83: main (inc.c:400)
| > ==1665== 
| > ==1665== Conditional jump or move depends on uninitialised value(s)
| > ==1665==    at 0x406314C: strlen (strlen.c:15)
| > ==1665==    by 0x40589BE: fputs (fputs.c:6)
| > ==1665==    by 0x4038E4: scan (scansbr.c:192)
| > ==1665==    by 0x402E83: main (inc.c:400)
| > ==1665== 
| > Test tests/inc/test-deb359167                                       
| PASS
|
| Are this problems caused by musl or by mmh, for me this looks
| like it's a musl problem.

I suspect the interaction of musl and valgrind.  I've only recently
begun working on a musl-based system and I've noticed that valgrind
reports numerous similar errors where it doesn't for programs
compiled against glibc.

| > hostname: sethostname: Operation not permitted
| > hostname: sethostname: Operation not permitted
| > tests/mhsign/test-mhsign: mhsign -enc 
| /tmp/mmh-test-XXFnPJDc/Mail/drafts/1 f
| > ailed
| > --- -       2016-12-25 12:13:43.492162240 -0700
| > +++ /tmp/tmp.XXXXdDaEJc     2016-12-25 12:13:43.491000000 -0700
| > @@ -1,5 +1,7 @@
| > +hostname: sethostname: Operation not permitted
| >  Could not find key for <unknownperson@>
| >  Could not find key for <unknownper...@example.org>
| > +hostname: sethostname: Operation not permitted
| >  Could not find key for <unknownperson@>
| >  Could not find key for <unknownper...@example.org>
| >  Could not find key for <unknownper...@example.org>
| > Test tests/mhsign/test-mhsign                                       
| FAIL
|
| This is a problem of mhsign and the tests, we use ``hostname''
| to get the hostname, if it isn't in the address. The problem
| is that hostname is not part of posix.
|
| The problem is, I haven't found a way to get the FQDN with
| pure posix. There is ``uname -n'', but the output of uname
| isn't nececary a FQDN.

If this functionality is needed then maybe we could provide it; for
example, consider the attached program "mmhhostname".

Michael
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/utsname.h>
#include <sys/socket.h>
#include <netdb.h>

int
main(int argc, char * argv[])
{
	char nname[257] = {'\0'};
	int err = 0;
	const struct addrinfo h = {AI_CANONNAME,AF_UNSPEC,0,0,0,0,0,0};
	struct addrinfo * a = 0;
	if (argc > 2)
	{
		(void)fprintf(stderr, "Usage: %s [hostname]\n", *argv);
		return 1;
	}
	if (argc == 2) (void)strcpy(nname, argv[1]);
	else
	{
		struct utsname u = {0};
		errno = 0;
		err = uname(&u);
		if (err)
		{
			perror("uname");
			return 1;
		}
		(void)strcpy(nname, u.nodename);
	}
	err = getaddrinfo(nname, 0, &h, &a);
	if (err)
	{
		(void)fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(err));
		freeaddrinfo(a);
		a = 0;
		return 1;
	}
	(void)puts(a->ai_canonname);
	freeaddrinfo(a);
	a = 0;
	return 0;
}

Reply via email to