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

Valgrind VVoes #16

Open
kondziu opened this issue Feb 13, 2020 · 2 comments
Open

Valgrind VVoes #16

kondziu opened this issue Feb 13, 2020 · 2 comments
Assignees
Labels
wontfix This will not be worked on

Comments

@kondziu
Copy link
Contributor

kondziu commented Feb 13, 2020

When running UFOs with valgrind, initialization fails with a confusing error (I'm new to valgrind, I hope this makes sense):

/opt/R-3.6.0/bin/R -d "valgrind --track-origins=yes --keep-stacktraces=alloc-and-free --error-limit=no --num-callers=40"
library(ufoseq)
ufo_seq(1,10,1)
--19530-- WARNING: unhandled amd64-linux syscall: 323
--19530-- You may be able to write your own handler.
--19530-- Read the file README_MISSING_SYSCALL_OR_IOCTL.
--19530-- Nevertheless we consider this a bug.  Please report
--19530-- it at http://valgrind.org/support/bug_reports.html.
syscall/userfaultfd: Function not implemented
error initializing User-Fault file descriptor: Function not implemented
Error in ufo_seq(1, 10, 1) : Error initializing the UFO framework (-1)

This also happens when running ufoTest:

valgrind --track-origins=yes --keep-stacktraces=alloc-and-free --error-limit=no --num-callers=40 ./ufoTest 5
==22423== Memcheck, a memory error detector
==22423== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==22423== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==22423== Command: ./ufoTest 5
==22423== 
--22423-- WARNING: unhandled amd64-linux syscall: 323
--22423-- You may be able to write your own handler.
--22423-- Read the file README_MISSING_SYSCALL_OR_IOCTL.
--22423-- Nevertheless we consider this a bug.  Please report
--22423-- it at http://valgrind.org/support/bug_reports.html.
syscall/userfaultfd: Function not implemented
error initializing User-Fault file descriptor: Function not implemented
x.x: Function not implemented
Err Init: Function not implemented
==22423== 
==22423== HEAP SUMMARY:
==22423==     in use at exit: 82,208 bytes in 4 blocks
==22423==   total heap usage: 12 allocs, 8 frees, 88,512 bytes allocated
==22423== 
==22423== LEAK SUMMARY:
==22423==    definitely lost: 0 bytes in 0 blocks
==22423==    indirectly lost: 0 bytes in 0 blocks
==22423==      possibly lost: 0 bytes in 0 blocks
==22423==    still reachable: 82,208 bytes in 4 blocks
==22423==         suppressed: 0 bytes in 0 blocks
==22423== Rerun with --leak-check=full to see details of leaked memory
==22423== 
==22423== For counts of detected and suppressed errors, rerun with: -v
==22423== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
@kondziu
Copy link
Contributor Author

kondziu commented Feb 13, 2020

I checked without valgrind.

__ufo_system = ufMakeInstance() returns 0x0, but ufInit(__ufo_system) returns result == 0

My understanding was that ufInit checks for NULL, but it turns out it doesn't. In fact ufMakeInstance should be checking for null before it starts allocating stuff inside the instance.

@electroCutie
Copy link
Collaborator

electroCutie commented Feb 17, 2020

WARNING: unhandled amd64-linux syscall: 323

Reference for syscall numbers here: https://gist.github.com/yamnikov-oleg/454f48c3c45b735631f2
323 on amd64 is the userfaultd syscall
This line in our code is where it is called
int uffd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK);

This is core and critical and cannot be avoided

@kondziu kondziu added the wontfix This will not be worked on label Feb 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants