Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shared library support for rv-predict. #812

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Shared library support for rv-predict. #812

wants to merge 1 commit into from

Conversation

virgil-serbanuta
Copy link
Contributor

@virgil-serbanuta virgil-serbanuta commented Oct 9, 2017

Sample output for lpcq. Note the extra pipes in the stack addresses.

-- Window 1 --
-- Window 2 --
Data race on [0x000000000177fcf0 : 0x0000000000401ee2/0x00007fcca4d72c80]:
Read in thread 2
> {0x0000000000401f90|}
{0x0000000000402c5e|}
{0x000000000040a0c6|}
Thread 2 created by thread 1
{0x00000000004028fd|}

Write in thread 1
  > {0x0000000000402189|}
    {0x0000000000403078|}
    {0x0000000000402a13|}
    {0x00007fcca62b5830|/lib/x86_64-linux-gnu/libc.so.6}
Thread 1 is the main thread

Data race on [0x00007ffe9c252018 : 0x0000000000402fb5/0x00007ffe9c251e60 0x00000000004024de/0x00007ffe9c252050]:
Read in thread 2
> {0x0000000000401f0d|}
{0x0000000000402c5e|}
{0x000000000040a0c6|}
Thread 2 created by thread 1
{0x00000000004028fd|}

Write in thread 1
  > {0x0000000000402162|}
    {0x0000000000403078|}
    {0x0000000000402a13|}
    {0x00007fcca62b5830|/lib/x86_64-linux-gnu/libc.so.6}
Thread 1 is the main thread

@@ -1299,6 +1335,10 @@ consume_and_print_trace(rvp_pstate_t *ps, rvp_ubuf_t *ub, size_t *nfullp)
/* need to top off buffer? */
if (*nfullp < oi->oi_reclen)
return oi->oi_reclen - *nfullp;
Copy link
Contributor

@gnuoyd gnuoyd Oct 10, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since get_ub_length() >= oi->oi_reclen, you probably don't need both this and the following code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a code comment with my current understanding of the code, explaining why the two if statements are needed, please tell me if I am wrong.

@virgil-serbanuta
Copy link
Contributor Author

Hi David,

I'll be travelling in the next two days, and I don't know how much I'll be able to continue this work until Monday, so here are some details in case you need them:

I tried to make the addresses resolvable with addr2line in various ways, but I couldn't. Here's an example with a race, which has a dynamic library with debug symbols in its trace:
#813

As compiled on my computer, the stack trace address lies in the second LOAD section of libsharedlibrary.so, with an offset of 0x677, which puts it in the .text segment, with an offset of 0x117 (values computed from the offsets printed by the progam and by readelf -l libsharedlibrary.so and readelf -S libsharedlibrary.so; since I got an address near the end of the .text segment, I assume that they are correct).

However, addr2line does not seem impressed by my computations, and I can't figure out how to make it print anything related to my code, e.g.:
:virgil@vdtop:~/runtime-verification/tmp/examples/library-example$ addr2line -j .text -e libsharedlibrary.so 117
??:?

I've also tried other ways of making addr2line return an address in my code, but failed.

@virgil-serbanuta virgil-serbanuta changed the title Shared library support for rv-predict. DO NOT REVIEW YET Shared library support for rv-predict. Oct 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants