Bug 396367 - unhandled syscall amd64-darwin unix:520 (terminate_with_payload) and unix:521 (abort_with_payload)
Summary: unhandled syscall amd64-darwin unix:520 (terminate_with_payload) and unix:521...
Status: RESOLVED DUPLICATE of bug 379893
Alias: None
Product: valgrind
Classification: Developer tools
Component: memcheck (show other bugs)
Version: 3.14 SVN
Platform: Other macOS
: NOR crash
Target Milestone: ---
Assignee: Rhys Kidd
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-10 14:02 UTC by Gonzalo BG
Modified: 2018-08-20 14:26 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gonzalo BG 2018-07-10 14:02:01 UTC
The jemalloc memory allocator uses the syscalls unix:520 and unix:521 on macosx, but these are not handled by valgrind. This leads to a lot of warnings while running the tests under valgrind. This problem is reported in jemalloc upstream: https://github.com/jemalloc/jemalloc/issues/1274

Also, running jemalloc under valgrind works fine on Linux, but some of the test crash on MacOSX with a SIGILL. The instruction to reproduce both the warnings and the crash are in the github issue linked above.
Comment 1 Gonzalo BG 2018-07-10 14:04:31 UTC
The syscalls 520 and 521 might be these ones (https://github.com/apple/darwin-xnu/blob/master/bsd/kern/syscalls.master#L824): AUE_KILL and AUE_EXIT .
Comment 2 Rhys Kidd 2018-08-19 20:35:43 UTC
In the CI log you provided, I only see mention of the following missing syscall:

* unhandled amd64-darwin syscall: unix:515 (ulock_wait)

the previously missing ulock_wait() syscall was just added to Valgrind git master today, so can you please retry with a git version?

Where did you see unix:520 and unix:521 missing on macOS with jemalloc?
Comment 3 Rhys Kidd 2018-08-20 00:35:08 UTC
(In reply to Gonzalo BG from comment #1)
> The syscalls 520 and 521 might be these ones
> (https://github.com/apple/darwin-xnu/blob/master/bsd/kern/syscalls.
> master#L824): AUE_KILL and AUE_EXIT .

The unix syscalls are 520 (terminate_with_payload) and 521 (abort_with_payload)
Comment 4 Gonzalo BG 2018-08-20 14:05:51 UTC
> Where did you see unix:520 and unix:521 missing on macOS with jemalloc?

Going through the logs and travis-CI runs I can't find them anywhere. Maybe I saw this locally, no idea.

I just re-started CI with the master branch and it seems that the unhandled syscall messages have disappeared: https://travis-ci.org/jemalloc/jemalloc/jobs/418209262
Comment 5 Rhys Kidd 2018-08-20 14:25:29 UTC
Looking at that CI log it's now much cleaner. The major issue is the _pthread_body crashes, which are known and being tracked in bz#379893.

I'll merge this bug report into bz#379893, as you can continue to follow progress there.

If you do see new, different Valgrind error reports - please open a new bug report.

--
Thanks by the way for running Valgrind-enabled macOS CI versions of jemalloc. These low-level memory test suites are good for flushing out interesting corner cases in Valgrind's macOS support!

*** This bug has been marked as a duplicate of bug 379893 ***
Comment 6 Gonzalo BG 2018-08-20 14:26:52 UTC
Thank you for looking into it! I'll follow the other bug.