* Test failure
@ 2017-09-01 3:34 Ian Zimmerman
2017-09-01 5:09 ` David Gibson
2017-09-02 3:50 ` Rusty Russell
0 siblings, 2 replies; 7+ messages in thread
From: Ian Zimmerman @ 2017-09-01 3:34 UTC (permalink / raw)
To: ccan
Trying to run make check on current master, I get:
[many successful tests snipped]
tools/ccanlint/ccanlint -s --deps-fail-ignore ccan/io/ && touch ccan/io/.ok
io: Module examples with expected output give that output (examples_run): FAIL
/tmp/ccanlint-24192.1804289383/example-_info-io.c:2:output '' didn't match 'tr a-z a-z'
io: Total score: 82/87 FAIL!
make: *** [Makefile:78: ccan/io/.ok] Error 1
What's up?
--
Please don't Cc: me privately on mailing lists and Usenet,
if you also post the followup to the list or newsgroup.
Do obvious transformation on domain to reply privately _only_ on Usenet.
_______________________________________________
ccan mailing list
ccan@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/ccan
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Test failure
2017-09-01 3:34 Test failure Ian Zimmerman
@ 2017-09-01 5:09 ` David Gibson
2017-09-01 16:30 ` Ian Zimmerman
2017-09-02 3:50 ` Rusty Russell
1 sibling, 1 reply; 7+ messages in thread
From: David Gibson @ 2017-09-01 5:09 UTC (permalink / raw)
To: ccan
[-- Attachment #1.1: Type: text/plain, Size: 731 bytes --]
On Thu, Aug 31, 2017 at 08:34:21PM -0700, Ian Zimmerman wrote:
> Trying to run make check on current master, I get:
>
> [many successful tests snipped]
>
> tools/ccanlint/ccanlint -s --deps-fail-ignore ccan/io/ && touch ccan/io/.ok
> io: Module examples with expected output give that output (examples_run): FAIL
> /tmp/ccanlint-24192.1804289383/example-_info-io.c:2:output '' didn't match 'tr a-z a-z'
>
> io: Total score: 82/87 FAIL!
> make: *** [Makefile:78: ccan/io/.ok] Error 1
>
> What's up?
What platform?
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
[-- Attachment #2: Type: text/plain, Size: 127 bytes --]
_______________________________________________
ccan mailing list
ccan@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/ccan
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Test failure
2017-09-01 5:09 ` David Gibson
@ 2017-09-01 16:30 ` Ian Zimmerman
0 siblings, 0 replies; 7+ messages in thread
From: Ian Zimmerman @ 2017-09-01 16:30 UTC (permalink / raw)
To: ccan
On 2017-09-01 15:09, David Gibson wrote:
> On Thu, Aug 31, 2017 at 08:34:21PM -0700, Ian Zimmerman wrote:
> > Trying to run make check on current master, I get:
> >
> > [many successful tests snipped]
> >
> > tools/ccanlint/ccanlint -s --deps-fail-ignore ccan/io/ && touch ccan/io/.ok
> > io: Module examples with expected output give that output (examples_run): FAIL
> > /tmp/ccanlint-24192.1804289383/example-_info-io.c:2:output '' didn't match 'tr a-z a-z'
> >
> > io: Total score: 82/87 FAIL!
> > make: *** [Makefile:78: ccan/io/.ok] Error 1
> >
> > What's up?
>
> What platform?
matica!1 ~$ gcc --version
gcc (Gentoo 5.4.0-r3 p1.3, pie-0.6.5) 5.4.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
matica!2 ~$ uname -a
Linux matica 4.4.84 #1 SMP Fri Aug 25 22:31:12 PDT 2017 x86_64
AMD Phenom(tm) II X4 955 Processor AuthenticAMD GNU/Linux
matica!3 ~$ ld --version
GNU ld (Gentoo 2.28.1 p1.0) 2.28.1
Copyright (C) 2017 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.
matica!8 ~$ info libc | head -7 | tail -2
This is ‘The GNU C Library Reference Manual’, for Version 2.23 (Gentoo
2.23-r4 p8) of the GNU C Library.
matica!9 ~$ info coreutils | head -7 | tail -2
This manual documents version 8.25 of the GNU core utilities, including
the standard programs for text and file manipulation.
--
Please don't Cc: me privately on mailing lists and Usenet,
if you also post the followup to the list or newsgroup.
Do obvious transformation on domain to reply privately _only_ on Usenet.
_______________________________________________
ccan mailing list
ccan@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/ccan
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Test failure
2017-09-01 3:34 Test failure Ian Zimmerman
2017-09-01 5:09 ` David Gibson
@ 2017-09-02 3:50 ` Rusty Russell
2017-09-02 8:00 ` Ian Zimmerman
1 sibling, 1 reply; 7+ messages in thread
From: Rusty Russell @ 2017-09-02 3:50 UTC (permalink / raw)
To: ccan
Ian Zimmerman <itz@very.loosely.org> writes:
> Trying to run make check on current master, I get:
>
> [many successful tests snipped]
>
> tools/ccanlint/ccanlint -s --deps-fail-ignore ccan/io/ && touch ccan/io/.ok
> io: Module examples with expected output give that output (examples_run): FAIL
> /tmp/ccanlint-24192.1804289383/example-_info-io.c:2:output '' didn't match 'tr a-z a-z'
>
> io: Total score: 82/87 FAIL!
> make: *** [Makefile:78: ccan/io/.ok] Error 1
>
> What's up?
Hmm, can't reproduce here.
Can you run this test manually?
$ tools/ccanlint/ccanlint -k --target=examples_run ccan/io
$ echo tr A-Z a-z | strace /tmp/ccanlint-*/example-_info-io tr A-Z a-z
The output should show what's going wrong.
Thanks!
Rusty.
_______________________________________________
ccan mailing list
ccan@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/ccan
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Test failure
2017-09-02 3:50 ` Rusty Russell
@ 2017-09-02 8:00 ` Ian Zimmerman
2017-09-04 0:51 ` Rusty Russell
0 siblings, 1 reply; 7+ messages in thread
From: Ian Zimmerman @ 2017-09-02 8:00 UTC (permalink / raw)
To: ccan
[-- Attachment #1: Type: text/plain, Size: 918 bytes --]
On 2017-09-02 13:20, Rusty Russell wrote:
> > tools/ccanlint/ccanlint -s --deps-fail-ignore ccan/io/ && touch ccan/io/.ok
> > io: Module examples with expected output give that output (examples_run): FAIL
> > /tmp/ccanlint-24192.1804289383/example-_info-io.c:2:output '' didn't match 'tr a-z a-z'
> >
> > io: Total score: 82/87 FAIL!
> > make: *** [Makefile:78: ccan/io/.ok] Error 1
> >
> > What's up?
>
> Hmm, can't reproduce here.
>
> Can you run this test manually?
>
> $ tools/ccanlint/ccanlint -k --target=examples_run ccan/io
> $ echo tr A-Z a-z | strace /tmp/ccanlint-*/example-_info-io tr A-Z a-z
>
> The output should show what's going wrong.
Attached. I can't make any sense of it w/o dropping to gdb.
--
Please don't Cc: me privately on mailing lists and Usenet,
if you also post the followup to the list or newsgroup.
Do obvious transformation on domain to reply privately _only_ on Usenet.
[-- Attachment #2: test_output --]
[-- Type: text/plain, Size: 4357 bytes --]
execve("/tmp/ccanlint-2217.1804289383/example-_info-io", ["/tmp/ccanlint-2217.1804289383/ex"..., "/tmp/ccanlint-28097.1804289383/e"..., "tr", "A-Z", "a-z"], [/* 51 vars */]) = 0
brk(NULL) = 0x7ee000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f6c74233000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=114539, ...}) = 0
mmap(NULL, 114539, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f6c74217000
close(3) = 0
open("/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\340\7\2\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1680808, ...}) = 0
mmap(NULL, 3786968, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6c73c74000
mprotect(0x7f6c73e07000, 2097152, PROT_NONE) = 0
mmap(0x7f6c74007000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x193000) = 0x7f6c74007000
mmap(0x7f6c7400d000, 14552, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f6c7400d000
close(3) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f6c74216000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f6c74215000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f6c74214000
arch_prctl(ARCH_SET_FS, 0x7f6c74215700) = 0
mprotect(0x7f6c74007000, 16384, PROT_READ) = 0
mprotect(0x60a000, 4096, PROT_READ) = 0
mprotect(0x7f6c74234000, 4096, PROT_READ) = 0
munmap(0x7f6c74217000, 114539) = 0
pipe([3, 4]) = 0
pipe([5, 6]) = 0
clone(child_stack=NULL, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f6c742159d0) = 4488
close(3) = 0
close(6) = 0
rt_sigaction(SIGPIPE, {sa_handler=SIG_IGN, sa_mask=[PIPE], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f6c73ca7690}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
brk(NULL) = 0x7ee000
brk(0x80f000) = 0x80f000
fcntl(0, F_GETFL) = 0 (flags O_RDONLY)
fcntl(0, F_SETFL, O_RDONLY|O_NONBLOCK) = 0
fcntl(4, F_GETFL) = 0x1 (flags O_WRONLY)
fcntl(4, F_SETFL, O_WRONLY|O_NONBLOCK) = 0
fcntl(5, F_GETFL) = 0 (flags O_RDONLY)
fcntl(5, F_SETFL, O_RDONLY|O_NONBLOCK) = 0
fcntl(1, F_GETFL) = 0x8402 (flags O_RDWR|O_APPEND|O_LARGEFILE)
fcntl(1, F_SETFL, O_RDWR|O_APPEND|O_NONBLOCK|O_LARGEFILE) = 0
poll([{fd=0, events=POLLIN}, {fd=-4}, {fd=5, events=POLLIN}, {fd=1, events=POLLOUT}], 4, -1) = 3 ([{fd=0, revents=POLLIN|POLLHUP}, {fd=5, revents=POLLIN}, {fd=1, revents=POLLOUT}])
read(0, "tr A-Z a-z\n", 4096) = 11
read(5, "\0", 4095) = 1
write(1, "\0", 1) = 1
poll([{fd=0, events=POLLIN}, {fd=4, events=POLLOUT}, {fd=5, events=POLLIN}, {fd=1, events=POLLOUT}], 4, -1) = 3 ([{fd=0, revents=POLLHUP}, {fd=4, revents=POLLOUT}, {fd=1, revents=POLLOUT}])
close(0) = 0
write(4, "tr A-Z a-z\n", 11) = 11
close(4) = 0
poll([{fd=1, events=POLLOUT}, {fd=5, events=POLLIN}], 2, -1) = 1 ([{fd=1, revents=POLLOUT}])
write(1, "\0", 1) = 1
poll([{fd=-1}, {fd=5, events=POLLIN}], 2, -1) = 1 ([{fd=5, revents=POLLIN}])
read(5, "r a-z a-z\n", 4094) = 10
poll([{fd=1, events=POLLOUT}, {fd=5, events=POLLIN}], 2, -1) = 2 ([{fd=1, revents=POLLOUT}, {fd=5, revents=POLLHUP}])
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=4488, si_uid=1000, si_status=0, si_utime=0, si_stime=0} ---
write(1, " a-z a-z\n", 9 a-z a-z
) = 9
close(5) = 0
poll([{fd=1, events=POLLOUT}], 1, -1) = 1 ([{fd=1, revents=POLLOUT}])
write(1, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 18446744073709551607) = -1 EFAULT (Bad address)
close(1) = 0
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 4488
exit_group(0) = ?
+++ exited with 0 +++
[-- Attachment #3: Type: text/plain, Size: 127 bytes --]
_______________________________________________
ccan mailing list
ccan@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/ccan
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Test failure
2017-09-02 8:00 ` Ian Zimmerman
@ 2017-09-04 0:51 ` Rusty Russell
2017-09-04 5:32 ` Ian Zimmerman
0 siblings, 1 reply; 7+ messages in thread
From: Rusty Russell @ 2017-09-04 0:51 UTC (permalink / raw)
To: Ian Zimmerman, ccan
So many bugs in one example program!
There was an unrelated but which strace revealed (trying to write -7
bytes), but I think your issue was more prosaic: failing to zero the
from buffer.
Does this patch fix it for you?
Thanks!
Rusty.
diff --git a/ccan/io/_info b/ccan/io/_info
index fe49df5c..6e95e4ab 100644
--- a/ccan/io/_info
+++ b/ccan/io/_info
@@ -61,9 +61,10 @@
* {
* // Remove what we just wrote.
* b->start += b->wlen;
+ * b->wlen = 0;
* assert(b->start <= sizeof(b->buf));
*
- * // If we wrote something, wake writer.
+ * // If we wrote something, wake reader.
* if (b->wlen != 0)
* io_wake(b);
*
@@ -114,6 +115,7 @@
* io_new_conn(NULL, tochild[1], write_out, &to);
*
* // Read from child, write to stdout.
+ * memset(&from, 0, sizeof(from));
* reader = io_new_conn(NULL, fromchild[0], read_in, &from);
* io_set_finish(reader, finish, &from);
* io_new_conn(NULL, STDOUT_FILENO, write_out, &from);
_______________________________________________
ccan mailing list
ccan@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/ccan
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: Test failure
2017-09-04 0:51 ` Rusty Russell
@ 2017-09-04 5:32 ` Ian Zimmerman
0 siblings, 0 replies; 7+ messages in thread
From: Ian Zimmerman @ 2017-09-04 5:32 UTC (permalink / raw)
To: ccan
On 2017-09-04 10:21, Rusty Russell wrote:
> So many bugs in one example program!
>
> There was an unrelated but which strace revealed (trying to write -7
> bytes), but I think your issue was more prosaic: failing to zero the
> from buffer.
>
> Does this patch fix it for you?
It does indeed. Now I can at last think about writing my own code and
tests :-) Thanks.
Btw, no need to Cc me, I'm subscribed to the list.
--
Please don't Cc: me privately on mailing lists and Usenet,
if you also post the followup to the list or newsgroup.
Do obvious transformation on domain to reply privately _only_ on Usenet.
_______________________________________________
ccan mailing list
ccan@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/ccan
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2017-09-04 5:32 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-01 3:34 Test failure Ian Zimmerman
2017-09-01 5:09 ` David Gibson
2017-09-01 16:30 ` Ian Zimmerman
2017-09-02 3:50 ` Rusty Russell
2017-09-02 8:00 ` Ian Zimmerman
2017-09-04 0:51 ` Rusty Russell
2017-09-04 5:32 ` Ian Zimmerman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).