<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 12/26/2018 07:06 PM,
<a class="moz-txt-link-abbreviated" href="mailto:richard.purdie@linuxfoundation.org">richard.purdie@linuxfoundation.org</a> wrote:<br>
</div>
<blockquote
cite="mid:8569515ec23ddf8ca122621a6f59d89b024066df.camel@linuxfoundation.org"
type="cite">
<pre wrap="">On Wed, 2018-12-26 at 10:09 +0800, ChenQi wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Hi All,
'oe-selftest -r package.PackageTests.test_gdb_hardlink_debug' fails.
I did the tests on both my Fedora27 and ubuntu16.04 servers. They both
failed.
I can also reproduce this issue manually.
I did some investigation. No clue how to fix this it. So I want to seek
help from community.
Below is some output from oe-selftest.
[snip]
2018-12-26 09:27:58,440 - oe-selftest - INFO - test_gdb_hardlink_debug
(package.PackageTests)
2018-12-26 09:37:55,333 - oe-selftest - INFO - gdbtest /usr/bin/hello1
2018-12-26 09:37:59,904 - oe-selftest - ERROR - GDB result:
1: Reading symbols from /usr/bin/hello1...Reading symbols from
/usr/bin/.debug/hello4...done.
done.
(gdb) Breakpoint 1 at 0x1060: file /usr/include/bits/stdio2.h, line 107.
(gdb) Starting program: /usr/bin/hello1
Breakpoint 1, main () at /usr/include/bits/stdio2.h:107
107 /usr/include/bits/stdio2.h: No such file or directory.
(gdb) Continuing.
Hello World!
[Inferior 1 (process 312) exited normally]
(gdb)
2018-12-26 09:38:00,907 - oe-selftest - INFO - ... FAIL
[snip]
The hello world problem is as follows.
$ cat
meta-selftest/recipes-test/selftest-hardlink/selftest-hardlink/hello.c
#include <stdio.h>
int main() {
printf("Hello World!\n");
}
Some extra information:
1. Remove '-O2' or '-D_FORTIFY_SOURCE=2', and it works correctly.
2. Adding some system call like daemon(0,0) before printf also works.
3. Reverting poky repo to 1c048479af7cc98e30f9a33d1f3bef03711544aa,
which adds this selftest case, does not work. It still fails.
4. Hongxu confirms that things work on his host.
5. I also don't see failure about this test case on yocto's autobuilder.
Could somebody help to provide some suggestions?
</pre>
</blockquote>
<pre wrap="">
This is strange and there must be some difference between your
configuration and what what we test on the autobuilder or on Hongxu's
setup.
</pre>
</blockquote>
<br>
Hi Richard,<br>
<br>
I have talked with Hongxu and we can now both confirm that there
does exist some problem.<br>
<br>
<blockquote
cite="mid:8569515ec23ddf8ca122621a6f59d89b024066df.camel@linuxfoundation.org"
type="cite">
<pre wrap="">
Which DISTRO and MACHINE are you using?
</pre>
</blockquote>
<br>
DISTRO is poky<br>
MACHINE is qemux86.<br>
<br>
It seems that if MACHINE is qemux86-64, the test case could pass.
But that's just because the test case only checks 'Breakpoint 1,
main () at hello.c:4'. See the console output below.<br>
(gdb) b main<br>
<b>Breakpoint 1 at 0x1050: file /usr/include/bits/stdio2.h, line
107.</b><br>
(gdb) r<br>
Starting program: /usr/bin/hello1 <br>
<br>
<b>Breakpoint 1, main () at hello.c:4</b><br>
4 printf("Hello World!\n");<br>
(gdb) c<br>
Continuing.<br>
Hello World!<br>
[Inferior 1 (process 156) exited normally]<br>
(gdb) q<br>
<br>
Even in this case, the 'b main' does not give correct result. The
test case passes because 'Breakpoint 1, main () at hello.c:4' is
there.<br>
<br>
On qemux86, we have:<br>
<b>(gdb) Breakpoint 1 at 0x1060: file /usr/include/bits/stdio2.h,
line 107.</b><br>
(gdb) Starting program: /usr/bin/hello1 <br>
<br>
<b>Breakpoint 1, main () at /usr/include/bits/stdio2.h:107</b><br>
107 /usr/include/bits/stdio2.h: No such file or directory.<br>
(gdb) Continuing.<br>
Hello World!<br>
[Inferior 1 (process 156) exited normally]<br>
(gdb)<br>
<br>
<blockquote
cite="mid:8569515ec23ddf8ca122621a6f59d89b024066df.camel@linuxfoundation.org"
type="cite">
<pre wrap="">
I think the key to resolving this is will be to understanding how to
reproduce it...
</pre>
</blockquote>
<br>
Two ways to reproduce the problem:<br>
<br>
I) reproduce it via oe-selftest<br>
1) . oe-init-build-env build-selftest<br>
2) SANITY_TESTED_DISTROS = ""<br>
3) oe-selftest -r package.PackageTests.test_gdb_hardlink_debug<br>
<br>
II) reproduce it manually<br>
1) add meta-selftest to bblayers.conf<br>
2) IMAGE_INSTALL_append = " selftest-hardlink selftest-hardlink-dbg
selftest-hardlink-gdb"<br>
3) bitbake core-image-minimal<br>
4) On target:<br>
gdb /usr/bin/hello1<br>
(gdb) b main<br>
<br>
Best Regards,<br>
Chen Qi<br>
<br>
<blockquote
cite="mid:8569515ec23ddf8ca122621a6f59d89b024066df.camel@linuxfoundation.org"
type="cite">
<pre wrap="">
I think its worth investigating and figuring out...
Cheers,
Richard
</pre>
</blockquote>
<p><br>
</p>
</body>
</html>