[Bug 1042388] Re: qemu: Unsupported syscall: 257 (timer_create)
@erikd, can you check whether this has been fixed in wily? ** Changed in: qemu (Ubuntu) Status: Triaged => Fix Released -- You received this bug notification because you are a member of Ubuntu Server Team, which is subscribed to qemu in Ubuntu. https://bugs.launchpad.net/bugs/1042388 Title: qemu: Unsupported syscall: 257 (timer_create) To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1042388/+subscriptions -- Ubuntu-server-bugs mailing list Ubuntu-server-bugs@lists.ubuntu.com Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs
[Bug 1042388] Re: qemu: Unsupported syscall: 257 (timer_create)
Unfortunately it doesn't work with armhf on amd64 linux-user. Use the test program from comment #27 I get: schroot -c armhf -- ./timer_test_armhf About to call host's timer_create (0, 0x7fff6ee80720, 0x625b1f40) Host's timer_create returns -22 Failed to create timer: Invalid argument qemu: uncaught target signal 6 (Aborted) - core dumped E: Child terminated by signal ‘Aborted’ (Yes I made very certain the schroot was using my freshly compiled version of qemu-arm-static). -- You received this bug notification because you are a member of Ubuntu Server Team, which is subscribed to qemu in Ubuntu. https://bugs.launchpad.net/bugs/1042388 Title: qemu: Unsupported syscall: 257 (timer_create) To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1042388/+subscriptions -- Ubuntu-server-bugs mailing list Ubuntu-server-bugs@lists.ubuntu.com Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs
[Bug 1042388] Re: qemu: Unsupported syscall: 257 (timer_create)
I've been looking at it over the last week or so and I have submitted a patch toe the qemu-devel mailing list to fix another timer_create() problem sometime in the last week. Unfortunately the test case @pittit submitted is far harder to support than the original test case. In this case the timer_create() syscall gets passed pointers to functions and data in the target's address space and I have not figured out how to handle that yet. -- You received this bug notification because you are a member of Ubuntu Server Team, which is subscribed to qemu in Ubuntu. https://bugs.launchpad.net/bugs/1042388 Title: qemu: Unsupported syscall: 257 (timer_create) To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1042388/+subscriptions -- Ubuntu-server-bugs mailing list Ubuntu-server-bugs@lists.ubuntu.com Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs
Re: [Qemu-devel] [Bug 1042388] Re: qemu: Unsupported syscall: 257 (timer_create)
On 9 August 2014 07:15, Erik de Castro Lopo 1042...@bugs.launchpad.net wrote: Unfortunately the test case @pittit submitted is far harder to support than the original test case. In this case the timer_create() syscall gets passed pointers to functions and data in the target's address space and I have not figured out how to handle that yet. Didn't we discuss this on the list a while back? You're confusing the libc API with the kernel syscall API here -- the kernel definitely does not take a pointer to a function to call here. (The timer_create manpage explicitly says that the SIGEV_THREAD functionality is implemented in the C library, not the kernel.) You can see this if you strace it: clone(child_stack=0xb76e5494, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0xb76e5bd8, {entry_number:6, base_addr:0xb76e5b70, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}, child_tidptr=0xb76e5bd8) = 12666 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 futex(0xb76d324c, FUTEX_WAKE_PRIVATE, 2147483647) = 0 timer_create(CLOCK_REALTIME, {0x984b098, 32, SIGEV_THREAD_ID, {12666}}, {0x1}) = 0 timer_settime(0x1, 0, {it_interval={0, 0}, it_value={0, 5000}}, NULL) = 0 Under the hood libc is creating a new thread with clone, and what the timer_create() syscall gets passed is a struct including the thread ID to be sent a signal when the timer expires (here that's 12666). So all you need to do is support SIGEV_THREAD_ID, which I think doesn't require much more than copying across the thread ID struct field. (On the other hand that does mean that all programs which use SIGEV_THREAD are by definition multithreaded, which puts them into this isn't supported territory because of our well known and longstanding threading issues.) -- PMM -- You received this bug notification because you are a member of Ubuntu Server Team, which is subscribed to qemu in Ubuntu. https://bugs.launchpad.net/bugs/1042388 Title: qemu: Unsupported syscall: 257 (timer_create) To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1042388/+subscriptions -- Ubuntu-server-bugs mailing list Ubuntu-server-bugs@lists.ubuntu.com Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs
[Bug 1042388] Re: qemu: Unsupported syscall: 257 (timer_create)
Patch which seems to at least make the test case work (tested with i386-on-i386 linux-user): http://patchwork.ozlabs.org/patch/378769/ -- You received this bug notification because you are a member of Ubuntu Server Team, which is subscribed to qemu in Ubuntu. https://bugs.launchpad.net/bugs/1042388 Title: qemu: Unsupported syscall: 257 (timer_create) To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1042388/+subscriptions -- Ubuntu-server-bugs mailing list Ubuntu-server-bugs@lists.ubuntu.com Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs
[Bug 1042388] Re: qemu: Unsupported syscall: 257 (timer_create)
Have you had any more time to look into this? Should the QEMU (project) task also be re-marked open? ** Changed in: qemu (Ubuntu) Importance: Undecided = Wishlist -- You received this bug notification because you are a member of Ubuntu Server Team, which is subscribed to qemu in Ubuntu. https://bugs.launchpad.net/bugs/1042388 Title: qemu: Unsupported syscall: 257 (timer_create) To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1042388/+subscriptions -- Ubuntu-server-bugs mailing list Ubuntu-server-bugs@lists.ubuntu.com Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs
[Bug 1042388] Re: qemu: Unsupported syscall: 257 (timer_create)
@erikd, this is marked Fix Released in QEMU project, but comment #28 suggests that commit f4f1e10a58cb5ec7806d47d20671e668a52c3e70 does not in fact solve this bug. If there is a set of patches upstream that does fix the bug, please let me know and I'll pull them into trusty. Thanks much! -- You received this bug notification because you are a member of Ubuntu Server Team, which is subscribed to qemu in Ubuntu. https://bugs.launchpad.net/bugs/1042388 Title: qemu: Unsupported syscall: 257 (timer_create) To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1042388/+subscriptions -- Ubuntu-server-bugs mailing list Ubuntu-server-bugs@lists.ubuntu.com Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs
[Bug 1042388] Re: qemu: Unsupported syscall: 257 (timer_create)
The fix that was commited to the Qemu git tree fixed the original test case I had. @pittit then found another test case that fails and I intend to fix that when I find a good chunk of free time. Problem is I only work on Wemu sporadically and it takes me quite a bit of time to get up to speed when I return to work on it. -- You received this bug notification because you are a member of Ubuntu Server Team, which is subscribed to qemu in Ubuntu. https://bugs.launchpad.net/bugs/1042388 Title: qemu: Unsupported syscall: 257 (timer_create) To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1042388/+subscriptions -- Ubuntu-server-bugs mailing list Ubuntu-server-bugs@lists.ubuntu.com Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs
[Bug 1042388] Re: qemu: Unsupported syscall: 257 (timer_create)
Fixed upstream, thanks Eric! Marking as affecting Ubuntu, as even trusty's qemu does not have that fix yet. For the record, lp:platform- api uses posix timers for the sensor emulation, so running its tests will reproduce this qemu problem (and verify its fix). ** Also affects: qemu (Ubuntu) Importance: Undecided Status: New ** Changed in: qemu Status: Confirmed = Fix Released ** Changed in: qemu (Ubuntu) Status: New = Triaged -- You received this bug notification because you are a member of Ubuntu Server Team, which is subscribed to qemu in Ubuntu. https://bugs.launchpad.net/bugs/1042388 Title: qemu: Unsupported syscall: 257 (timer_create) To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1042388/+subscriptions -- Ubuntu-server-bugs mailing list Ubuntu-server-bugs@lists.ubuntu.com Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs
[Bug 1042388] Re: qemu: Unsupported syscall: 257 (timer_create)
The attachment temp workaround to enable compilation and execution of GHC and produced executables in foreign arch chroot seems to be a patch. If it isn't, please remove the patch flag from the attachment, remove the patch tag, and if you are a member of the ~ubuntu- reviewers, unsubscribe the team. [This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.] ** Tags added: patch -- You received this bug notification because you are a member of Ubuntu Server Team, which is subscribed to qemu in Ubuntu. https://bugs.launchpad.net/bugs/1042388 Title: qemu: Unsupported syscall: 257 (timer_create) To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1042388/+subscriptions -- Ubuntu-server-bugs mailing list Ubuntu-server-bugs@lists.ubuntu.com Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs
[Bug 1042388] Re: qemu: Unsupported syscall: 257 (timer_create)
Unfortunately it is still not working with these two patches. The Unsupported syscall: 257 is gone, but now it fails on EINVAL. I attach a little test C file which uses a timer. It works fine on x86 and a real arm machine, but under QEMU I get: $ gcc -o timer_test -Wall timer_test.c -lrt $ ./timer_test Failed to create timer: Invalid argument qemu: uncaught target signal 6 (Aborted) - core dumped Aborted (core dumped) So timer_create() does not actually seem to work? I tried some variations like 50 ms, or using CLOCK_REALTIME instead of CLOCK_MONOTONIC, all with the same result. ** Attachment added: timer test script to test https://bugs.launchpad.net/qemu/+bug/1042388/+attachment/3948443/+files/timer_test.c -- You received this bug notification because you are a member of Ubuntu Server Team, which is subscribed to qemu in Ubuntu. https://bugs.launchpad.net/bugs/1042388 Title: qemu: Unsupported syscall: 257 (timer_create) To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1042388/+subscriptions -- Ubuntu-server-bugs mailing list Ubuntu-server-bugs@lists.ubuntu.com Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs
[Bug 1042388] Re: qemu: Unsupported syscall: 257 (timer_create)
Thanks for the test case Martin. Problem confirmed. The issue is that timer_create allows a number of different callback mechanisms and I had only implemented the one I need. Working on it now. -- You received this bug notification because you are a member of Ubuntu Server Team, which is subscribed to qemu in Ubuntu. https://bugs.launchpad.net/bugs/1042388 Title: qemu: Unsupported syscall: 257 (timer_create) To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1042388/+subscriptions -- Ubuntu-server-bugs mailing list Ubuntu-server-bugs@lists.ubuntu.com Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs