[valgrind] [Bug 383723] SIGILL failure with ud2 opcode _dispatch_kq_init (in /usr/lib/system/libdispatch.dylib) (macOS)

2017-11-27 Thread Alexandru Croitor
https://bugs.kde.org/show_bug.cgi?id=383723

--- Comment #23 from Alexandru Croitor  ---
Created attachment 109081
  --> https://bugs.kde.org/attachment.cgi?id=109081=edit
Patch implementing kevent_qos

Attaching patch that implements the kevent_qos syscall.

I'm not certain that everything is correct (never worked on valgrind), but
using existing syscalls as a guidance, the README, and checking the xnu source
code, this is what I came up with.

Using the minimal test case I attached, this gets past the ud2 crash, and gives
another crash which I think is the same as
https://bugs.kde.org/show_bug.cgi?id=380269

==75877== Thread 2:
==75877== Invalid read of size 4
==75877==at 0x1014B62B1: _pthread_wqthread (in
/usr/lib/system/libsystem_pthread.dylib)
==75877==by 0x1014B607C: start_wqthread (in
/usr/lib/system/libsystem_pthread.dylib)
==75877==  Address 0x18 is not stack'd, malloc'd or (recently) free'd
==75877==
==75877==
==75877== Process terminating with default action of signal 11 (SIGSEGV)
==75877==  Access not within mapped region at address 0x18
==75877==at 0x1014B62B1: _pthread_wqthread (in
/usr/lib/system/libsystem_pthread.dylib)
==75877==by 0x1014B607C: start_wqthread (in
/usr/lib/system/libsystem_pthread.dylib)

On an unrelated note, I think that the code for kevent64 is incorrect, due to
it having 7 arguments as per
https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man2/kevent.2.html
whereas the valgrind code only reads / processes 6 arguments (PRE_REG_READ6).

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 383723] SIGILL failure with ud2 opcode _dispatch_kq_init (in /usr/lib/system/libdispatch.dylib) (macOS)

2017-11-27 Thread Alexandru Croitor
https://bugs.kde.org/show_bug.cgi?id=383723

--- Comment #22 from Alexandru Croitor  ---
Ok, so the issue seems to be that the kevent_qos syscall is not implemented in
syswrap-darwin.c.

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 383723] SIGILL failure with ud2 opcode _dispatch_kq_init (in /usr/lib/system/libdispatch.dylib) (macOS)

2017-11-27 Thread Alexandru Croitor
https://bugs.kde.org/show_bug.cgi?id=383723

--- Comment #21 from Alexandru Croitor  ---
The source code for the top-most symbol _dispatch_kq_init present in the
backtrace of the crash can be found at
https://opensource.apple.com/source/libdispatch/libdispatch-703.50.37/src/source.c.auto.html
. 

By correlating the disassembly at
https://gist.github.com/Placinta/208f706f6bdefb0e6706a741ceedc271 and the
linked source code, the execution of the ud2 instruction is the result of
calling DISPATCH_CLIENT_CRASH due to a failed kevent_qos call. 

The ud2 instruction would cause the macOS crash reporter to launch under normal
execution (no valgrind or lldb), and print out the ""Failed to initalize
workqueue kevent" message.

Thus the u2 instruction is a red herring, and someone needs to figure out why
does the kevent_qos call fail.

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 383723] SIGILL failure with ud2 opcode _dispatch_kq_init (in /usr/lib/system/libdispatch.dylib) (macOS)

2017-11-27 Thread Alexandru Croitor
https://bugs.kde.org/show_bug.cgi?id=383723

Alexandru Croitor  changed:

   What|Removed |Added

 CC||alexandru.croi...@qt.io

--- Comment #20 from Alexandru Croitor  ---
Created attachment 109078
  --> https://bugs.kde.org/attachment.cgi?id=109078=edit
Minimal example to reproduce issue

