profile
viewpoint

gimli-rs/cpp_demangle 208

A crate for demangling C++ symbols

khuey/bb8 156

r2d2 but async

khuey/gdb-agent 3

A rust crate for handling gdb agent bytecode expressions

asutherland/pernosco-bridge 0

Experimental mechanism to provide an API to the pernosco debugger via postMessage bridge. Also, simple examples!

khuey/aws-autoscaling-gitlab-runner 0

CloudFormation template to deploy a GitLab Runner with auto-scaling on AWS.

khuey/bincode 0

A binary encoder / decoder implementation in Rust.

khuey/boondock 0

Docker daemon API in Rust

khuey/cage 0

Develop and deploy complex Docker applications

khuey/compose_yml 0

WIP: Read and write docker-compose.yml files using Rust

push eventkhuey/x11rb

mergify[bot]

commit sha 0dff510ab02e87a532c0aba089cc6bd7c1dfc193

Merge pull request #448 from khuey/cow_members Use Cows for (most) members with lifetimes.

view details

push time in 4 hours

push eventmozilla/rr

Keno Fischer

commit sha c2b19bf8cc1197d3f9c8849a0c700c057275d00b

Add aarch64-specific definition for seccomp support

view details

Keno Fischer

commit sha c9781b56128f68adfb276f1e00d851ffbfdbc3b8

Add missed generic syscallno for lseek

view details

Keno Fischer

commit sha f8a8c46aff27e105fb00770e4cb38766cb083e30

On aarch64 pass through PR_SET_SPECULATION_CTRL It affects the pstate register, so we either need to pass it through or emulate it. Passing it through seems simpler, so do that.

view details

Keno Fischer

commit sha e87c421e787843f2270755c2fc3c0e5488f3c2d0

Clear a pending group stop upon receiving SIGCONT We may not have applied the group stop yet, but we definitely need to clear it the task sending it to us doesn't know we delayed it. This happens consistently during the exec_stopsig test on aarch64, but I suspect it could easily happen elsewhere and just happened to manifest here.

view details

Keno Fischer

commit sha 2cb0290783a66ad99e7ee117eff5760ffe8972cd

Factor out trapping instructions To make the tests architecture agnostic (assuming of course an appropriate instruction was defined in the header).

view details

push time in 5 hours

PR merged mozilla/rr

Misc aarch64 changes (part 4)

As before, these are the collection of misc standalone changes that I'm cherry-picking from my WIP branch. Generally they each correspond to one test. I have a couple bigger changes in the oven, but they're still cooking, since I'm still finding ways in which they're not quite right. These changes on the other hand are hopefully small/simple enough that I won't find any surprises here later.

+56 -16

0 comment

14 changed files

Keno

pr closed time in 5 hours

Pull request review commentmozilla/rr

Misc aarch64 changes (part 4)

 void RecordTask::emulate_SIGCONT() {   for (Task* t : thread_group()->task_set()) {     auto rt = static_cast<RecordTask*>(t);     LOG(debug) << "setting " << tid << " to NOT_STOPPED due to SIGCONT";+    rt->clear_stashed_group_stop();

Would be nice if this had a test.

Keno

comment created time in 5 hours

push eventkhuey/x11rb

Eduardo Sánchez Muñoz

commit sha ae756d3878babae457eab091a2ef5424096eb764

Fix unused parameter warning in xclock_utc

view details

Eduardo Sánchez Muñoz

commit sha ee836b334796f67e941a2412e65010eab5e07759

Fix `clippy::match_single_binding` warnings, which only appear when no extension is enabled.

view details

Kyle Huey

commit sha f9aed36ee82a03de90bc638acd98661878b968a4

Fix indentation.

view details

mergify[bot]

commit sha 34ecf6b938a16c9d21b596d0fa317eafd89635fb

Merge pull request #443 from psychon/clippy-switch Fix `clippy::match_single_binding` warnings, which only appear when no extension is enabled

view details

mergify[bot]

commit sha 24e788723f0d553698767cdb55d33135fbe2b68e

Merge pull request #444 from psychon/fix-warning-xclock Fix unused parameter warning in xclock_utc

view details

mergify[bot]

commit sha 946119381caa84afde500847860829913100cacc

Merge pull request #445 from khuey/fix-indent Fix indentation.

view details

Eduardo Sánchez Muñoz

commit sha f348087b8349ac375693a11d2d5ebf93a7cb06b8

Format strings Otherwise, when there were long strings, rustfmt was skipping the whole block. Used: ``` cargo fmt -- --config format_strings=true ```

view details

Eduardo Sánchez Muñoz

commit sha fcb1e02615e77df4166a92840e90a1b1eeb8a78c

Rework polling in xclock_utc * The function now takes a `timeout` parameter (although it is always 1000 ms). * Works on Windows using winapi_wsapoll.* Checks for EINTR on Unix. * Makes sure that there is a timeout or POLLIN is set.

view details

mergify[bot]

commit sha aaa06aab0c92f466d6214e0d9a7f7f74fead39ba

Merge pull request #446 from psychon/long-strings Format strings

view details

Eduardo Sánchez Muñoz

commit sha 126b034e39452dde30d915ebd8e76ffb7a5c733b

Run xclock_utc in AppVeyor

view details

mergify[bot]

commit sha 14089bb9c441db8781377ea4620c573001b077e9

Merge pull request #447 from psychon/xclock-poll Rework polling in xclock_utc

view details

Kyle Huey

commit sha a6badee03859df9ac5af5a003c75bb3331cbc4df

Use Cows for (most) members with lifetimes. When serializing requests, whether or not our data has a lifetime is not that important, because we can just return a Cow from the struct's serialize function. This is the corresponding change for parsing requests. When parsing, values that are generated during parsing must be owned and not borrowed. The only exception to this is raw byte buffers which can remain untouched. While we're here, remove unnecessary length erasures (i.e. &foo[..]) on &'input [T]s. This is only needed for fixed-length arrays.

view details

push time in 5 hours

PR opened psychon/x11rb

Use Cows for (most) members with lifetimes.

When serializing requests, whether or not our data has a lifetime is not that important, because we can just return a Cow from the struct's serialize function. This is the corresponding change for parsing requests. When parsing, values that are generated during parsing must be owned and not borrowed. The only exception to this is raw byte buffers which can remain untouched.

While we're here, remove unnecessary length erasures (i.e. &foo[..]) on &'input [T]s. This is only needed for fixed-length arrays.

+543 -413

0 comment

32 changed files

pr created time in 5 hours

create barnchkhuey/x11rb

branch : cow_members

created branch time in 5 hours

delete branch khuey/x11rb

delete branch : fix-indent

delete time in 13 hours

PR opened psychon/x11rb

Fix indentation.

For whatever reason rustfmt didn't fix this on its own.

+225 -225

0 comment

1 changed file

pr created time in 15 hours

create barnchkhuey/x11rb

branch : fix-indent

created branch time in 15 hours

issue openedpsychon/x11rb

Consider using serialize_into in request struct serializations

Now that the fixed length request is build out of a Vec serialize_into could be used to fill it out. For efficiency you'd ideally preallocate the Vec's buffer with a Vec::with_capacity call up front, which would require calculating the total size of the buffer. Currently rustc does that for us. The additional complexity in the generator may not be worth it.

created time in a day

push eventkhuey/x11rb

Eduardo Sánchez Muñoz

commit sha 52194cba4a94c59c593b6d6d22ab66cb4fcc3ac4

Use `VecDeque` instead of `Vec` in `BufWriteFD`

view details

mergify[bot]

commit sha e3d7ab5d54698fe5115812788c52eaea8f0a2ae0

Merge pull request #438 from psychon/write-buf-vec-deque Use `VecDeque` instead of `Vec` in `BufWriteFD`

view details

Kyle Huey

commit sha 0e5f89f6fddda0020fc41b63a49d24e19f1bbe48

Give explicit lifetimes to non-Connection object request parameters. This will make things easier once we create request structs, which cannot have unnamed lifetimes.

view details

Kyle Huey

commit sha af24c57b11daa0fe5204a42dbf6fa300fefdb340

Generate and use Request structs to do serialization of X requests.

view details

Kyle Huey

commit sha b0f9467b161ed9f519715d53f2fc4e0690bf76b0

Use Self::opcode().

view details

Kyle Huey

commit sha 07be12628d20e900953f135a9052918df46dc892

Please clippy.

view details

Kyle Huey

commit sha 86af536bb1c2331fb4c9967d2d8752c62cd8f25c

Fix more clippy warnings.

view details

Eduardo Sánchez Muñoz

commit sha 46d870326bae1765232ec49cd55edfb63a67f0a4

Move read buffering into `PacketReader`

view details

mergify[bot]

commit sha b43fda0e3d4d6b1cd5de6bb493ce1429ab5b2bbd

Merge pull request #440 from psychon/move-read-buffer Move read buffering into `PacketReader`

view details

Kyle Huey

commit sha fd094b9390039420252224dc63a46f658657085f

Consume `conn` in xproto serialize methods and remove allow-unused annotation.

view details

Kyle Huey

commit sha 37385b937a54b7fa29f493fd63a0a8a249ec5341

Introduce some type aliases to please clippy.

view details

Kyle Huey

commit sha 5272f24796d7ad22b218e54a3d0ce9acae408db0

Revert to the previous behavior for opcode constants.

view details

Kyle Huey

commit sha 8e158fa6b3104496ed7f19fb52297adc09daad9c

Fix clippy's complaints about lifetimes in send_event.

view details

Kyle Huey

commit sha d863fb6398ac1ffa8d0171d1aef58b9a197fc969

Fix spelling.

view details

Kyle Huey

commit sha 68850367135be5accbf4ee5edd7d68253c0dd6f6

Fix clippy warning on extension trait method.

view details

mergify[bot]

commit sha b371d89967c92ead5e8131ad512a6632d95d2e1d

Merge pull request #439 from khuey/request_structs Generate and use structs to serialize requests.

view details

push time in a day

pull request commentpsychon/x11rb

Generate and use structs to serialize requests.

@khuey Thanks for this PR!

Also thanks from me. I am looking forward to your next one. :-) Feel free to ask me to look at how to fix those clippy complaints. Even though I wrote that I do not want to. I wouldn't be sad for other suggestions on what I could work on, though... (and I am already wondering whether I should write something like xtrace / xtruss or not...)

If you wanted to write the intercept-and-forward an X socket part of xtrace then once I send you a PR for the request parsing stuff I think you'd have a largely complete xtrace (except for converting requests/replies/etc to terminal output).

khuey

comment created time in a day

pull request commentpsychon/x11rb

Generate and use structs to serialize requests.

@khuey Thanks for this PR!

As you are the first developer besides me and @psychon to modify the code generator, was it easy for you to look into the generator or do you feel that there should be more explanatory comments?

I felt it was fairly straightforward. I did modify the outln! macro at one point to add a comment at the end of every line with the file! and line! macros to see where code was being generated from. After that there were only a few cases where it was difficult to track down where code was coming from (mostly related to things like emit_value_serialize which don't get a line to themselves).

khuey

comment created time in a day

push eventkhuey/x11rb

Kyle Huey

commit sha 68850367135be5accbf4ee5edd7d68253c0dd6f6

Fix clippy warning on extension trait method.

view details

push time in a day

push eventkhuey/x11rb

Kyle Huey

commit sha 8e158fa6b3104496ed7f19fb52297adc09daad9c

Fix clippy's complaints about lifetimes in send_event.

view details

Kyle Huey

commit sha d863fb6398ac1ffa8d0171d1aef58b9a197fc969

Fix spelling.

view details

push time in a day

Pull request review commentpsychon/x11rb

Generate and use structs to serialize requests.

 pub const X11_EXTENSION_NAME: &str = "BIG-REQUESTS"; /// send the maximum version of the extension that you need. pub const X11_XML_VERSION: (u32, u32) = (0, 0); -/// Opcode for the Enable request-pub const ENABLE_REQUEST: u8 = 0;

I've reverted to the previous way of having a global unassociated constant.

If you wanted to do associated constants I think it makes sense to do it for requests, events, and replies all at the same time.

khuey

comment created time in a day

Pull request review commentpsychon/x11rb

Generate and use structs to serialize requests.

 pub const X11_EXTENSION_NAME: &str = "BIG-REQUESTS"; /// send the maximum version of the extension that you need. pub const X11_XML_VERSION: (u32, u32) = (0, 0); -/// Opcode for the Enable request-pub const ENABLE_REQUEST: u8 = 0;+#[derive(Debug, Clone, Copy, PartialEq, Eq)]+pub struct EnableRequest;+impl EnableRequest {+    /// Opcode for the Enable request+    pub const fn opcode() -> u8 { 0 }+    /// Serialize this request into bytes for the provided connection+    #[allow(unused)]

Done.

khuey

comment created time in a day

push eventkhuey/x11rb

Kyle Huey

commit sha fd094b9390039420252224dc63a46f658657085f

Consume `conn` in xproto serialize methods and remove allow-unused annotation.

view details

Kyle Huey

commit sha 37385b937a54b7fa29f493fd63a0a8a249ec5341

Introduce some type aliases to please clippy.

view details

Kyle Huey

commit sha 5272f24796d7ad22b218e54a3d0ce9acae408db0

Revert to the previous behavior for opcode constants.

view details

push time in a day

push eventkhuey/x11rb

Kyle Huey

commit sha 86af536bb1c2331fb4c9967d2d8752c62cd8f25c

Fix more clippy warnings.

view details

push time in 2 days

pull request commentpsychon/x11rb

Generate and use structs to serialize requests.

My motivation for this is that I want to use these structs to parse X11 requests to decode protocol traffic, but the parsing code is not included in this PR.

But you do want to add that in a later PR, right?

Yes.

What are your plans with decoding protocol traffic? Do you want to build something like xtrace?

More or less. I have a recording of all traffic over the X socket and I want to decode it to pick out some things.

Also, since I always wonder about something like this: This PR adds 15k lines of code, making the generated code co over 100k lines (90247 -> 106746 according to wc -l src/protocol/*)

 35 files changed, 36531 insertions(+), 19947 deletions(-)

Yes, I think that's largely that each field and each request now appears on two more lines (once in the struct definition and once in the function where it copies arguments into the struct).

khuey

comment created time in 2 days

Pull request review commentpsychon/x11rb

Generate and use structs to serialize requests.

 pub const X11_EXTENSION_NAME: &str = "BIG-REQUESTS"; /// send the maximum version of the extension that you need. pub const X11_XML_VERSION: (u32, u32) = (0, 0); -/// Opcode for the Enable request-pub const ENABLE_REQUEST: u8 = 0;

Yeah I think it can make sense (see my comment at the top of the thread). Want me to do it?

khuey

comment created time in 2 days

Pull request review commentpsychon/x11rb

Generate and use structs to serialize requests.

 impl<'ns, 'c> NamespaceGenerator<'ns, 'c> {                             "let length_so_far = length_so_far + request{}.len();",                             num_fixed_len_slices,                         );-                        request_slices.push(format!("&request{}", num_fixed_len_slices));+                        request_slices.push(format!("request{}.into()", num_fixed_len_slices));                         fixed_fields_bytes.clear();                         num_fixed_len_slices += 1;                     }                     if let Some(next_slice) = next_slice {-                        let next_slice_for_len = if next_slice.starts_with('&') {-                            &next_slice[1..]-                        } else {-                            next_slice.as_str()-                        };                         outln!(                             tmp_out,                             "let length_so_far = length_so_far + {}.len();",-                            next_slice_for_len,+                            next_slice,                         );-                        request_slices.push(next_slice);+                        request_slices.push(format!("{}.into()", next_slice));                     }                 }                  out!(out, "{}", tmp_out.into_data());-            }--            // The XML does not describe trailing padding in requests. Requests-            // are implicitly padded to a four byte boundary.-            if let Some(request_size) = request_size {-                let req_size_rem = request_size % 4;-                if req_size_rem != 0 {-                    assert_eq!(pad_count, 0);-                    outln!(out, "let padding = [0; {}];", 4 - req_size_rem);-                    outln!(out, "let length_so_far = length_so_far + padding.len();");-                    request_slices.push(String::from("&padding"));                 }-            } else {+                // The XML does not describe trailing padding in requests. Requests+                // are implicitly padded to a four byte boundary.+                if let Some(request_size) = request_size {+                    let req_size_rem = request_size % 4;+                    if req_size_rem != 0 {+                        assert_eq!(pad_count, 0);+                        outln!(out, "let padding = [0; {}];", 4 - req_size_rem);+                        outln!(out, "let length_so_far = length_so_far + padding.len();");+                        request_slices.push("Cow::Borrowed(&padding)".into());+                    }+                } else {+                    outln!(+                        out,+                        "let padding{} = &[0; 3][..(4 - (length_so_far % 4)) % 4];",+                        pad_count,+                    );+                    outln!(+                        out,+                        "let length_so_far = length_so_far + padding{}.len();",+                        pad_count,+                    );+                    request_slices.push(format!("Cow::Borrowed(&padding{})", pad_count));+                }++                outln!(out, "assert_eq!(length_so_far % 4, 0);");+                // Set the length in the request.+                // If it does not fit into u16, compute_length_field will use BigRequests.                 outln!(                     out,-                    "let padding{} = &[0; 3][..(4 - (length_so_far % 4)) % 4];",-                    pad_count,+                    "let length = u16::try_from(length_so_far / 4).unwrap_or(0);",                 );                 outln!(                     out,-                    "let length_so_far = length_so_far + padding{}.len();",-                    pad_count,+                    "request0[2..4].copy_from_slice(&length.to_ne_bytes());",                 );-                request_slices.push(format!("&padding{}", pad_count));-            }--            outln!(out, "assert_eq!(length_so_far % 4, 0);");-            // Set the length in the request.-            // If it does not fit into u16, compute_length_field will use BigRequests.-            outln!(-                out,-                "let length = u16::try_from(length_so_far / 4).unwrap_or(0);",-            );-            outln!(-                out,-                "request0[2..4].copy_from_slice(&length.to_ne_bytes());",-            ); -            let fds_arg = if gathered.fd_lists.is_empty() {-                format!("vec![{}]", gathered.single_fds.join(", "))-            } else if gathered.fd_lists.len() == 1 && gathered.single_fds.is_empty() {-                gathered.fd_lists[0].clone()-            } else {-                outln!(out, "let mut fds = Vec::new();");-                for field in fields.iter() {-                    match field {-                        xcbdefs::FieldDef::Fd(fd_field) => {-                            outln!(out, "fds.push({});", to_rust_variable_name(&fd_field.name));-                        }-                        xcbdefs::FieldDef::FdList(fd_list_field) => {-                            outln!(-                                out,-                                "fds.extend({});",-                                to_rust_variable_name(&fd_list_field.name)-                            );+                let fds_arg = if gathered.fd_lists.is_empty() {+                    format!("vec![{}]", gathered.single_fds.iter().enumerate().map(|(i, single_fd)| {+                        let sep = if i == 0 {+                            ""+                        } else {+                            ", "+                        };+                        format!("{}self.{}", sep, single_fd)+                    }).collect::<String>())+                } else if gathered.fd_lists.len() == 1 && gathered.single_fds.is_empty() {+                    format!("self.{}", gathered.fd_lists[0])+                } else {+                    outln!(out, "let mut fds = Vec::new();");+                    for field in fields.iter() {+                        match field {+                            xcbdefs::FieldDef::Fd(fd_field) => {+                                outln!(out, "fds.push({});", to_rust_variable_name(&fd_field.name));+                            }+                            xcbdefs::FieldDef::FdList(fd_list_field) => {+                                outln!(+                                    out,+                                    "fds.extend({});",+                                    to_rust_variable_name(&fd_list_field.name)+                                );+                            }+                            _ => {}                         }-                        _ => {}                     }+                    String::from("fds")+                };++                let mut slices_arg = String::new();+                for (i, request_slices) in request_slices.iter().enumerate() {+                    if i != 0 {+                        slices_arg.push_str(", ");+                    }+                    slices_arg.push_str(request_slices);                 }-                String::from("fds")-            }; -            let mut slices_arg = String::new();-            for (i, request_slices) in request_slices.iter().enumerate() {-                if i != 0 {-                    slices_arg.push_str(", ");+                outln!(out, "Ok((vec![{slices}], {fds}))", slices=slices_arg, fds=fds_arg);+            });+            outln!(out, "}}");+        });+        outln!(out, "}}",);+    }++    fn emit_request_function(+        &self,+        request_def: &xcbdefs::RequestDef,+        name: &str,+        function_name: &str,+        gathered: &GatheredRequestFields,+        out: &mut Output,+    ) {+        let mut generic_params = String::new();+        if gathered.needs_lifetime {+            generic_params.push_str("'c, 'input, Conn");+        } else {+            generic_params.push_str("Conn");+        }+        for (param_name, _) in gathered.generics.iter() {+            generic_params.push_str(", ");+            generic_params.push_str(param_name);+        }++        let ns = request_def.namespace.upgrade().unwrap();+        let is_list_fonts_with_info =+            request_def.name == "ListFontsWithInfo" && ns.header == "xproto";++        let ret_lifetime = if gathered.needs_lifetime { "'c" } else { "'_" };+        let ret_type = if is_list_fonts_with_info {+            assert!(request_def.reply.is_some());+            assert!(!gathered.reply_has_fds);+            format!("ListFontsWithInfoCookie<{}, Conn>", ret_lifetime)+        } else {+            match (request_def.reply.is_some(), gathered.reply_has_fds) {+                (false, _) => format!("VoidCookie<{}, Conn>", ret_lifetime),+                (true, false) => format!("Cookie<{}, Conn, {}Reply>", ret_lifetime, name),+                (true, true) => format!("CookieWithFds<{}, Conn, {}Reply>", ret_lifetime, name),+            }+        };++        let mut args = String::new();+        if gathered.needs_lifetime {+            args.push_str("conn: &'c Conn");+        } else {+            args.push_str("conn: &Conn");+        }+        for (arg_name, arg_type) in gathered.args.iter() {+            args.push_str(", ");+            args.push_str(arg_name);+            args.push_str(": ");+            args.push_str(arg_type);+        }++        if let Some(ref doc) = request_def.doc {+            self.emit_doc(doc, out);+        }+        outln!(+            out,+            "pub fn {}<{}>({}) -> Result<{}, ConnectionError>",+            function_name,+            generic_params,+            args,+            ret_type,+        );+        outln!(out, "where");+        outln!(out.indent(), "Conn: RequestConnection + ?Sized,");+        for (param_name, where_) in gathered.generics.iter() {+            outln!(out.indent(), "{}: {},", param_name, where_);+        }+        outln!(out, "{{");+        #[allow(clippy::cognitive_complexity)]+        out.indented(|out| {+            for preamble in gathered.preamble.iter() {+                outln!(out, "{}", preamble);+            }++            let has_members = !gathered.request_args.is_empty();+            let members_start = if has_members { " {" } else { ";" };+            outln!(out, "let request0 = {}Request{}", name, members_start);+            out.indented(|out| {+                for (arg_name, _) in gathered.args.iter() {+                    outln!(out, "{}: {},", arg_name, arg_name);

Done.

khuey

comment created time in 2 days

Pull request review commentpsychon/x11rb

Generate and use structs to serialize requests.

 pub const X11_EXTENSION_NAME: &str = "BIG-REQUESTS"; /// send the maximum version of the extension that you need. pub const X11_XML_VERSION: (u32, u32) = (0, 0); -/// Opcode for the Enable request-pub const ENABLE_REQUEST: u8 = 0;+#[derive(Debug, Clone, Copy, PartialEq, Eq)]+pub struct EnableRequest;+impl EnableRequest {+    /// Opcode for the Enable request+    pub const fn opcode() -> u8 { 0 }+    /// Serialize this request into bytes for the provided connection+    #[allow(unused)]+    fn serialize<'input, Conn>(self, conn: &Conn) -> Result<(Vec<Cow<'input, [u8]>>, Vec<RawFdContainer>), ConnectionError>+    where+        Conn: RequestConnection + ?Sized,+    {+        let extension_information = conn.extension_information(X11_EXTENSION_NAME)?+            .ok_or(ConnectionError::UnsupportedExtension)?;+        let length_so_far = 0;+        let mut request0 = vec![+            extension_information.major_opcode,+            EnableRequest::opcode(),

Done

khuey

comment created time in 2 days

Pull request review commentpsychon/x11rb

Generate and use structs to serialize requests.

 pub const X11_EXTENSION_NAME: &str = "BIG-REQUESTS"; /// send the maximum version of the extension that you need. pub const X11_XML_VERSION: (u32, u32) = (0, 0); -/// Opcode for the Enable request-pub const ENABLE_REQUEST: u8 = 0;+#[derive(Debug, Clone, Copy, PartialEq, Eq)]+pub struct EnableRequest;+impl EnableRequest {+    /// Opcode for the Enable request+    pub const fn opcode() -> u8 { 0 }+    /// Serialize this request into bytes for the provided connection+    #[allow(unused)]

The reason I didn't do this in the first place is that having differing signatures for differing messages makes it harder to split this off into another trait to enable something like #212.

khuey

comment created time in 2 days

push eventkhuey/x11rb

Kyle Huey

commit sha b0f9467b161ed9f519715d53f2fc4e0690bf76b0

Use Self::opcode().

view details

Kyle Huey

commit sha 07be12628d20e900953f135a9052918df46dc892

Please clippy.

view details

push time in 2 days

issue openedrust-lang/rust

Add an Into conversion from Cow<[u8]> to IoSlice

This would be a nice convenience when working with IoSlices, because it would allow an easy way to pass around an "owning" version of one. It would have to be tied to the lifetime of the Cow itself rather than the embedded lifetime to handle the ownership case. (i.e. this would be &'a Cow<'_, [u8]> -> IoSlice<'a> rather than Cow<'a, [u8]> -> IoSlice<'a>.

Cc @sfackler

created time in 2 days

PR opened psychon/x11rb

Generate and use structs to serialize requests.

This PR creates a FooRequest struct for every X11 request Foo with the appropriate parameters, and then moves the existing serialization logic out of the generated helper functions and into a method that consumes the request struct. My motivation for this is that I want to use these structs to parse X11 requests to decode protocol traffic, but the parsing code is not included in this PR. It would be straightforward to build on this to complete #212 as well (by breaking the serialize method off into its own trait and adding send_request_struct_... methods on Connection).

This is largely boilerplate. It passes all the automated tests and I've done some visual inspection of bits of the generated code as well, though obviously there's too much to go through everything line by line.

Things that I think are worth paying attention to in a review:

  1. I got rid of the FOO_REQUEST constants and replaced them with a FooRequest::opcode(). I think this is cleaner but it a) does break compatibility to some extent and b) despite being a const fn opcode() cannot be used in a match arm until rust-lang/rust#57240 is fixed, so you may want that added back.
  2. The request byte buffer can no longer live on the stack (since the function that generates it returns before we call into the connection sending machinery). It ends up getting packaged into a Vec (i.e. heap allocated) but I don't think that should be a big concern.
  3. Given the above, I wanted to preserve the existing IoSlice behavior, but IoSlice cannot own buffers, so the serialization method on the struct now returns a Vec<Cow<'input, [u8]>> which are Cow::Owneds for the byte buffers generated in serialization and Cow::Borrowed for external buffers that are embedded in the struct or static data like padding.
  4. SendEventRequest is a bit tricky. I've chosen for now to make its event just be an &'input [u8; 32]. I think a Cow would be better in some ways but fixed length arrays do not implement ToOwned so they don't play well with Cow, and erasing the length didn't feel right.
+36802 -20215

0 comment

35 changed files

pr created time in 2 days

push eventkhuey/x11rb

Eduardo Sánchez Muñoz

commit sha 52194cba4a94c59c593b6d6d22ab66cb4fcc3ac4

Use `VecDeque` instead of `Vec` in `BufWriteFD`

view details

mergify[bot]

commit sha e3d7ab5d54698fe5115812788c52eaea8f0a2ae0

Merge pull request #438 from psychon/write-buf-vec-deque Use `VecDeque` instead of `Vec` in `BufWriteFD`

view details

Kyle Huey

commit sha 0e5f89f6fddda0020fc41b63a49d24e19f1bbe48

Give explicit lifetimes to non-Connection object request parameters. This will make things easier once we create request structs, which cannot have unnamed lifetimes.

view details

Kyle Huey

commit sha af24c57b11daa0fe5204a42dbf6fa300fefdb340

Generate and use Request structs to do serialization of X requests.

view details

push time in 2 days

push eventkhuey/x11rb

Kyle Huey

commit sha c94b7c04c1712be6412f51f70f9dbe2a34cf594e

Generate and use Request structs to do serialization of X requests.

view details

push time in 2 days

create barnchkhuey/x11rb

branch : request_structs

created branch time in 2 days

fork khuey/x11rb

X11 bindings for the rust programming language, similar to xcb being the X11 C bindings

fork in 2 days

push eventmozilla/rr

Kyle Huey

commit sha 8a6ececfe302f91fa72d8ea2490c551101a44b1c

Sprinkle is_x86ish everywhere.

view details

push time in 2 days

push eventkhuey/rr

Keno Fischer

commit sha 6cc898f1c36ce2eccdfac1dbb3e3e9d49b201144

Fix up a few missed issues in ptrace move Just a few things that need to be fixed up when compiling on an actual aarch64 system that I missed in the refactor.

view details

Keno Fischer

commit sha 610884f093d9278483ab476201a34f2c685f71b1

Add PerfCounters support for Aarch64 For the moment only define NeoverseN1, which is what I'm testing on. The scheme probably works on other microachitectures also, as long as they support LSE, but we should test those one by one.

view details

Robert O'Callahan

commit sha 5058617b25f0b0ce1adb559594b2f908be4ba013

Don't attempt to clean up syscallbuf fds during replay that don't exist Resolves #2547

view details

Robert O'Callahan

commit sha 01dd3e73e9542d7ce64475df7020970bc682a500

Tweak comments

view details

Robert O'Callahan

commit sha e62c972664ef61237087c74c1e0666a030d739a4

Disable netlink mmap feature since it creates nondeterminism

view details

Robert O'Callahan

commit sha bbebba2b36146f055d91ba72a6610bc882344543

Block netlink mmap sockets in syscallbuf

view details

Kyle Huey

commit sha d172aaf9c2d0f845a6f33f55925d0aff59e4766f

Catch up on the latest syscall additions.

view details

Keno Fischer

commit sha 3440ae3f2c47fd1d62616d1897ef65a5ed44d786

Bump timeout in thread_open_race I'm seeing this intermittently fail (on x86). Looking at the trace, it made it through 832 iterations in the loop and I see good progress in the log, so I don't think it's stuck, rather I think it might just actually be taking a long time depending on how the scheduling works out and how busy the machine is. Let's see if bumping the timeout helps. Example record.err from a failing test: https://gist.github.com/Keno/b09a63666efffeb82e8aaa01b1abcdcd

view details

Keno Fischer

commit sha a4c78387fed666d3143e908c5848ecb6d6fd198b

Build fixed for undefined syscalls in syscallbuf

view details

Keno Fischer

commit sha 04f22d9b1ec088cce5e59193619364ee59390098

Aarch64 task running and register logic As discussed in #2564, aarch64 register definition is a bit tricky, because the kernel does not give us a way to request orig_x0, so we need to track it ourselves. This means splitting the register format in the trace from just a default Arch::user_regs_struct to include the extra orig_x0. Additionally, we need to make sure to copy x0 to this field on every syscall entry.

view details

Keno Fischer

commit sha cf466f0046778790f6c4d11b5627ba2554b6e79a

Move fxregs to correct test category This test has a .py/.run, but was in the BASIC_TESTS list, so those were ignored.

view details

Keno Fischer

commit sha 94cf24c7105dccce1d0b96c62a21fc14b106f932

Aarch64 build system support Add build flags for aarch64, add the ability to mark tests x86 only by moving them into the x86/ directory, where they will be built on x86, but ignored on aarch64 (or other future architectures).

view details

Keno Fischer

commit sha 5aacf6ef4f6d9851073d5ec3e181605b54067b86

Aarch64 vdso patching support

view details

Keno Fischer

commit sha de2f980b82b501d72227c273a49a78c5f1e1b502

Fix breakpoint reached checks There's legitimate reasons to use the increment_by_bkpt_insn_length function. However, to check whether a breakpoint was reached, we need to use the undo_executed_bkpt function instead, since the behavior is arch specific.

view details

Keno Fischer

commit sha ff4802e26b65e524bdaa1be5e5f310e41cc9e17a

Disable ReturnAddressList on aarch64 Since we are counting all taken branches on aarch64, it should be impossibleop to see the same address twice without an intervening tick. To test that theory, disable the ReturnAddressList for now. If we ever neeed to turn it back on, it's easy to do using: ``` template <> void return_addresses_arch<ARM64Arch>(ReturnAddressList* result, Task* t) { result->addresses[0] = t->regs().lr(); remote_ptr<void> fp = t->regs().fp(); typename ARM64Arch::size_t frame[2]; int next_address = 1; for (int i = next_address; i < ReturnAddressList::COUNT; ++i) { if (!read_bytes_no_breakpoints(t, fp, sizeof(frame), frame)) { break; } result->addresses[i] = frame[1]; fp = frame[0]; } } ```

view details

Keno Fischer

commit sha b460e0f698729a83a3c05118f007915852faa5b2

Properly initialize reasons.watchpoint on aarch64

view details

Keno Fischer

commit sha 0139c1419e3eabd774e6f97ffb40fc03d08a663a

Disable x86-only code path on aarch64

view details

Keno Fischer

commit sha 062b72a3a2d747942184150d480fb0126f99ed5f

Don't clobber return value in clone replay

view details

Keno Fischer

commit sha e0b000f1b72195a8b76b3d2ab45f4665864b935e

Fill in aarch64 sigframe size

view details

Keno Fischer

commit sha c83f9dc1863fedb405c7b9067d1a247b57c869d4

Drop useless assertion On aarch64, the break instruction does not advance the ip, so it is possible for the execution point here to look exactly like the target. That's not a problem and expected. Even on x86, the assertion is of questionable value. We already asserted that we're at the breakpoint, which means we can't possibly be at the target. Just get rid of it.

view details

push time in 2 days

push eventmozilla/rr

Keno Fischer

commit sha 8f0aeacd569da17fba797eaf254e45398083200f

Work around kernel quirk for invalid syscalls On non-x86 systems, it appears the kernel will not set ENOSYS for syscalls that started out negative, if a seccomp trap is incurred. I would argue this is a bug since a passive ptracer will affect program execution, but what can you do.

view details

push time in 2 days

PR merged mozilla/rr

Work around kernel quirk for invalid syscalls

On non-x86 systems, it appears the kernel will not set ENOSYS for syscalls that started out negative, if a seccomp trap is incurred. I would argue this is a bug since a passive ptracer will affect program execution, but what can you do.

I've also emailed LKML about it to ask if this is really what was intended here: https://lkml.org/lkml/2020/5/22/1216.

+10 -0

8 comments

2 changed files

Keno

pr closed time in 2 days

push eventmozilla/rr

Keno Fischer

commit sha 0139c1419e3eabd774e6f97ffb40fc03d08a663a

Disable x86-only code path on aarch64

view details

Keno Fischer

commit sha 062b72a3a2d747942184150d480fb0126f99ed5f

Don't clobber return value in clone replay

view details

Keno Fischer

commit sha e0b000f1b72195a8b76b3d2ab45f4665864b935e

Fill in aarch64 sigframe size

view details

Keno Fischer

commit sha c83f9dc1863fedb405c7b9067d1a247b57c869d4

Drop useless assertion On aarch64, the break instruction does not advance the ip, so it is possible for the execution point here to look exactly like the target. That's not a problem and expected. Even on x86, the assertion is of questionable value. We already asserted that we're at the breakpoint, which means we can't possibly be at the target. Just get rid of it.

view details

Keno Fischer

commit sha 9a7c4f1d0995e8aafdfcc27e9f144394e898f7de

Adjust bad_ip Use 0x44, rather than 0x42, since on Aarch64 instructions need to be aligned. Unaligned jumps generate SIGBUS, rather than SIGSEGV.

view details

push time in 3 days

PR merged mozilla/rr

Aarch64 grabbag

No real unifying theme here other than "I tried things and this is what broke". Should all be relatively straightforward.

+63 -28

1 comment

8 changed files

Keno

pr closed time in 3 days

Pull request review commentmozilla/rr

Aarch64 grabbag

 bool AddressSpace::has_exec_watchpoint_fired(remote_code_ptr addr) { }  bool AddressSpace::allocate_watchpoints() {

I think that would be good.

Keno

comment created time in 3 days

pull request commentmozilla/rr

Work around kernel quirk for invalid syscalls

Lovely.

Since there's nothing else to focus on in this PR, I wonder if we should be more principled about what arch-specific stuff gets a compile time condition check and what gets a run time condition check. I haven't been paying a ton of attention to this during the reviews but there's no reason not to #ifdef this code, right?

Keno

comment created time in 3 days

Pull request review commentmozilla/rr

Aarch64 grabbag

 Completion ReplaySession::emulate_async_signal(          * check again if we're at the          * target. */         LOG(debug) << "    trap was for target $ip";-        /* (The breakpoint would have trapped-         * at the $ip one byte beyond the-         * target.) */-        DEBUG_ASSERT(!at_target);+        if (t->arch() == x86 || t->arch() == x86_64) {+          /* (The breakpoint would have trapped+          * at the $ip one byte beyond the+          * target.) */+          DEBUG_ASSERT(!at_target);+        } else {+          DEBUG_ASSERT(regs.ip() == t->ip());

I'd be fine with removing it entirely.

Keno

comment created time in 3 days

Pull request review commentmozilla/rr

Aarch64 grabbag

 struct ARM64Arch : public GenericArch<SupportedArch::aarch64, WordSize64Defs> {   };   typedef struct user_fpsimd_state user_fpregs_struct; +  struct sigcontext {+    __u64 fault_addr;+    user_pt_regs regs;+    // ISA extension state follows here+  };++  struct ucontext {

Hmm why aren't you RR_VERIFY_TYPE_ARCHing any of these?

Keno

comment created time in 3 days

Pull request review commentmozilla/rr

Aarch64 grabbag

 bool AddressSpace::has_exec_watchpoint_fired(remote_code_ptr addr) { }  bool AddressSpace::allocate_watchpoints() {

Have you given any thought to how this will work on AArch64? I would think you could shoehorn most of the arch specific stuff into Task::set_debug_regs and this code could be largely unchanged.

Keno

comment created time in 3 days

Pull request review commentmozilla/rr

Aarch64 grabbag

 Completion ReplaySession::emulate_async_signal(          * check again if we're at the          * target. */         LOG(debug) << "    trap was for target $ip";-        /* (The breakpoint would have trapped-         * at the $ip one byte beyond the-         * target.) */-        DEBUG_ASSERT(!at_target);+        if (t->arch() == x86 || t->arch() == x86_64) {+          /* (The breakpoint would have trapped+          * at the $ip one byte beyond the+          * target.) */+          DEBUG_ASSERT(!at_target);+        } else {+          DEBUG_ASSERT(regs.ip() == t->ip());

This is just a duplicate of the preceding assertion with undo_executed_bkpt in it.

Keno

comment created time in 3 days

push eventmozilla/rr

Keno Fischer

commit sha de2f980b82b501d72227c273a49a78c5f1e1b502

Fix breakpoint reached checks There's legitimate reasons to use the increment_by_bkpt_insn_length function. However, to check whether a breakpoint was reached, we need to use the undo_executed_bkpt function instead, since the behavior is arch specific.

view details

push time in 3 days

PR merged mozilla/rr

Fix breakpoint reached checks

There's legitimate reasons to use the increment_by_bkpt_insn_length function. However, to check whether a breakpoint was reached, we need to use the undo_executed_bkpt function instead, since the behavior is arch specific.

+5 -8

3 comments

3 changed files

Keno

pr closed time in 3 days

pull request commentmozilla/rr

Fix breakpoint reached checks

yeah ok.

Keno

comment created time in 3 days

pull request commentmozilla/rr

Fix breakpoint reached checks

What about the one in AddressSpace::is_breakpoint_in_private_read_only_memory?

Keno

comment created time in 3 days

push eventmozilla/rr

Keno Fischer

commit sha 5aacf6ef4f6d9851073d5ec3e181605b54067b86

Aarch64 vdso patching support

view details

push time in 3 days

PR merged mozilla/rr

Aarch64 vdso patching support

Mostly straightforward. The only difficulty is that the immediate is not at a byte boundary in the instruction on Aarch64 so our current AssemblyTemplate magic wasn't quite powerful enough to handle it.

+94 -12

0 comment

2 changed files

Keno

pr closed time in 3 days

Pull request review commentmozilla/rr

Aarch64 vdso patching support

 void patch_after_exec_arch<ARM64Arch>(RecordTask* t, Monkeypatcher& patcher) {     return;   } -  FATAL() << "Unimplemented";+  auto vdso_start = t->vm()->vdso().start();++  VdsoReader reader(t);+  auto syms = reader.read_symbols(".dynsym", ".dynstr");++  static const named_syscall syscalls_to_monkeypatch[] = {+#define S(n) { "__kernel_" #n, ARM64Arch::n }+    S(rt_sigreturn), S(gettimeofday), S(clock_gettime), S(clock_getres),+#undef S+  };++  for (auto& syscall : syscalls_to_monkeypatch) {+    for (size_t i = 0; i < syms.size(); ++i) {+      if (syms.is_name(i, syscall.name)) {+        uintptr_t file_offset;+        if (!reader.addr_to_offset(syms.addr(i), file_offset)) {+          LOG(debug) << "Can't convert address " << HEX(syms.addr(i))+                     << " to offset";+          continue;+        }++        uint64_t file_offset_64 = file_offset;+        static const uint64_t vdso_max_size = 0xffffLL;+        uint64_t sym_offset = file_offset_64 & vdso_max_size;+        uintptr_t absolute_address = vdso_start.as_int() + sym_offset;++        uint8_t patch[ARM64VdsoMonkeypatch::size];+        uint32_t syscall_number = syscall.syscall_number;+        ARM64VdsoMonkeypatch::substitute(patch, syscall_number);++        write_and_record_bytes(t, absolute_address, patch);+        // Record the location of the syscall instruction, skipping the+        // "mov $syscall_number,x8".+        patcher.patched_vdso_syscalls.insert(+            remote_code_ptr(absolute_address + 4));+        LOG(debug) << "monkeypatched " << syscall.name << " to syscall "+                    << syscall.syscall_number << " at "+                    << HEX(absolute_address) << " (" << HEX(file_offset)+                    << ")";+      }+    }+  }

Does this not need to obliterate_debug_info?

Keno

comment created time in 3 days

Pull request review commentmozilla/rr

Aarch64 vdso patching support

 void patch_after_exec_arch<ARM64Arch>(RecordTask* t, Monkeypatcher& patcher) {     return;   } -  FATAL() << "Unimplemented";+  auto vdso_start = t->vm()->vdso().start();++  VdsoReader reader(t);+  auto syms = reader.read_symbols(".dynsym", ".dynstr");++  static const named_syscall syscalls_to_monkeypatch[] = {+#define S(n) { "__kernel_" #n, ARM64Arch::n }+    S(rt_sigreturn), S(gettimeofday), S(clock_gettime), S(clock_getres),

I think ideally this would share more code with the x86 implementation but I'm not super concerned about it.

Keno

comment created time in 3 days

push eventkhuey/gecko-dev

Dimi Lee

commit sha 3ad661e06a92f89ced60b9244be981b1b9672ee1

Bug 1624269 - P2. Cache access granted result in the 3rd-party window instead of top-level window in fission mode. r=timhuang,baku Before this patch, in non-fission mode, we cache storage access granted result in the top-level window so we don't have to iterate all the browsing contexts in the same tree while syncing the storage permission granted decision. However, since we plan to rely on the current update mechanism to sync mHasStorageAccess flag for different documents in the same tab (instead of using the syncing mechanism of permission manager), we will eventually need to iterate the browsing context tree to find all the documents to sync. Base on this, we no longer have to maintain different method for fission and non-fission. In this patch, we store the permission granted result in the inner window instead of using permission key and store the key in the top-level window. Differential Revision: https://phabricator.services.mozilla.com/D73710

view details

Dimi Lee

commit sha 3cd41880868b88e28d1b2657170a501e54197120

Bug 1624269 - P3. Inform all the windows whose storage permission is granted. r=timhuang,baku Before this patch, we only call StorageAccessGranted on windows that triggers the storage heuristics. So even if we sync storage permission to the other frames, their data will not be refreshed. For example, if a document has a worker, we don't propagate the permission to the worker. In this patch, we call ::StorageAccessGranted as long as we update the window's storage permission. Differential Revision: https://phabricator.services.mozilla.com/D74321

view details

Dimi Lee

commit sha 267aee84fa3cc33f6b5935ada9e22d42b3e55876

Bug 1624269 - P4. Not using permission manager to sync HasStorageAccess. r=timhuang,baku We already have an architecture to sync the storage access granted result to all 3rd-party frames with the same tracking origin. We use the same way to sync HasStorageAccess flag instead of relying on permission manager update permissions to child processes. Differential Revision: https://phabricator.services.mozilla.com/D73711

view details

Dimi Lee

commit sha 5fb184d08858e25625e497bae03d8e1c797daa8d

Bug 1624269 - P5. Testcase r=timhuang,baku Differential Revision: https://phabricator.services.mozilla.com/D74322

view details

Toshihito Kikuchi

commit sha 0798271b371740a9128db17dcba72944d9f26d66

Bug 1576728 - Block more versions of oly[64].dll and pdzipmenu[32|64].dll. r=gcp Since we learned these modules are a shell exntension, blocking in the browser process should suffice. Differential Revision: https://phabricator.services.mozilla.com/D75606

view details

Andrew McCreight

commit sha 74d479d4b04fb41ade5462bd37215502ce7ccf34

Bug 1638355 - Mark more WPT directories as lsan-disabled. r=jgraham I marked every directory that had both a leak-threshold annotation and an lsan-allowed list with more than a few items as lsan-disabled. That's probably a good heuristic for directories with serious leaks. Differential Revision: https://phabricator.services.mozilla.com/D75651

view details

Sid Stamm

commit sha c531f02db9e718549cfb3ce643dbeac448c90f98

Bug 1002724 - try https if http connections are rejected. r=smaug Differential Revision: https://phabricator.services.mozilla.com/D75083

view details

Sid Stamm

commit sha 507f916a33ff26dd84aafbb727e4d96a91e3a085

Bug 1002724 - add pref for fallback to https. r=smaug Differential Revision: https://phabricator.services.mozilla.com/D75084

view details

Sid Stamm

commit sha 0cc5d3ea23a0d52d5498725222b5e399265f0019

Bug 1002724 - Test that HTTPS is tried if typed host name doesn't respond via HTTP. r=smaug Differential Revision: https://phabricator.services.mozilla.com/D75085

view details

Sid Stamm

commit sha 7697eda5aea04805964e5a37a87e6da364e5020d

Bug 1002724 - use resolvable URL in fxaccounts browser chrome tests. r=rfkelly Differential Revision: https://phabricator.services.mozilla.com/D75086

view details

Sid Stamm

commit sha 8e30e73e8f63ace99e3ae7eddbc30ef6be075ee2

Bug 1002724 - use resolvable URL in browser decoderDoctor test. r=jaws Differential Revision: https://phabricator.services.mozilla.com/D75087

view details

Corentin Arnould

commit sha e7a750541a7468272a1e861b3945b79e84924f83

Bug 1638799 - Added `python-pip` to archlinux's bootstrap. r=froydnj pip3 is an optional dependency of python on archlinux. It needs to be installed explicitly. Differential Revision: https://phabricator.services.mozilla.com/D75785

view details

Sid Stamm

commit sha aa2df3c53f97ab707126fff64e78a07bfa34e1ed

Bug 1002724 - use resolvable URL in extension html_detail_view test. r=mstriemer Differential Revision: https://phabricator.services.mozilla.com/D75088

view details

Csoregi Natalia

commit sha 179b0c82b2ddb76a121c6164c1b0d8f65e5373d9

Backed out 6 changesets (bug 1002724) for bustage on nsDocShell.cpp. CLOSED TREE Backed out changeset 56ba616e2644 (bug 1002724) Backed out changeset d481cf074d3b (bug 1002724) Backed out changeset da26540ecee5 (bug 1002724) Backed out changeset 01cbf611158a (bug 1002724) Backed out changeset b60ba645f1f4 (bug 1002724) Backed out changeset 4ebad0d2ca0a (bug 1002724)

view details

Emilio Cobos Álvarez

commit sha efcf5bdf43aa6581d4cdc934c8b8961eb58c1b75

Bug 1636998 - Mark a known-failing test as random. MANUAL PUSH: Orange on a CLOSED TREE

view details

Emilio Cobos Álvarez

commit sha 2c3b3a616680975abfb9a5ef2efe0f10ca409274

Bug 1638127 - Fix a typo in an ifdef on a CLOSED TREE. MANUAL PUSH: Mac bustage

view details

Mihai Alexandru Michis

commit sha a2026344a10ae9b9a8a73066daf906e954af6d09

Backed out 2 changesets (bug 1613609) for causing bustages. CLOSED TREE Backed out changeset dd6e395dc342 (bug 1613609) Backed out changeset 5bcb7b13a4ad (bug 1613609)

view details

Miko Mynttinen

commit sha 9a35f6a6d685fd41b452ea418057b2b10489d942

Bug 1638020 - Avoid checking display port twice while computing RDL rebuild region r=tnikkel Differential Revision: https://phabricator.services.mozilla.com/D75388

view details

Nicolas Chevobbe

commit sha 3af1e56b63476dbaf5e920bfc048d658f5107a4b

Bug 1421659 - Keep console output pinned to bottom when resizing. r=bomsy. When resizing the output, if the height was modified, the scrollbar position was updated and could lose its pinned-to-bottom state. This patch adds a resizeObserver to the console output node, where we scroll the output to the bottom if it's needed. In order to be able to do that, some changes were done in how we were detecting that the output was pinned to the bottom. We now have an intersection observer on the last message element, which flips a flag when the element isn't intersecting the viewport anymore. Some test cases are added to ensure the console has the expected behavior in different situations. Depends on D74708 Differential Revision: https://phabricator.services.mozilla.com/D75297

view details

Jan de Mooij

commit sha 91e4aa862f20ea0bfb37939ad3c6663a9bf27320

Bug 1638811 - Use StringReplaceAllString to simplify EscapeAttributeValue. r=anba Differential Revision: https://phabricator.services.mozilla.com/D75779

view details

push time in 3 days

create barnchkhuey/x11-decoder

branch : master

created branch time in 3 days

created repositorykhuey/x11-decoder

Decode the X11 protocol.

created time in 3 days

issue commentkhuey/bb8

How to use bb8 with redis pubsub connections ?

Can you get yourself a dedicated connection (via Pool<M>::dedicated_connection) and use that? I'm not entirely sure how Redis's pub-sub stuff works but I added that for doing LISTENs on postgres.

sync

comment created time in 3 days

push eventmozilla/rr

Keno Fischer

commit sha 94cf24c7105dccce1d0b96c62a21fc14b106f932

Aarch64 build system support Add build flags for aarch64, add the ability to mark tests x86 only by moving them into the x86/ directory, where they will be built on x86, but ignored on aarch64 (or other future architectures).

view details

push time in 4 days

PR merged mozilla/rr

Aarch64 build system support

Add build flags for aarch64, add the ability to mark tests x86 only by moving them into the x86/ directory, where they will be built on x86, but ignored on aarch64 (or other future architectures).

+97 -62

0 comment

50 changed files

Keno

pr closed time in 4 days

Pull request review commentmozilla/rr

Aarch64 build system support

 configure_file(   ${CMAKE_BINARY_DIR}/git_revision.h ) -set(FLAGS_COMMON "-msse2 -D__MMX__ -D__SSE__ -D__SSE2__ -D__USE_LARGEFILE64 -pthread")+set(FLAGS_COMMON "-D__USE_LARGEFILE64 -pthread")+set(supports32bit true)+set(x86ish false)

Alright fair.

Keno

comment created time in 4 days

Pull request review commentmozilla/rr

Aarch64 build system support

 configure_file(   ${CMAKE_BINARY_DIR}/git_revision.h ) -set(FLAGS_COMMON "-msse2 -D__MMX__ -D__SSE__ -D__SSE2__ -D__USE_LARGEFILE64 -pthread")+set(FLAGS_COMMON "-D__USE_LARGEFILE64 -pthread")+set(supports32bit true)+set(x86ish false)

It seems kind of weird to have these start in opposite positions and then have one branch of the if flip each. Maybe just start with the x86 values and have the aarch64 branch clip both.

Keno

comment created time in 4 days

push eventmozilla/rr

Keno Fischer

commit sha 04f22d9b1ec088cce5e59193619364ee59390098

Aarch64 task running and register logic As discussed in #2564, aarch64 register definition is a bit tricky, because the kernel does not give us a way to request orig_x0, so we need to track it ourselves. This means splitting the register format in the trace from just a default Arch::user_regs_struct to include the extra orig_x0. Additionally, we need to make sure to copy x0 to this field on every syscall entry.

view details

push time in 4 days

PR merged mozilla/rr

Aarch64 task running and register logic

As discussed in #2564, aarch64 register definition is a bit tricky, because the kernel does not give us a way to request orig_x0, so we need to track it ourselves. This means splitting the register format in the trace from just a default Arch::user_regs_struct to include the extra orig_x0. Additionally, we need to make sure to copy x0 to this field on every syscall entry.

+323 -104

5 comments

18 changed files

Keno

pr closed time in 4 days

pull request commentmozilla/rr

Aarch64 task running and register logic

@Keno the intermittent you mentioned was that assertion?

Keno

comment created time in 4 days

Pull request review commentmozilla/rr

Aarch64 task running and register logic

 void Task::flush_regs() {   if (registers_dirty) {     LOG(debug) << "Flushing registers for tid " << tid << " " << registers;     auto ptrace_regs = registers.get_ptrace();+#if defined(__i386__) || defined(__x86_64)     if (ptrace_if_alive(PTRACE_SETREGS, nullptr, &ptrace_regs)) {       /* It's ok for flush regs to fail, e.g. if the task got killed underneath        * us - we just need to remember not to trust any value we would load        * from ptrace otherwise */       registers_dirty = false;+      orig_syscallno_dirty = false;+    }+#elif defined(__aarch64__)+    struct iovec vec = { &ptrace_regs,+                          sizeof(ptrace_regs) };+    if (ptrace_if_alive(PTRACE_SETREGSET, NT_PRSTATUS, &vec)) {+      registers_dirty = false;+    }+#else+    #error "Unknown archietcture"+#endif+  }+#if defined(__aarch64__)+  if (orig_syscallno_dirty) {+    uintptr_t syscall = registers.original_syscallno();+    struct iovec vec = { &syscall,+                          sizeof(syscall) };+    LOG(debug) << "Chaning syscall to " << syscall;+    if (ptrace_if_alive(PTRACE_SETREGSET, NT_ARM_SYSTEM_CALL, &vec)) {+      orig_syscallno_dirty = false;     }   }+#endif

maybe in the x86 if (registers_dirty) block add else { ASSERT(this, !orig_syscallno_dirty); } then?

Keno

comment created time in 4 days

Pull request review commentmozilla/rr

Aarch64 task running and register logic

 void Task::flush_regs() {   if (registers_dirty) {     LOG(debug) << "Flushing registers for tid " << tid << " " << registers;     auto ptrace_regs = registers.get_ptrace();+#if defined(__i386__) || defined(__x86_64)     if (ptrace_if_alive(PTRACE_SETREGS, nullptr, &ptrace_regs)) {       /* It's ok for flush regs to fail, e.g. if the task got killed underneath        * us - we just need to remember not to trust any value we would load        * from ptrace otherwise */       registers_dirty = false;+      orig_syscallno_dirty = false;+    }+#elif defined(__aarch64__)+    struct iovec vec = { &ptrace_regs,+                          sizeof(ptrace_regs) };+    if (ptrace_if_alive(PTRACE_SETREGSET, NT_PRSTATUS, &vec)) {+      registers_dirty = false;+    }+#else+    #error "Unknown archietcture"+#endif+  }+#if defined(__aarch64__)+  if (orig_syscallno_dirty) {+    uintptr_t syscall = registers.original_syscallno();+    struct iovec vec = { &syscall,+                          sizeof(syscall) };+    LOG(debug) << "Chaning syscall to " << syscall;+    if (ptrace_if_alive(PTRACE_SETREGSET, NT_ARM_SYSTEM_CALL, &vec)) {+      orig_syscallno_dirty = false;     }   }+#endif

Ah, yes, good point.

Keno

comment created time in 4 days

push eventmozilla/rr

Keno Fischer

commit sha a4c78387fed666d3143e908c5848ecb6d6fd198b

Build fixed for undefined syscalls in syscallbuf

view details

push time in 4 days

PR merged mozilla/rr

Build fixes for undefined aarch64 syscalls in syscallbuf

Some legacy syscalls are undefined on aarch64. Build their hooks conditionally, and replace them with the flags or *at versions where we need to call them manually.

+60 -16

0 comment

1 changed file

Keno

pr closed time in 4 days

Pull request review commentmozilla/rr

Aarch64 task running and register logic

 void patch_after_exec_arch<X64Arch>(RecordTask* t, Monkeypatcher& patcher) { }  template <>-void patch_after_exec_arch<ARM64Arch>(RecordTask*, Monkeypatcher&) {+void patch_after_exec_arch<ARM64Arch>(RecordTask* t, Monkeypatcher& patcher) {+  setup_preload_library_path<ARM64Arch>(t);+  setup_audit_library_path<ARM64Arch>(t);++  for (const auto& m : t->vm()->maps()) {+    auto& km = m.map;+    patcher.patch_after_mmap(t, km.start(), km.size(),+                             km.file_offset_bytes()/page_size(), -1,+                             Monkeypatcher::MMAP_EXEC);+  }++  if (!t->vm()->has_vdso()) {+    patch_auxv_vdso(t);

Lets file an issue on renaming it to patch_auxv_to_remove_vdso or something.

Keno

comment created time in 4 days

Pull request review commentmozilla/rr

Aarch64 task running and register logic

 void Task::flush_regs() {   if (registers_dirty) {     LOG(debug) << "Flushing registers for tid " << tid << " " << registers;     auto ptrace_regs = registers.get_ptrace();+#if defined(__i386__) || defined(__x86_64)

It seems your __x86_64__ got its right arm torn off in some sort of terrible industrial accident.

Keno

comment created time in 4 days

Pull request review commentmozilla/rr

Aarch64 task running and register logic

 class Task {   // True when 'registers' has changes that haven't been flushed back to the   // task yet.   bool registers_dirty;+  // True when changes to the original syscallno in 'registers' have not been+  // flushed back to the task yet.

Add "Some architectures (e.g. AArch64) require a separate ptrace call for this."

Keno

comment created time in 4 days

Pull request review commentmozilla/rr

Aarch64 task running and register logic

 class Task {   /**    * Return the debug status (DR6 on x86). The debug status is always cleared    * in resume_execution() before we resume, so it always only reflects the-   * events since the last resume.+   * events since the last resume. Must not be called on non-x86 architectures.    */-  uintptr_t debug_status();+  uintptr_t x86_debug_status();+   /**-   * Set the debug status (DR6 on x86).+   * Set the debug status (DR6 on x86). Noop on non-x86 architectures.    */-  void set_debug_status(uintptr_t status);+  void set_x86_debug_status(uintptr_t status);    /**-   * Determine why a SIGTRAP occurred. Uses debug_status() but doesn't+   * Determine why a SIGTRAP occurred. Ont x86, uses x86_debug_status() but doesn't

On

Keno

comment created time in 4 days

Pull request review commentmozilla/rr

Aarch64 task running and register logic

 void Task::flush_regs() {   if (registers_dirty) {     LOG(debug) << "Flushing registers for tid " << tid << " " << registers;     auto ptrace_regs = registers.get_ptrace();+#if defined(__i386__) || defined(__x86_64)     if (ptrace_if_alive(PTRACE_SETREGS, nullptr, &ptrace_regs)) {       /* It's ok for flush regs to fail, e.g. if the task got killed underneath        * us - we just need to remember not to trust any value we would load        * from ptrace otherwise */       registers_dirty = false;+      orig_syscallno_dirty = false;+    }+#elif defined(__aarch64__)+    struct iovec vec = { &ptrace_regs,+                          sizeof(ptrace_regs) };+    if (ptrace_if_alive(PTRACE_SETREGSET, NT_PRSTATUS, &vec)) {+      registers_dirty = false;+    }+#else+    #error "Unknown archietcture"+#endif+  }+#if defined(__aarch64__)+  if (orig_syscallno_dirty) {+    uintptr_t syscall = registers.original_syscallno();+    struct iovec vec = { &syscall,+                          sizeof(syscall) };+    LOG(debug) << "Chaning syscall to " << syscall;+    if (ptrace_if_alive(PTRACE_SETREGSET, NT_ARM_SYSTEM_CALL, &vec)) {+      orig_syscallno_dirty = false;     }   }+#endif
#elif defined(__i386__) || defined(__x86_64__)
  ASSERT(t, !orig_syscallno_dirty);
#endif
Keno

comment created time in 4 days

Pull request review commentmozilla/rr

Aarch64 task running and register logic

 static bool cpu_has_KNL_string_singlestep_bug() { static int single_step_coalesce_cutoff() { return 16; }  void Task::work_around_KNL_string_singlestep_bug() {-  uintptr_t cx = regs().cx();-  uintptr_t cutoff = single_step_coalesce_cutoff();   /* The extra cx >= cutoff check is just an optimization, to avoid the      moderately expensive load from ip() if we can */-  if (cpu_has_KNL_string_singlestep_bug() && cx > cutoff &&-      at_x86_string_instruction(this)) {-    /* KNL has a quirk where single-stepping a string instruction can step up-       to 64 iterations. Work around this by fudging registers to force the-       processor to execute one iteration and one interation only. */-    LOG(debug) << "Working around KNL single-step hardware bug (cx=" << cx-               << ")";-    if (cx > cutoff) {-      last_resume_orig_cx = cx;-      Registers r = regs();-      /* An arbitrary value < cutoff would work fine here, except 1, since-         the last iteration of the loop behaves differently */-      r.set_cx(cutoff);-      set_regs(r);+  if (cpu_has_KNL_string_singlestep_bug()) {

I think it'd be easier just to if (!cpu_has_KNL_string_singlestep_bug()) { return; } at the beginning and leave the rest of this function undisturbed.

Keno

comment created time in 4 days

Pull request review commentmozilla/rr

Aarch64 task running and register logic

 const uintptr_t X86_DF_FLAG = 1 << 10; const uintptr_t X86_RF_FLAG = 1 << 16; const uintptr_t X86_ID_FLAG = 1 << 21; +const uintptr_t AARCH64_DBG_SPSR_SS = 1 << 21;

I'm just assuming this is correct because it's shockingly difficult to find what the layout of the PSTATE is in the ARM Reference Manual.

Keno

comment created time in 4 days

Pull request review commentmozilla/rr

Aarch64 task running and register logic

 static bool is_singlestep_resume(ResumeRequest request) {  TrapReasons Task::compute_trap_reasons() {   ASSERT(this, stop_sig() == SIGTRAP);+   TrapReasons reasons;-  uintptr_t status = debug_status();-  reasons.singlestep = (status & DS_SINGLESTEP) != 0; -  if (is_singlestep_resume(how_last_execution_resumed)) {-    if (is_at_syscall_instruction(this, address_of_last_execution_resume) &&-        ip() ==-            address_of_last_execution_resume +-                syscall_instruction_length(arch())) {-      // During replay we execute syscall instructions in certain cases, e.g.-      // mprotect with syscallbuf. The kernel does not set DS_SINGLESTEP when we-      // step over those instructions so we need to detect that here.-      reasons.singlestep = true;-    } else {-      TrappedInstruction ti =-        trapped_instruction_at(this, address_of_last_execution_resume);-      if (ti == TrappedInstruction::CPUID &&-          ip() == address_of_last_execution_resume +-                       trapped_instruction_len(TrappedInstruction::CPUID)) {-        // Likewise we emulate CPUID instructions and must forcibly detect that-        // here.-        reasons.singlestep = true;-        // This also takes care of the did_set_breakpoint_after_cpuid workaround case-      } else if (ti == TrappedInstruction::INT3 &&-          ip() == address_of_last_execution_resume +-                       trapped_instruction_len(TrappedInstruction::INT3)) {-        // INT3 instructions should also be turned into a singlestep here.+  const siginfo_t& si = get_siginfo();+  if (arch() == x86 || arch() == x86_64) {+    uintptr_t status = x86_debug_status();+    reasons.singlestep = (status & DS_SINGLESTEP) != 0;+    if (!reasons.singlestep && is_singlestep_resume(how_last_execution_resumed)) {

Why did you add the !reasons.singlestep condition?

Keno

comment created time in 4 days

Pull request review commentmozilla/rr

Aarch64 task running and register logic

 void patch_after_exec_arch<X64Arch>(RecordTask* t, Monkeypatcher& patcher) { }  template <>-void patch_after_exec_arch<ARM64Arch>(RecordTask*, Monkeypatcher&) {+void patch_after_exec_arch<ARM64Arch>(RecordTask* t, Monkeypatcher& patcher) {+  setup_preload_library_path<ARM64Arch>(t);+  setup_audit_library_path<ARM64Arch>(t);++  for (const auto& m : t->vm()->maps()) {+    auto& km = m.map;+    patcher.patch_after_mmap(t, km.start(), km.size(),+                             km.file_offset_bytes()/page_size(), -1,+                             Monkeypatcher::MMAP_EXEC);+  }++  if (!t->vm()->has_vdso()) {+    patch_auxv_vdso(t);

I'm confused, why is this in a !has_vdso branch?

Keno

comment created time in 4 days

Pull request review commentmozilla/rr

Aarch64 task running and register logic

 long AutoRemoteSyscalls::syscall_base(int syscallno, Registers& callregs) {         // We entered the syscall, so stop now         break;       }+      if (t->ptrace_event() == PTRACE_EVENT_EXIT) {+        // We died, just let it be

Is this a theoretical concern or did you actually see it happen?

Keno

comment created time in 4 days

Pull request review commentmozilla/rr

Aarch64 task running and register logic

 long AutoRemoteSyscalls::syscall_base(int syscallno, Registers& callregs) {         // We entered the syscall, so stop now         break;       }+      if (t->ptrace_event() == PTRACE_EVENT_EXIT) {+        // We died, just let it be+        break;+      }+      if (t->stop_sig() == SIGTRAP && t->get_siginfo().si_code == TRAP_TRACE) {

If this is AArch64 specific, perhaps it should be ifdefed?

Keno

comment created time in 4 days

Pull request review commentmozilla/rr

Aarch64 task running and register logic

 def write_rr_page(f, is_64, is_arm, is_replay):     'rr_page_arm64': lambda stream: write_rr_page(stream, True, True, False),     'rr_page_32_replay': lambda stream: write_rr_page(stream, False, False, True),     'rr_page_64_replay': lambda stream: write_rr_page(stream, True, False, True),-    'rr_page_arm64_replay': lambda stream: write_rr_page(stream, True, False, True),+    'rr_page_arm64_replay': lambda stream: write_rr_page(stream, True, True, True),

booleans suck

Keno

comment created time in 4 days

Pull request review commentmozilla/rr

Aarch64 task running and register logic

 class remote_code_ptr {   remote_code_ptr decrement_by_bkpt_insn_length(SupportedArch arch) const {     return remote_code_ptr(ptr - rr::bkpt_instruction_length(arch));   }+  remote_code_ptr undo_executed_bkpt(SupportedArch arch) {+    switch (arch) {+      case x86:+      case x86_64:+        return decrement_by_bkpt_insn_length(arch);

make decrement_by_bkpt_insn_length private so that we don't get this wrong in the future?

Keno

comment created time in 4 days

Pull request review commentmozilla/rr

Aarch64 task running and register logic

 inline bool is_kernel_trap(int si_code) {   /* XXX unable to find docs on which of these "should" be    * right.  The SI_KERNEL code is seen in the int3 test, so we    * at least need to handle that. */-  return si_code == TRAP_BRKPT || si_code == SI_KERNEL;+  return si_code == TRAP_TRACE || si_code == TRAP_BRKPT || si_code == SI_KERNEL;

is TRAP_TRACE for single-stepping on AArch64? It's unfortunate that it doesn't agree with x86.

Keno

comment created time in 4 days

push eventmozilla/rr

Kyle Huey

commit sha d172aaf9c2d0f845a6f33f55925d0aff59e4766f

Catch up on the latest syscall additions.

view details

push time in 4 days

issue commentmozilla/rr

rr triggered fatal assertion: Syscall close failed with errno EBADF

803b3a1 is the regressing commit.

Cc @Keno

kavinda-forcepoint

comment created time in 5 days

push eventmozilla/rr

Keno Fischer

commit sha 6cc898f1c36ce2eccdfac1dbb3e3e9d49b201144

Fix up a few missed issues in ptrace move Just a few things that need to be fixed up when compiling on an actual aarch64 system that I missed in the refactor.

view details

Keno Fischer

commit sha 610884f093d9278483ab476201a34f2c685f71b1

Add PerfCounters support for Aarch64 For the moment only define NeoverseN1, which is what I'm testing on. The scheme probably works on other microachitectures also, as long as they support LSE, but we should test those one by one.

view details

push time in 5 days

PR merged mozilla/rr

Add PerfCounters support for Aarch64

Split PerfCounters.cc into common parts, x86 specific detection logic in PerfCounters_x86.cc and aarch64 specific logic in PerfCounters_aarch64.cc. On aarch64, the only currently supported architecture is Neoverse N1 which is what I'm testing on. We can add additional ones as we validate where our scheme works.

Also includes a small commit to fix up a few places I missed in the big ptrace move.

+492 -356

1 comment

10 changed files

Keno

pr closed time in 5 days

push eventgimli-rs/cpp_demangle

Markus Stange

commit sha 526474ec68ce5f198897d8fee75e0f788371dac4

Add no_return_type to DemangleOptions.

view details

push time in 5 days

PR merged gimli-rs/cpp_demangle

Add no_return_type to DemangleOptions.

Fixes #201.

I could use some feedback on the naming; I flipped back and forth between no_return, no_return_type and no_return_types and then settled on no_return_type.

+78 -6

0 comment

6 changed files

mstange

pr closed time in 5 days

issue closedgimli-rs/cpp_demangle

Ability to hide the return type?

Hi,

I'm ending up with demangled names such as these ones:

  • void draw_quad_spans<unsigned int>(int, glsl::vec2_scalar*, unsigned short, float __vector(16)*, Texture&, int, Texture&, ClipRect const&) (from mangled name: _ZL15draw_quad_spansIjEviPN4glsl11vec2_scalarEtPDv16_fR7TextureiS6_RK8ClipRect)
  • void draw_elements<unsigned short>(int, int, Buffer&, unsigned long, VertexArray&, Texture&, int, Texture&) (from mangled name: _ZL13draw_elementsItEviiR6BuffermR11VertexArrayR7TextureiS5_)
  • int check_depth8<515, false>(unsigned short, unsigned short*, short __vector(8)&) (from mangled name: _ZL12check_depth8ILi515ELb0EEitPtRDv8_s)
  • decltype ((applyImpl)({parm#1}, {parm#2}, (*this).mArguments, std::__1::integer_sequence<unsigned long, (unsigned long)0, (unsigned long)1>{})) mozilla::detail::RunnableMethodArguments<mozilla::wr::WrWindowId, bool>::apply<mozilla::wr::RenderThread, void (mozilla::wr::RenderThread::*)(mozilla::wr::WrWindowId, bool)>(mozilla::wr::RenderThread*, void (mozilla::wr::RenderThread::*)(mozilla::wr::WrWindowId, bool)) (from mangled name: _ZN7mozilla6detail23RunnableMethodArgumentsIJNS_2wr10WrWindowIdEbEE5applyINS2_12RenderThreadEMS6_FvS3_bEEEDTcl9applyImplfp_fp0_dtdefpT10mArgumentstlNSt3__116integer_sequenceImJLm0ELm1EEEEEEEPT_T0_)

I would prefer to hide the return type. Especially in the last case it produces a lot of visual noise. Also, most symbols do not have a return type, so skipping return types for all symbols would make things more consistent and uniform.

What are your opinions on adding a flag to skip the return type?

closed time in 5 days

mstange

Pull request review commentgimli-rs/cpp_demangle

Add no_return_type to DemangleOptions.

 extern "C" { struct DemangleOptions {   // Do not display function arguments.   bool no_params;+  // Do not display the function return type.+  bool no_return_type;

I think the naming is fine. A single function has multiple parameters but only one return type, so this makes sense.

mstange

comment created time in 5 days

Pull request review commentmozilla/rr

Add PerfCounters support for Aarch64

+/* -*- Mode: C++; tab-width: 8; c-basic-offset: 2; indent-tabs-mode: nil; -*- */+// This file is included from PerfCounters.cc++static const char* midr_path =+    "/sys/devices/system/cpu/cpu0/regs/identification/midr_el1";++/**+ * Return the detected, known microarchitecture of this CPU, or don't+ * return; i.e. never return UnknownCpu.+ */+static CpuMicroarch compute_cpu_microarch() {+  FILE *midr_el1 = fopen(midr_path, "r");+  if (!midr_el1) {+    CLEAN_FATAL() << "Failed to read midr register from kernel";+  }+  uint32_t midir;+  if (1 != fscanf(midr_el1, "%x", &midir)) {+    CLEAN_FATAL() << "Failed to read midr register from kernel";+  }+  switch (midir) {+    case 0x413fd0c1:+      return ARMNeoverseN1;+    default:+      break;+  }+  CLEAN_FATAL() << "Aarch64 CPU type " << HEX(midir) << " unknown";+  return UnknownCpu; // not reached+}++static void arch_check_restricted_counter() {+  if (!Flags::get().suppress_environment_warnings) {+    fprintf(stderr,+            "Your CPU supports only one performance counter.\n"+            "Use of LL/SC instructions will not be detected and will\n"+            "cause silently corrupt recordings. It is highly recommended\n"+            "that you alter your configuration to enable additional performance\n"+            "counters.\n");+  }+}++static bool always_recreate_counters() {+  return false;+}++static void check_for_arch_bugs() {}++template <>+void PerfCounters::reset_arch_extras<ARM64Arch>() {+  // IN_TXCP isn't going to work reliably. Assume that HLE/RTM are not+  // used,+  // and check that.

I think you need to update this comment :)

Keno

comment created time in 5 days

Pull request review commentmozilla/rr

Add PerfCounters support for Aarch64

 Ticks PerfCounters::read_ticks(Task* t) {     }   } +  if (fd_strex_counter.is_open()) {+    uint64_t strex_count = read_counter(fd_strex_counter);+    if (strex_count > 0) {+      LOG(debug) << strex_count << " strex detected";+      if (!Flags::get().force_things) {+        ASSERT(t, false)+            << strex_count+            << " (speculatively) executed strex instructions detected. \n"+               "On aarch64, rr only supports applications making use of LSE\n"+               "atomics rather than legacy LL/SC-based atomics.\n"+               "Aborting. Retry with -F to override, but it will probably\n"+               "fail.";

make clear that it's replay that will probably fail.

Keno

comment created time in 5 days

Pull request review commentmozilla/rr

Add PerfCounters support for Aarch64

 bool RecordSession::handle_signal_event(RecordTask* t, StepState* step_state) {   return true; } +template <typename Arch>+static bool is_ptrace_any_sysemu_arch(int command) {

this nitpicky but I think the SYSEMU test and the SINGLESTEP test should agree on whether or not "any" is in the name. I don't care which way you come down on it but it should be consistent.

Keno

comment created time in 5 days

Pull request review commentmozilla/rr

Add PerfCounters support for Aarch64

+/* -*- Mode: C++; tab-width: 8; c-basic-offset: 2; indent-tabs-mode: nil; -*- */+// This file is included from PerfCounters.cc++static const char* midr_path =+    "/sys/devices/system/cpu/cpu0/regs/identification/midr_el1";

I think this is the point at which we start being concerned about heterogeneous CPUs. On x86 we pin to a random logical CPU that's not already in use. On ARM we could pin to cpu0 for now, but eventually we'll want to at least be able to choose any of the big cores, I think.

Keno

comment created time in 5 days

Pull request review commentmozilla/rr

Add PerfCounters support for Aarch64

+/* -*- Mode: C++; tab-width: 8; c-basic-offset: 2; indent-tabs-mode: nil; -*- */+// This file is included from PerfCounters.cc++static bool has_kvm_in_txcp_bug;+static bool has_xen_pmi_bug;+static bool supports_txcp;++/**+ * Return the detected, known microarchitecture of this CPU, or don't+ * return; i.e. never return UnknownCpu.+ */+static CpuMicroarch compute_cpu_microarch() {+  auto cpuid_vendor = cpuid(CPUID_GETVENDORSTRING, 0);+  char vendor[13];+  memcpy(&vendor[0], &cpuid_vendor.ebx, 4);+  memcpy(&vendor[4], &cpuid_vendor.edx, 4);+  memcpy(&vendor[8], &cpuid_vendor.ecx, 4);+  vendor[12] = 0;+  if (strcmp(vendor, "GenuineIntel") && strcmp(vendor, "AuthenticAMD")) {

While we're here you could replace this with strncmp and get rid of the trailing null addition. I remember you switching something else to strncmp during this PR series.

Keno

comment created time in 5 days

Pull request review commentmozilla/rr

Add PerfCounters support for Aarch64

 struct PmuConfig { // See Intel 64 and IA32 Architectures Performance Monitoring Events. // See check_events from libpfm4. static const PmuConfig pmu_configs[] = {-  { IntelCometlake, "Intel Cometlake", 0x5101c4, 0, 0x5301cb, 100, PMU_TICKS_RCB },-  { IntelKabylake, "Intel Kabylake", 0x5101c4, 0, 0x5301cb, 100, PMU_TICKS_RCB },-  { IntelSilvermont, "Intel Silvermont", 0x517ec4, 0, 0x5301cb, 100, PMU_TICKS_RCB },-  { IntelGoldmont, "Intel Goldmont", 0x517ec4, 0, 0x5301cb, 100, PMU_TICKS_RCB },-  { IntelSkylake, "Intel Skylake", 0x5101c4, 0, 0x5301cb, 100, PMU_TICKS_RCB },-  { IntelBroadwell, "Intel Broadwell", 0x5101c4, 0, 0x5301cb, 100, PMU_TICKS_RCB },-  { IntelHaswell, "Intel Haswell", 0x5101c4, 0, 0x5301cb, 100, PMU_TICKS_RCB },-  { IntelIvyBridge, "Intel Ivy Bridge", 0x5101c4, 0, 0x5301cb, 100, PMU_TICKS_RCB },-  { IntelSandyBridge, "Intel Sandy Bridge", 0x5101c4, 0, 0x5301cb, 100, PMU_TICKS_RCB },-  { IntelNehalem, "Intel Nehalem", 0x5101c4, 0, 0x50011d, 100, PMU_TICKS_RCB },-  { IntelWestmere, "Intel Westmere", 0x5101c4, 0, 0x50011d, 100, PMU_TICKS_RCB },-  { IntelPenryn, "Intel Penryn", 0, 0, 0, 100, 0 },-  { IntelMerom, "Intel Merom", 0, 0, 0, 100, 0 },-  { AMDF15R30, "AMD Family 15h Revision 30h", 0xc4, 0xc6, 0, 250,+  { IntelCometlake, "Intel Cometlake", 0x5101c4, 0, 0x5301cb, 0, 100, PMU_TICKS_RCB },+  { IntelKabylake, "Intel Kabylake", 0x5101c4, 0, 0x5301cb, 0, 100, PMU_TICKS_RCB },+  { IntelSilvermont, "Intel Silvermont", 0x517ec4, 0, 0x5301cb, 0, 100, PMU_TICKS_RCB },+  { IntelGoldmont, "Intel Goldmont", 0x517ec4, 0, 0x5301cb, 0, 100, PMU_TICKS_RCB },+  { IntelSkylake, "Intel Skylake", 0x5101c4, 0, 0x5301cb, 0, 100, PMU_TICKS_RCB },+  { IntelBroadwell, "Intel Broadwell", 0x5101c4, 0, 0x5301cb, 0, 100, PMU_TICKS_RCB },+  { IntelHaswell, "Intel Haswell", 0x5101c4, 0, 0x5301cb, 0, 100, PMU_TICKS_RCB },+  { IntelIvyBridge, "Intel Ivy Bridge", 0x5101c4, 0, 0x5301cb, 0, 100, PMU_TICKS_RCB },+  { IntelSandyBridge, "Intel Sandy Bridge", 0x5101c4, 0, 0x5301cb, 0, 100, PMU_TICKS_RCB },+  { IntelNehalem, "Intel Nehalem", 0x5101c4, 0, 0x50011d, 0, 100, PMU_TICKS_RCB },+  { IntelWestmere, "Intel Westmere", 0x5101c4, 0, 0x50011d, 0, 100, PMU_TICKS_RCB },+  { IntelPenryn, "Intel Penryn", 0, 0, 0, 100, 0, 0 },+  { IntelMerom, "Intel Merom", 0, 0, 0, 100, 0, 0 },+  { AMDF15R30, "AMD Family 15h Revision 30h", 0xc4, 0xc6, 0, 0, 250,     PMU_TICKS_TAKEN_BRANCHES | PMU_SKIP_INTEL_BUG_CHECK },-  { AMDRyzen, "AMD Ryzen", 0x5100d1, 0, 0, 1000, PMU_TICKS_RCB },+  { AMDRyzen, "AMD Ryzen", 0x5100d1, 0, 0, 0, 1000, PMU_TICKS_RCB },+  // 0x21 == BR_RETIRED - Architecturally retired taken branches+  // 0x6F == STREX_SPEC - Speculatively executed strex instructions+  { ARMNeoverseN1, "ARM Neoverse N1", 0x21, 0, 0, 0x6F, 1000, PMU_TICKS_TAKEN_BRANCHES }

Have you experimented with this skid value at all? 1000 is a bit high.

Keno

comment created time in 6 days

issue commentBurntSushi/byteorder

`Endianess` enum for runtime cases

The X11 protocol also has byte order that is selectable at runtime.

Xion

comment created time in 5 days

CommitCommentEvent

push eventkhuey/rr

Robert O'Callahan

commit sha c302cfdcf5259ba5203ba08c1e4a3678e033955d

Don't look for 'in' in gdb output

view details

Keno Fischer

commit sha f013d5995931ad65e12694d48ff78cc4fbc8c7df

Move arch specific ptrace commands into kernel_abi ptrace is highly architecture specific. Different architectures support different ptrace commands and even when they support the same ones, the number assigned to the PTRACE_* constants can vary (at least for the low-numbered commands, the numbering scheme was unified in newer kernels). If they all had the same numbers across architectures (just with some architectures missing), we could just put everything in kernel_supplement, but since that's not the case, kernel_abi is probably the right place for it. This requries a bit of re-organization, but is fairly mechanical. While we're here, also take care of arch_prctl, but here, since this syscall is x86_64 specific, we only need to make sure all values we use are present in kernel_supplement.h

view details

Robert O'Callahan

commit sha 2f98657c6490134e2142c0f392b8c3b0978f3ec4

Use python3 in .run scripts because 'python' isn't installed in RHEL

view details

Robert O'Callahan

commit sha 92ea35c0bcb76f5e1322ce8f9aa9998e35284384

Handle ENOTTY in sioc

view details

Keno Fischer

commit sha 3f5989a148acd757cc850eceac0697888c5caeae

Miscellaneous aarch64 build fixes This collects various one off changes with no commonality other than that they're breaking when built on aarch64. A few of these fix typos in earlier commits that snuck in when I prepared the patches for submission. A few are new. Should generally be straightforward.

view details

Keno Fischer

commit sha 64fdb81c982b126f91e7a135d9750775f6396324

Separate out type verification for x86-only structure Some structures are x86-specific and not defined on aarch64. The current verifier setup will skip making sure they have the same size, but will still try to reference them, causing undefined variable errors. Mark the x86-specific structs to avoid trying to verify them on aarch64.

view details

Keno Fischer

commit sha db9689ba21847058ce4a0f0063065f725f97c707

Fix definition of semid64_ds on aarch64

view details

Robert O'Callahan

commit sha 2922ccbc81d0f8f948ed669d3b6c75b6febec88e

Make sure we update Task::serial when a non-main thread does an execve during replay This fixes the exec_from_other_thread test on RHEL 8.

view details

Kyle Huey

commit sha 9b87b8c0c5ea816776f883b9fdc615954732526c

Since elf.h and linux/elf.h disagree about the name of this constant, standardize on elf.h's.

view details

push time in 5 days

push eventmozilla/rr

Kyle Huey

commit sha 9b87b8c0c5ea816776f883b9fdc615954732526c

Since elf.h and linux/elf.h disagree about the name of this constant, standardize on elf.h's.

view details

push time in 5 days

issue commentgimli-rs/cpp_demangle

Ability to hide the return type?

Adding a flag to DemangleOptions and picking it up in BareFunctionTypes Demangle impl seems fine.

mstange

comment created time in 5 days

more