- Queries
- All Stories
- Search
- Advanced Search
- Transactions
- Transaction Logs
Advanced Search
Oct 17 2021
In D32355#734010, @kib wrote:In D32355#733970, @trasz wrote:In D32355#733679, @kib wrote:So after the second thought, would something like if (sr.sr_error == EJUSTRETURN) { is_error = IS_ERR_VALUE((sr.sr_retval[0]); ...} more appropriate? IS_ERR_VALUE() is the linux thing which is roughly ((x) >= (uintptr_t)-MAX_ERRNO), not sure how it is spelled in Linuxolator.
Not sure if I follow. The return value there is BSD errno, not Linux errno; also, this doesn't seem to be more readable than the current version.
For EJUSTRETURN, you need to determine (from the FreeBSD return frame, according to your statement) if it is error or success return, and then encode the si.exit values. In particular, rval would be either sr_retval[0] if there is no error, or bsd_to_linux_errno() if there is.
In D32367#732149, @jhb wrote:Can you describe what the two stops are? Is it one stop for syscall exit and a second for exec? If so, I think this isn't quite doing what you want. I think the first stop will report (LINUX_SIGTRAP | (0x80 | LINUX_PTRACE_EXEC_EVENT) << 8) << 8 and the second stop will report (LINUX_SIGTRAP | 0x80 << 8) << 8. I think you'd want to change the linux_ptrace bits to ignore SCX if EXEC is set?
In D32367#732149, @jhb wrote:Can you describe what the two stops are? Is it one stop for syscall exit and a second for exec? If so, I think this isn't quite doing what you want. I think the first stop will report (LINUX_SIGTRAP | (0x80 | LINUX_PTRACE_EXEC_EVENT) << 8) << 8 and the second stop will report (LINUX_SIGTRAP | 0x80 << 8) << 8. I think you'd want to change the linux_ptrace bits to ignore SCX if EXEC is set?
Emit those in the right order.
In D32355#733679, @kib wrote:So after the second thought, would something like if (sr.sr_error == EJUSTRETURN) { is_error = IS_ERR_VALUE((sr.sr_retval[0]); ...} more appropriate? IS_ERR_VALUE() is the linux thing which is roughly ((x) >= (uintptr_t)-MAX_ERRNO), not sure how it is spelled in Linuxolator.
Remove useless line wrapping.
Oct 14 2021
Join the two conditionals.
Oct 13 2021
Oct 12 2021
Only expect EJUSTRETURN; don't claim it's an error. This one makes strace happy.
Oct 11 2021
Oct 10 2021
The reason why I don't want this flag set during the second ptracestop() is that I don't want to return LINUX_PTRACE_EVENT_EXEC on the second stop.
Oct 8 2021
No, bsd_to_linux_errno() assumes it's always called with correct value, and AFAIK other callers keep to it.
There's no error there.
Fix warning.
See also https://reviews.freebsd.org/D32367, which takes a slightly different route.
In D32355#730131, @emaste wrote:I think this is reasonable but am curious why we get +ve and -ve values, do you know where they originate?
Oct 7 2021
Oct 6 2021
Appears to work fine, thanks :-)
Ah, one more thing: we can't really have a (modern) strace(1) port for both native and Linux binaries; strace has removed support for everything not Linux several years ago.
I'm afraid it panics for me: panic: mtx_lock_spin: recursed on non-recursive mutex sleepq chain @ /usr/home/trasz/git/freebsd/sys/kern/subr_sleepqueue.c:267. Traceback looks like this:
panic() at panic+0x44 __mtx_lock_spin_flags() at __mtx_lock_spin_flags+0x190 wakeup() at wakeup+0x10 exit1() at exit1+0xb8c linux_exit_group() at linux_exit_group+0x10 do_el0_sync() at do_el0_sync+0x4a8 handle_el0_sync() at handle_el0_sync+0x90
Can you say some more about what's missing for non-stop debugging?
Oct 5 2021
Oct 4 2021
Oct 2 2021
John, Konstantin, this extends our native ptrace(2), so I'd like to know what do you think. There should be documentation, but for now the new requests are described in https://man7.org/linux/man-pages/man2/ptrace.2.html.
Oct 1 2021
This fixes my testcase with strace(1), and also seems to fix problems with man(1) and ninja(8) on Bionic. Thank you :-)
Sep 29 2021
This appears to fix kern/258534 for me, thanks :)
Sep 16 2021
Followup PR can be found at https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=258534.
Sep 14 2021
Sep 13 2021
I've asked for review on tz@, and here's what follows (see https://mm.icann.org/pipermail/tz/2021-September/030335.html and followups): this has a potential of breaking apps that depend on zone information to not change behind their back, but there's a precedent with Apple doing something similar (although not identical). One proposed solution that I particularly like is for tzcode to provide a function which returns the path to the zone file; this way the app could use whatever notification mechanism it likes, and it would also make it possible to implement a LD_PRELOADed wrapper to implement transparent change detection like this change does.
Fix buildworld.
Sep 12 2021
There's still one problem: the #ifdef _KERNEL breaks world build (lib/libsysdecode/tables.h:406:13: error: use of undeclared identifier 'PT_GET_SC_ARGS_ALL'). Is there already some #define to allow libsysdecode to use kernel includes, or is there a different way?
Sep 7 2021
Handle freebsd32.
More fixes.
Sep 6 2021
Use the right diff.
Sep 3 2021
Sep 2 2021
Hm, interesting. With "<NetworkBusType>0</NetworkBusType>" and the VM type set to "Windows 11", it panics (with the patch above) after successfully probing vtnet0 on virtio_pci0:
Sep 1 2021
Now, regarding "vm.efi.dtb=0": with "Other", things change like this (I've omitted changes to USB enumeration order, I guess that's random):
I've tested this (applied on top of https://reviews.freebsd.org/D31767) and it fixes the problem, thank you :-)
Obsoleted by https://reviews.freebsd.org/D31464.
Aug 17 2021
Aug 12 2021
Aug 8 2021
Aug 2 2021
In D31366#706899, @imp wrote:What cases is it supposed to prevent?