Attaching a minimal example to reproduce the crash (2 lines of code really).

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 383723] SIGILL failure with ud2 opcode _dispatch_kq_init (in /usr/lib/system/libdispatch.dylib) (macOS)

2017-10-29 Thread Philippe Waroquiers
https://bugs.kde.org/show_bug.cgi?id=383723

--- Comment #19 from Philippe Waroquiers  ---
(In reply to Rhys Kidd from comment #18)
> Phillipe, it is fine to reference this bug in NEWS as being related, but
> please don't close this bug. The current underlying issue remains unresolved.
Ok. Then I think it is better to keep NEWS as is (i.e. not listing this bug
as fixed).

Thanks

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 383723] SIGILL failure with ud2 opcode _dispatch_kq_init (in /usr/lib/system/libdispatch.dylib) (macOS)

2017-10-28 Thread Rhys Kidd
https://bugs.kde.org/show_bug.cgi?id=383723

--- Comment #18 from Rhys Kidd  ---
Phillipe, it is fine to reference this bug in NEWS as being related, but please
don't close this bug. The current underlying issue remains unresolved.

Per my commit message at the time:

> commit ed6ad13bc8f2b33c493a72db9915f3681002e8d0
> Author: Rhys Kidd 
> Date:   Sun Oct 1 18:56:05 2017 -0400
> 
>Fix missing workq_ops operations (macOS)
> 
>Related to discussion in bz#383723. Patch based upon one provided by
>Andy Maloney.

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 383723] SIGILL failure with ud2 opcode _dispatch_kq_init (in /usr/lib/system/libdispatch.dylib) (macOS)

2017-10-26 Thread Philippe Waroquiers
https://bugs.kde.org/show_bug.cgi?id=383723

Philippe Waroquiers  changed:

   What|Removed |Added

 CC||philippe.waroquiers@skynet.
   ||be

--- Comment #17 from Philippe Waroquiers  ---
John Reiser suggested to use this bug as a reference in NEWS for
  n-i-bz "Fix missing workq_ops operations (macOS)"

Rhys, can you tell if it is appropriate to reference this bug
and close the bug ?

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 383723] SIGILL failure with ud2 opcode _dispatch_kq_init (in /usr/lib/system/libdispatch.dylib) (macOS)

2017-10-25 Thread René Hansen
https://bugs.kde.org/show_bug.cgi?id=383723

René Hansen  changed:

   What|Removed |Added

 CC||ren...@gmail.com

--- Comment #16 from René Hansen  ---
I ran into this bug today and have a small non-qt program that reproduces the
same error as well.

It's a simple cli tool that prints out some OpenCL information; basically just
wrapping stock OpenCL functions.

Tool:

https://github.com/rhardih/opencl_util/blob/master/src/oclinf.c

Source of interest:

https://github.com/rhardih/opencl_util/blob/master/src/opencl_util.c#L554

Output with error:

https://gist.github.com/rhardih/939ebfdc6b10acf732b62a805bd7ea93

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 383723] SIGILL failure with ud2 opcode _dispatch_kq_init (in /usr/lib/system/libdispatch.dylib) (macOS)

2017-10-23 Thread akb825
https://bugs.kde.org/show_bug.cgi?id=383723

akb825  changed:

   What|Removed |Added

 CC||akb...@gmail.com

-- 
You are receiving this mail because:
You are watching all bug changes.

[valgrind] [Bug 383723] SIGILL failure with ud2 opcode _dispatch_kq_init (in /usr/lib/system/libdispatch.dylib) (macOS)

2017-10-15 Thread Rhys Kidd
https://bugs.kde.org/show_bug.cgi?id=383723

Rhys Kidd  changed:

   What|Removed |Added

Summary|SIGILL failure with ud2 |SIGILL failure with ud2
   |opcode (macOS)  |opcode _dispatch_kq_init
   ||(in
   ||/usr/lib/system/libdispatch
   ||.dylib) (macOS)

-- 
You are receiving this mail because:
You are watching all bug changes.