profile
viewpoint

jasperla/openbsd-wip 214

OpenBSD work in progress ports

semarie/sysclean 28

list obsolete files between OpenBSD upgrades

semarie/build-rust 24

Script helper for building rustc and cargo from source on OpenBSD (without rustup)

semarie/checkrestart 8

a way to know when a running program is using an old version of upgraded files (for OpenBSD)

semarie/rust 1

a safe, concurrent, practical language (latest working version for openbsd - but some PR maybe pending)

semarie/rust-ports 1

development repository for lang/rust openbsd port tree

semarie/tryton-ports 1

development repository for productivity/tryton openbsd ports tree

semarie/cargo-generate-vendor 0

Tool for generating metadata for cargo vendoring

semarie/httpd 0

OpenBSD httpd

semarie/kvm_dumpbuf 0

OpenBSD: dump struct buf via kvm(3)

push eventsemarie/zig

Sébastien Marie

commit sha 3115d2f2cdc13f714740ccf024e1baedfc31c93d

readd original code from #6638. realpathZ() is expected to take a [*:0]const u8

view details

Vincent Rischmann

commit sha 59af275680ad12f7da4dcc5b41a2cab707ec2ffa

test runner: use the correct number in leak report

view details

Sébastien Marie

commit sha d7495a9c45e11da83b4db08426d0a13cadefe3da

openbsd: make dl_phdr_info cross arches introduce Addr and Half definition to std.elf, and use them for dl_phdr_info

view details

push time in 4 days

pull request commentrust-lang/libc

Add dl_iterate_phdr to some BSD OSs

tests are fine on OpenBSD. thanks !

lzutao

comment created time in 4 days

PR opened ziglang/zig

openbsd: make dl_phdr_info cross arches

it should make dl_phdr_info on OpenBSD to be correctly defined on all arches (64 or 32 bits).

+5 -2

0 comment

1 changed file

pr created time in 4 days

create barnchsemarie/zig

branch : openbsd-dl_phdr_info

created branch time in 4 days

pull request commentziglang/zig

make selfExePath() compile on OpenBSD

this PR is only to restore an already accepted change with was lost in the merge.

semarie

comment created time in 4 days

Pull request review commentziglang/zig

make selfExePath() compile on OpenBSD

 pub fn selfExePath(out_buffer: []u8) SelfExePathError![]u8 {                 const PATH = std.os.getenvZ("PATH") orelse return error.FileNotFound;                 var path_it = mem.tokenize(PATH, &[_]u8{path.delimiter});                 while (path_it.next()) |a_path| {-                    var resolved_path_buf: [MAX_PATH_BYTES]u8 = undefined;+                    var resolved_path_buf: [MAX_PATH_BYTES-1:0]u8 = undefined;

in https://github.com/ziglang/zig/pull/6638#discussion_r502887556, I was told to use MAX_PATH_BYTES-1:0.

semarie

comment created time in 4 days

PullRequestReviewEvent

pull request commentrust-lang/libc

Add dl_iterate_phdr to some BSD OSs

I just tested it on OpenBSD, and it failed due to p_type error. Adding a cfg.skip_field section as for freebsd makes the tests to pass on OpenBSD.

Could you add it inside test_openbsd() ? Else I will correct it after your PR to be commited.

Thanks to have provided the types and function on OpenBSD !

lzutao

comment created time in 4 days

PR opened ziglang/zig

make selfExePath() compile on OpenBSD

readd original code from #6638. realpathZ() is expected to take a [*:0]const u8

+1 -1

0 comment

1 changed file

pr created time in 5 days

create barnchsemarie/zig

branch : openbsd-realpathZ

created branch time in 5 days

pull request commentziglang/zig

add minimal openbsd support

@andrewrk I am a bit disappointed. what was commited isn't the same code as my PR: this one doesn't build on OpenBSD.

./lib/std/fs.zig:2261:39: error: expected type '[*:0]const u8', found '*[1024]u8'
                    if (os.realpathZ(&resolved_path_buf, &real_path_buf)) |real_path| {
                                      ^
./lib/std/fs.zig:2261:39: note: destination pointer requires a terminating '0' sentinel
                    if (os.realpathZ(&resolved_path_buf, &real_path_buf)) |real_path| {
                                      ^

The original code has var resolved_path_buf: [MAX_PATH_BYTES-1:0]u8 = undefined; whereas the commited code is var resolved_path_buf: [MAX_PATH_BYTES]u8 = undefined;

Should I redo a new PR for correcting the type ?

semarie

comment created time in 9 days

issue commentziglang/zig

convince OpenBSD kernel developers to support an executable obtaining the path to its own binary

if I take my OpenBSD core-developer hat, I would say it will be complex 😃 but I am opened to discuss it

let's me try to explain the problem from kernel point of vue. kernel should only provider information which is accurate, else it could lead to obscure errors or eventually security issues. having a interface (syscall or sysctl entry) to retrieving the pathname of the current running executable which is accurate all the time is really complex:

  • the executable could have several pathname representing it (hard or soft symlinks), and user could be able to see it with one path and not with another
  • the user could be able to run the binary without having read permission on it
  • the file could be renamed, moved (from one directory to another), being unlinked, or replaced
  • a directory compoment of the path could be renamed, moved (directory move), replaced
  • ... so OpenBSD prefers provides no interface instead of an interface which could return errornous result.

Even Linux provides only a partial solution (to my knowledge). For example, zig code source has a comment in zig code saying readlink(2) will return garbage if the file is deleted (and there is no code for such case, even just panic). And others OS implementations have other behaviour in such "ill" cases, like returning the pathname used at execve(2)-time, even if it points on a different file now. it is a easy footgun.

This lead to a second question: for what usage such path is need ? Because getting a pathname is per-se asking for trouble: the pathname could be out-of-date as soon as retrieved even if the kernel takes care of all the possible problems (see TOCTOU).

For citing an example, Rust env:current-exe() has been discussed a bit regarding this kind of problem, and several actions was done:

Regarding zig's standard library, selfExePath() is used for several things. Here all entrypoints resulting possible call to selfExePath() (which could return wrong/racy result):

  • fs.zig : selfExePath()
  • fs.zig : openSelfExe() - on !linux and !windows platforms
  • fs.zig : selfExeDirPath()
  • debug.zig : DebugInfo.getModuleForAddress() (via lookupModuleDl())
  • debug.zig : printSourceAtAddress()
  • debug.zig : dumpStackTraceFromBase(), writeStackTrace(), ...

Which makes me to think that every zig binary could potentially call such racy function to do the complex task of parsing a binary, whereas not all OS provides strong guarantee on the path quality. but I am unsure of the cases where stacktrace is printed (instead of an error return path).

Regarding zig compiler (the binary), it is using exclusively selfExePath():

  • for introspect.findZigLibDirFromSelfExe() - searching for "std.zig" file
  • for reexecuting zig in cmdBuild()

in both cases, the "traditional" way (when an application is source compiled) is to use a path provided at compile-time. but I agree it doesn't work for binary distribution where the installation directory isn't know at compile-time.

if the path returned is wrong, it would mean building a executable with "wrong" std, or code-execution to "wrong" binary. but I agree that such problem is more theorical than pratical.

Now, if I am returning to the original question to have such interface in OpenBSD kernel. I hope to have explained correctly why the kernel should not provide possibly inaccurate pathname. Eventually, an interface which return the descriptor (like for openSelfExe()) could be looked at, but the last time it was discussed there were problem regarding how to provide such descriptor without letting restricted programs to gain too many informations (because if any program could easily read the current executable, it could gain information on possible gadgets and their relatives positions for example).

andrewrk

comment created time in 11 days

delete branch semarie/zig

delete branch : openbsd-minimal

delete time in 11 days

delete branch semarie/zig

delete branch : zlib

delete time in 11 days

delete branch semarie/zig

delete branch : zig-fmt-unwrap-optional

delete time in 11 days

delete branch semarie/zig

delete branch : zig-fmt-revert-dot-init-container-decl

delete time in 11 days

delete branch semarie/zig

delete branch : zig-fmt-pointer-reform-2

delete time in 11 days

delete branch semarie/zig

delete branch : zig-fmt-pointer-reform

delete time in 11 days

delete branch semarie/zig

delete branch : zig-fmt-optional-default

delete time in 11 days

delete branch semarie/zig

delete branch : zig-fmt-error-to-anyerror

delete time in 11 days

delete branch semarie/zig

delete branch : zen_stdlib

delete time in 11 days

delete branch semarie/zig

delete branch : xml

delete time in 11 days

delete branch semarie/zig

delete branch : wyhash-additions

delete time in 11 days

delete branch semarie/zig

delete branch : unzip

delete time in 11 days

delete branch semarie/zig

delete branch : unicode

delete time in 11 days

delete branch semarie/zig

delete branch : std-meta-rebased

delete time in 11 days

delete branch semarie/zig

delete branch : std-meta

delete time in 11 days

delete branch semarie/zig

delete branch : stage2-rework-src

delete time in 11 days

delete branch semarie/zig

delete branch : solve-return-type-problem-fmt

delete time in 11 days

delete branch semarie/zig

delete branch : registers-with-condbr

delete time in 11 days

delete branch semarie/zig

delete branch : null-shrink-fn

delete time in 11 days

delete branch semarie/zig

delete branch : more-stage2-locals

delete time in 11 days

delete branch semarie/zig

delete branch : llvm11

delete time in 11 days

delete branch semarie/zig

delete branch : interface-experiment

delete time in 11 days

delete branch semarie/zig

delete branch : clong_double-fixes

delete time in 11 days

delete branch semarie/zig

delete branch : ast-flatten

delete time in 11 days

delete branch semarie/zig

delete branch : Sahnvour-hashing-update

delete time in 11 days

delete branch semarie/zig

delete branch : DrDeano-master

delete time in 11 days

push eventsemarie/zig

Anthony Arian

commit sha 5e48ed4a8d700c213a8cc71e7e8f0c57be52c70d

Implement WinMain Callers that Pass Valid Params

view details

DixiE

commit sha 68fe3e116d9c4bde67df990b8e0cbb3e70fc98b2

Update Stack Trace For start.zig Changes

view details

Anthony Arian

commit sha 3658dd5e89cd16c011bdc52d334c1308f440157b

Merge branch 'master' of https://github.com/ziglang/zig into 5002-fix-entrypoint-with-winmain

view details

Andrew Kelley

commit sha cd91e17b7384fe857c5cf847b106cd0f98cb4d6a

update LLVM 10 version numbers to 11

view details

Andrew Kelley

commit sha c8ea8cf5df8261995b1e451085e39cd612c9e038

update LLVM C++ API wrappers from llvm 10 to 11

view details

Andrew Kelley

commit sha bd121f3af46bc22a25ac0495e8d83461510c77d4

update clang drivers from llvm 10 to 11

view details

Andrew Kelley

commit sha 2475f653fd53b59a17006e94b7ee6bddbd36268b

stage1: add missing math.h includes

view details

Andrew Kelley

commit sha 41a8b6f57b3bd50b2ed6fdced74fba9130eac3d3

llvm11: link against libClangToolingCore This is needed to successfully link against llvm, clang, and lld 11.

view details

Andrew Kelley

commit sha c6e0df6213af1ecf5734bc6bcb4d7c29a4b41351

Merge remote-tracking branch 'origin/master' into llvm11

view details

Andrew Kelley

commit sha 16513fee6c9c229e40f5abd82220a6f30e8e2180

update C lib/include/ files from clang 10 to 11rc1

view details

Andrew Kelley

commit sha 54b67c20259f697f1e0c4532a5ee7e5d3f01eb1e

libcxx: update from LLVM 10 to 11rc1

view details

Andrew Kelley

commit sha 42da1d385de8559710e04b5a05234f2dd8bb347e

libcxxabi: upgrade from llvm 10 to 11rc1

view details

Andrew Kelley

commit sha 372062b4fe148c17a42ff0938781748ca1dc8328

libunwind: update from LLVM 10 to 11rc1

view details

Andrew Kelley

commit sha 4269868d6a98a9b868827c2fc7e67d2f9b359647

update install files for LLVM 11rc1

view details

Andrew Kelley

commit sha e2b9e2137ee21acaaaee0e58600216ef3c06c86f

update clang command line options data from 10 to 11rc1

view details

Andrew Kelley

commit sha 316b4bde6a118c0742eee0d45137268a1dc99a26

update target CPU features from llvm 10 to 11rc1

view details

Andrew Kelley

commit sha 2139697ce548db8a80cf2999a8196836f2e39aef

zig build: fix addBuildOption for `[]const u8` and `?[]const u8`

view details

Andrew Kelley

commit sha 1de2c647df4758e4250def78068f7e61e638c599

Merge remote-tracking branch 'origin/master' into llvm11

view details

Andrew Kelley

commit sha 3aeeb21b82915a3d03e75a88ded93049a5c1730c

update libunwind to llvm11rc2

view details

Andrew Kelley

commit sha f9bd049c89e4d2b4d3f51a937ec2114c3cac9176

Merge remote-tracking branch 'origin/master' into llvm11

view details

push time in 11 days

pull request commentrust-lang/libc

move clock_nanosleep to src/unix/mod.rs

Please note that OpenBSD doesn't support `clock_nanosleep'. For others BSD, I dunno.

maxbla

comment created time in 14 days

push eventsemarie/zig

Sébastien Marie

commit sha a6dc2b7fcc2e1e73130eb0e762cac4ab884d20c2

openbsd: selfExePath adjustements

view details

Sébastien Marie

commit sha 161eb4a000923c28d152781dcc8a080905c7ad32

initialize std.os.argv in stage1 compiler. it is needed for selfExePath under OpenBSD

view details

push time in 18 days

push eventsemarie/zig

Sébastien Marie

commit sha 4c4211ea8e7c553c78ed25f52b60000f1f066503

merge netbsd and openbsd cases

view details

push time in 18 days

push eventsemarie/zig

Sébastien Marie

commit sha 9ff51f22b46d083dbd80e427a00a7f392c467f83

openbsd: address link/Elf.zig comments - restore correct behaviour on Android target for appending "crtend_android.o" - some nits

view details

push time in 18 days

Pull request review commentziglang/zig

add minimal openbsd support

 fn linkWithLLD(self: *Elf, comp: *Compilation) !void {      // crt end     if (link_in_crt) {-        if (target.isAndroid()) {-            try argv.append(try comp.get_libc_crt_file(arena, "crtend_android.o"));-        } else if (target_util.libc_needs_crti_crtn(target)) {-            try argv.append(try comp.get_libc_crt_file(arena, "crtn.o"));+        if (target_util.libc_needs_crti_crtn(target)) {

ah, I think I found why: they needs "crtend_android.o" but no crt at beginning

semarie

comment created time in 18 days

PullRequestReviewEvent

Pull request review commentziglang/zig

add minimal openbsd support

 fn linkWithLLD(self: *Elf, comp: *Compilation) !void {      // crt end     if (link_in_crt) {-        if (target.isAndroid()) {-            try argv.append(try comp.get_libc_crt_file(arena, "crtend_android.o"));-        } else if (target_util.libc_needs_crti_crtn(target)) {-            try argv.append(try comp.get_libc_crt_file(arena, "crtn.o"));+        if (target_util.libc_needs_crti_crtn(target)) {

I wonder why Android targets return false here, as they add a crtend_android.o file... but for now, I will just change the if condition

semarie

comment created time in 18 days

PullRequestReviewEvent

push eventsemarie/zig

Sébastien Marie

commit sha f33a610c84313255477cc04d930b02ad984118ae

add minimal openbsd support

view details

Sébastien Marie

commit sha 78a7543056112a1df8951712a746b9adb59787af

openbsd: use mem.span() + mem.indexOf() instead of defining custom function

view details

Sébastien Marie

commit sha 97ec9fdd7929880699179f5024b8bb93ac424ee2

opensd: selfExePath: do not rely on environment as it could be inherited

view details

push time in 18 days

push eventsemarie/zig

Jakub Konka

commit sha f0a73df8e72e156bd95fa6c7f4de9512513d01b3

Add prototype for export trie generation in MachO linker Signed-off-by: Jakub Konka <kubkon@jakubkonka.com>

view details

Jakub Konka

commit sha e76fb8d8c82ffc9fdeef2de0a6008c756103811b

Add incomplete writing of trie to bytes buffer Signed-off-by: Jakub Konka <kubkon@jakubkonka.com>

view details

Jakub Konka

commit sha b13b36a71d63b6dfe4beda940fa6f9488fb3690a

Approach using array list for auto mem mgmt Signed-off-by: Jakub Konka <kubkon@jakubkonka.com>

view details

Jakub Konka

commit sha bdab4f53c1fa614fcd89468f305184fa36520039

Move trie structure into its own file-module Signed-off-by: Jakub Konka <kubkon@jakubkonka.com>

view details

Jakub Konka

commit sha b5b25d38a8fa4e66e54ff1279c1becee877793f6

Fix improper reuse of global symbols in MachO Signed-off-by: Jakub Konka <kubkon@jakubkonka.com>

view details

Jakub Konka

commit sha ea44d12d1be8eb17a1555f6ab794621da0212171

Add writeULEB128Mem test and couple fixes Signed-off-by: Jakub Konka <kubkon@jakubkonka.com>

view details

Jakub Konka

commit sha 5f86505cf79a0ce75e1a02602ae0e9c845024982

Fix ULEB128 encoding of trie Use algorithm described in official Apple `ld64` implementation. Link: https://opensource.apple.com/source/ld64/ld64-123.2.1/src/abstraction/MachOTrie.hpp Signed-off-by: Jakub Konka <kubkon@jakubkonka.com>

view details

Jakub Konka

commit sha ba41e599bfaff2c614c4edfbe5c7ffe94b437486

Clean up writing the trie into ULEB128 byte stream Prealloc as much as possible to improve alloc performance. Signed-off-by: Jakub Konka <kubkon@jakubkonka.com>

view details

Jakub Konka

commit sha 8dc40236153e7c7d1b8378a117d8453e3b262933

Apply nitpick: top-level doc comments Signed-off-by: Jakub Konka <kubkon@jakubkonka.com>

view details

Jakub Konka

commit sha 04b0ffdd13e32be0ef5cc84983f8bb830db7520f

Merge pull request #6577 from kubkon/macho-trie stage2: add export trie generation in MachO linker

view details

mlarouche

commit sha 57912964af0247a7aa940f76d09a8994d8fe1ec8

Use regular file for caching stage 1 hash digest instead of symlink, fix zig build caching on Windows Fix #6500

view details

Andrew Kelley

commit sha 9f8f4464353460825856b848dfe2480de20d8d55

fixups to previous commit * std.fs.Dir.readFile: add doc comments to explain what it means when the returned slice has the same length as the supplied buffer. * introduce readSmallFile / writeSmallFile to abstract over the decision to use symlink or file contents to store data.

view details

Andrew Kelley

commit sha fbc6a00b0a939f8752bbd571284c46ab58a8fcc4

Merge branch 'mlarouche-Fix_6500'

view details

LemonBoy

commit sha a31b70c4b8d0bed67463b2f54e74198baa93329f

std: Add/Fix/Change parts of big.int * Add an optimized squaring routine under the `sqr` name. Algorithms for squaring bigger numbers efficiently will come in a PR later. * Fix a bug where a multiplication was done twice if the threshold for the use of Karatsuba algorithm was crossed. Add a test to make sure this won't happen again. * Streamline `pow` method, take a `Const` parameter. * Minor tweaks to `pow`, avoid bit-reversing the exponent.

view details

Jakub Konka

commit sha 53c63bdb73d9fbc5a54afb4977bb975b03c4c9cc

Update WASI preopens doc section to use GPA Signed-off-by: Jakub Konka <kubkon@jakubkonka.com>

view details

push time in 18 days

push eventsemarie/zig

Sébastien Marie

commit sha 2e57c3802a0a3de58747c9547ebae87dd493cb59

opensd: selfExePath: do not rely on environment as it could be inherited

view details

push time in 18 days

Pull request review commentziglang/zig

add minimal openbsd support

 pub fn selfExePath(out_buffer: []u8) SelfExePathError![]u8 {             // TODO could this slice from 0 to out_len instead?             return mem.spanZ(@ptrCast([*:0]u8, out_buffer));         },+        .openbsd => {+            // OpenBSD doesn't support getting the path of a running process, so try to guess it+            if (os.argv.len >= 1) {+                if (str_containsZ(os.argv[0], '/')) {+                    // argv[0] is a path (relative or absolute): use realpath(3) directly+                    var real_path_buf: [MAX_PATH_BYTES]u8 = undefined;+                    const real_path = try os.realpathZ(os.argv[0], &real_path_buf);+                    if (real_path.len > out_buffer.len)+                        return error.NameTooLong;+                    mem.copy(u8, out_buffer, real_path);+                    return out_buffer[0..real_path.len];++                } else if (os.argv[0][0] != '\x00') {+                    // argv[0] is not empty (and not a path): search it inside PATH+                    const paths = std.os.getenv("PATH") orelse "";+                    var path_it = mem.split(paths, ":");+                    while (path_it.next()) |a_path| {+                        var resolved_path_buf: [MAX_PATH_BYTES:0]u8 = undefined;+                        const resolved_path = std.fmt.bufPrint(&resolved_path_buf, "{}/{}\x00", .{+                            a_path,+                            os.argv[0],+                        }) catch "";++                        var real_path_buf: [MAX_PATH_BYTES:0]u8 = undefined;+                        if (os.realpathZ(&resolved_path_buf, &real_path_buf) catch null) |real_path| {

POSIX realpath(3) requires the buffer to have at least MAX_PATH len (MAX_PATH_BYTES constant with zig). out_buffer could be shorter and lead to buffer overflow.

it is possible to check the size of out_buffer and use it if it satisfies realpath(3) requirement, but it will complexify a bit the code

semarie

comment created time in 18 days

PullRequestReviewEvent

push eventsemarie/zig

Sébastien Marie

commit sha fe13eb7221a2c20b57a4e5dce90d5efc9928d0a6

openbsd: use mem.span() + mem.indexOf() instead of defining custom function

view details

push time in 18 days

PR opened ziglang/zig

add minimal openbsd support

this commit adds a minimal OpenBSD support. Minimal in sens it isn't 100% functional for now, but it will push some important bits upstream.

for now, missing parts is mostly a proper linkage with system libraries (libc++, libc++abi, libpthread).

the implementation for selfExePathAlloc() is also suboptimal, but OpenBSD do not provide any facility to get the path of the running executable.

we few additional changes (to force linkage), I am able to compile and run a stage2 zig binary.

+2268 -42

0 comment

23 changed files

pr created time in 19 days

create barnchsemarie/zig

branch : openbsd-minimal

created branch time in 19 days

push eventsemarie/zig

Sébastien Marie

commit sha 498df637670f90013d2fe60be682920acc10c063

openbsd: try a more complete selfExePath implementation but I am not very satisfied by it

view details

Sébastien Marie

commit sha b6eb6f8cd629863515ff466f769a0850e3c7235e

openbsd: walk argv0 only once

view details

Sébastien Marie

commit sha 80c2e47129321bfe4d9cc7b0c82c3cdb44b8b034

openbsd: use DlDynlib

view details

Sébastien Marie

commit sha e90e805fcfa97003a491e5b254522e4d171b3313

openbsd: we do PIE by default

view details

Sébastien Marie

commit sha c8df4d9d7fa0316d349183869d17d1ea01f387f1

backout 08a81b96e25c589f658f7ddd3a5474a0c4e2f697: the linked binary do not run (uncaught exception with cxa default handlers)

view details

push time in 19 days

push eventsemarie/rust-ports

Sebastien Marie

commit sha f7e2bcf4298bf038b432fe8c0c8e9073806f9ad8

1.47.0: update i386 bootstrap + add static libz

view details

Sébastien Marie

commit sha e38a0abe96c71a2402cf5e9877209dd06cf7b4c0

1.47.0: update aarch64 bootstrap

view details

push time in 19 days

push eventsemarie/zig

Sébastien Marie

commit sha 08a81b96e25c589f658f7ddd3a5474a0c4e2f697

openbsd: explicitly link with c++, c++abi, pthread for zig binary only

view details

push time in 20 days

push eventsemarie/zig

LemonBoy

commit sha 0f248e0988b24bf4fcdaadd0e47127462206711e

std: Make file copy ops use zero-copy mechanisms Use copy_file_range on Linux (if available), fcopyfile on Darwin, sendfile on *BSDs (and on Linux kernels without copy_file_range).

view details

LemonBoy

commit sha 8b4f5f039df65980d0a0ec6add1caf4c9bf2468c

Alternative strategy to avoid calling stat() This is an optimization as it avoids an extra syscall, but it's also a workaround for fstat being not available on Windows.

view details

LemonBoy

commit sha a419a1aabce63fedcc77a1118d596864fcff46e3

Move copy_file to fs namespace Now it is a private API. Also handle short writes in copy_file_range fallback implementation.

view details

LemonBoy

commit sha 1f7ec0de706eded887bc8dbcf5f45a5546d1be5c

Address review comments & fix compilation errors

view details

LemonBoy

commit sha 03762da2af8753ecf7f4bc2005dd00d570c51ae7

New review round

view details

Tadeo Kondrak

commit sha 0e57f220fb71efefa9c6246818758d9c30994f73

stage1: Disallow arrays in function parameters or return types Closes #6535.

view details

Tadeo Kondrak

commit sha 83eda214882e33e65794cee1e7c0d87777b31bf4

zig_clang/translate_c: Use opaque declarations in Zig

view details

Frank Denis

commit sha f39dc00ed467dd34999f71adf560b71383755a80

std/crypto/aes: add AES hardware acceleration on aarch64

view details

Frank Denis

commit sha 60d1e675d2b9c45c88fc01790205a64db6a43627

aes/aesni is not based on a Go implementation, only aes/soft is Don't blame them for our bugs :)

view details

Frank Denis

commit sha 1bc2b68916a193975af8d8f4d648a8df9bdb5593

ghash: add pmull support on aarch64

view details

Andrew Kelley

commit sha b02341d6f58e0b8a87fc2ab589dcfd85e5dc96cd

Merge pull request #6614 from jedisct1/aes-arm std/crypto/aes: add AES hardware acceleration on aarch64

view details

Andrew Kelley

commit sha 76a195473dac059a842fed2a6ba581ca99947d2b

Merge pull request #6516 from LemonBoy/fastfilecopy std: Make file copy ops use zero-copy mechanisms

view details

Andrew Kelley

commit sha a4828f6d0f94039473aa3ac53e122037d2d6a2d3

std.c (darwin) update to new opaque syntax This was an undetected conflict between 76a195473dac059a842fed2a6ba581ca99947d2b and 95a37373e9f576854956c2909cc128b5b6388ec6

view details

Andrew Kelley

commit sha 1951ecb228d5eb9956ef4487e20be03d87a2153d

add a code of conduct this has always been the rules, they are just written down now. also link to ziglearn.org in the readme

view details

Josh Wolfe

commit sha bc6904eccc53da5b4de0728c8b52e6d0e9ed522e

include compiler_rt and c for wasm static libraries

view details

Sébastien Marie

commit sha 8be2d82d5becfe0bc333887add16a0e06ed3b60c

initial openbsd support (build stage0 and stage1)

view details

Sébastien Marie

commit sha 5dbdac04d8a768b05f54c96c0f9b7a78543b8d1f

selfExePath: return the buffer with the right size

view details

Sébastien Marie

commit sha 9e9c379e7111ac630b7d63d84935e3986b4e01f8

properly link crt for openbsd

view details

Sébastien Marie

commit sha f357818c5f595c70efd2fdd5b3d68a82062e62f3

correct dirent struct

view details

Sébastien Marie

commit sha ece58de536eed132bda655dd253a6dfc4cbc20df

openbsd: linking zig (stage2) needs c++abi,c++,pthread - to revisit later

view details

push time in 20 days

push eventsemarie/zig

LemonBoy

commit sha 0f248e0988b24bf4fcdaadd0e47127462206711e

std: Make file copy ops use zero-copy mechanisms Use copy_file_range on Linux (if available), fcopyfile on Darwin, sendfile on *BSDs (and on Linux kernels without copy_file_range).

view details

LemonBoy

commit sha 8b4f5f039df65980d0a0ec6add1caf4c9bf2468c

Alternative strategy to avoid calling stat() This is an optimization as it avoids an extra syscall, but it's also a workaround for fstat being not available on Windows.

view details

LemonBoy

commit sha a419a1aabce63fedcc77a1118d596864fcff46e3

Move copy_file to fs namespace Now it is a private API. Also handle short writes in copy_file_range fallback implementation.

view details

LemonBoy

commit sha 1f7ec0de706eded887bc8dbcf5f45a5546d1be5c

Address review comments & fix compilation errors

view details

LemonBoy

commit sha 03762da2af8753ecf7f4bc2005dd00d570c51ae7

New review round

view details

Tadeo Kondrak

commit sha 0e57f220fb71efefa9c6246818758d9c30994f73

stage1: Disallow arrays in function parameters or return types Closes #6535.

view details

Tadeo Kondrak

commit sha 83eda214882e33e65794cee1e7c0d87777b31bf4

zig_clang/translate_c: Use opaque declarations in Zig

view details

Frank Denis

commit sha f39dc00ed467dd34999f71adf560b71383755a80

std/crypto/aes: add AES hardware acceleration on aarch64

view details

Frank Denis

commit sha 60d1e675d2b9c45c88fc01790205a64db6a43627

aes/aesni is not based on a Go implementation, only aes/soft is Don't blame them for our bugs :)

view details

Frank Denis

commit sha 1bc2b68916a193975af8d8f4d648a8df9bdb5593

ghash: add pmull support on aarch64

view details

Andrew Kelley

commit sha b02341d6f58e0b8a87fc2ab589dcfd85e5dc96cd

Merge pull request #6614 from jedisct1/aes-arm std/crypto/aes: add AES hardware acceleration on aarch64

view details

Andrew Kelley

commit sha 76a195473dac059a842fed2a6ba581ca99947d2b

Merge pull request #6516 from LemonBoy/fastfilecopy std: Make file copy ops use zero-copy mechanisms

view details

Andrew Kelley

commit sha a4828f6d0f94039473aa3ac53e122037d2d6a2d3

std.c (darwin) update to new opaque syntax This was an undetected conflict between 76a195473dac059a842fed2a6ba581ca99947d2b and 95a37373e9f576854956c2909cc128b5b6388ec6

view details

Andrew Kelley

commit sha 1951ecb228d5eb9956ef4487e20be03d87a2153d

add a code of conduct this has always been the rules, they are just written down now. also link to ziglearn.org in the readme

view details

Josh Wolfe

commit sha bc6904eccc53da5b4de0728c8b52e6d0e9ed522e

include compiler_rt and c for wasm static libraries

view details

push time in 20 days

issue commentziglang/zig

Tier 3 OpenBSD Support for x86_64

FYI I started a port of zig for OpenBSD : https://github.com/semarie/zig/tree/openbsd it is based on LLVM version from ports (full llvm-10), and I am able to build a stage2 zig compiler.

some work is still need:

  • linkage (to build zig compiler I had to explicitly pass c++ libraries)
  • proper selfExePath implementation (OpenBSD doesn't provide such facility at all)
  • linkage errors will running test-behavior
  • etc...
andrewrk

comment created time in 20 days

push eventsemarie/zig

Sébastien Marie

commit sha c622a295dadee6f71ec74517710abb3ceb23183f

openbsd: a bit better selfExePath implementation

view details

push time in 20 days

push eventsemarie/zig

Sébastien Marie

commit sha 18a0881533ee427e156b8fde8faca61f9f81ccb5

properly link crt for openbsd

view details

Sébastien Marie

commit sha 74b20ebce227e5a6ceca308faee5c76aa96a7ac1

correct dirent struct

view details

Sébastien Marie

commit sha 00c8d19470f5102109f957b34f95f8fb6f8804a9

openbsd: linking zig (stage2) needs c++abi,c++,pthread - to revisit later

view details

push time in 20 days

push eventsemarie/zig

Sébastien Marie

commit sha c1c73e9f012e647f9e93923ffca569078a2ee3e7

selfExePath: return the buffer with the right size

view details

push time in 21 days

create barnchsemarie/zig

branch : openbsd

created branch time in 21 days

fork semarie/zig

General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.

https://ziglang.org

fork in 21 days

push eventsemarie/rust-ports

Sébastien Marie

commit sha 14cd293db15c12b114fb9ff9b852dc4bd3304266

1.47.0: update sparc64 bootstrap

view details

push time in 21 days

push eventsemarie/rust-ports

Sébastien Marie

commit sha 9227f42d3d265070048e1811ec0a54cbb672be4e

1.47.0: update amd64 bootstrap

view details

push time in 21 days

push eventsemarie/rust-ports

Sébastien Marie

commit sha 49b0fa19f4a066da157ad6a308a9170fe9718da2

1.47.0: upstream rerolled the tarball

view details

push time in 22 days

push eventsemarie/rust-ports

Sébastien Marie

commit sha 938de9feab69741f727eff3c917fe8c231abb9e7

1.47.0: update distinfo + patches + plist

view details

push time in 22 days

delete branch semarie/luakit

delete branch : session-rm

delete time in a month

pull request commentluakit/luakit

use os.remove() instead of luakit.spawn("rm %q")

I wonder if there is any particular reason for having a spawn("rm %q") instead of simply use os.remove().

I am looking to enable some sandbox facility using unveil(2) syscall on OpenBSD.

semarie

comment created time in a month

PR opened luakit/luakit

use os.remove() instead of luakit.spawn("rm %q")

in session.lua, use os.remove() instead of luakit.spawn("rm %q")

+2 -6

0 comment

1 changed file

pr created time in a month

create barnchsemarie/luakit

branch : session-rm

created branch time in a month

fork semarie/luakit

Fast, small, webkit based browser framework extensible by Lua.

https://luakit.github.io/

fork in a month

delete branch semarie/minetest

delete branch : thread-kill-private

delete time in 2 months

pull request commentrust-lang/rust

Only copy LLVM into rust-dev with internal LLVM

does it make sens to even build it for external llvm ? the tarball will be almost empty. But maybe it will be extended later ?

LlvmTools uses the following:

        /* run only if llvm-config isn't used */
        if let Some(config) = builder.config.target_config.get(&target) {
            if let Some(ref _s) = config.llvm_config {
                builder.info(&format!("Skipping LlvmTools ({}): external LLVM", target));
                return None;
            }
        }
Mark-Simulacrum

comment created time in 2 months

issue openedrust-lang/rust

rust-dev doesn't support building with external llvm

When building rustc-nightly (e2be5f568d1f60365b825530f5b5cb722460591b here), the build error inside RustDev Target with:

> RustDev { target: TargetSelection { triple: "x86_64-unknown-openbsd", file: None } }
Dist RustDev (x86_64-unknown-openbsd)
thread 'main' panicked at 'Error: File "/data/semarie/build-rust/build_dir/build/x86_64-unknown-openbsd/llvm/bin/llvm-config" not found!', src/bootstrap/lib.rs:1273:17
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
        finished in 0.205

The build is done with the following config.toml:

[build]
rustc = "/data/semarie/build-rust/install_dir/beta/bin/rustc"
cargo = "/data/semarie/build-rust/install_dir/beta/bin/cargo"
rustfmt = "/data/semarie/build-rust/install_dir/beta/bin/rustfmt"
python = "/usr/local/bin/python3"
gdb = "/usr/local/bin/egdb"
#docs = false
vendor = true
extended = true
verbose = 1

[install]
prefix = "/data/semarie/build-rust/install_dir/nightly"

[dist]
src-tarball = false

[rust]
channel = "nightly"
codegen-tests = false
verbose-tests = true

[target.x86_64-unknown-openbsd]
llvm-config = "/usr/local/bin/llvm-config"

[llvm]
static-libstdcpp = false
ninja = true

Please note that llvm is system wide installed.

I am a bit unsure about the exact purpose of RustDev. but it seems to me that it should be not build if llvm is external ?

Cc: @Mark-Simulacrum

created time in 2 months

push eventsemarie/sao-dependencies

Sébastien Marie

commit sha 1b6c03f858c77239ad5d2096b1918185334efa41

use npx instead of hardcoding grunt path

view details

Sebastien Marie

commit sha e3297f9e3e4a0a31ec64e27f66144233c22a4064

remove grunt less (error), document grunt tasks, make a link for dist/tryton-sao.min.css

view details

push time in 2 months

pull request commentminetest/minetest

Remove Thread::kill() and related unittest

I removed the assigments done after killing the thread, but keep the one before (m_running = false), as in !_WIN32 case, the code will call wait() function, and there is an assert on m_running.

semarie

comment created time in 2 months

push eventsemarie/minetest

Sébastien Marie

commit sha 4bbb6a9e362bb5529a129736c3288e02d36e3ea8

remove dead assignements

view details

push time in 2 months

push eventsemarie/minetest

Pierre-Yves Rollo

commit sha 71287894adbf3cbe092ded1cbf02755678305afb

Fix missing translation call in hypertext (#10296)

view details

Sebastien Marie

commit sha 9c7340104a7ec4007e3dfe0bb4482f3c8f9878e0

Define environ variable on OpenBSD (#10302)

view details

DS

commit sha 98faeac5a7b382e5d7ce0474bf7d52fc5975a23c

Load media from subfolders (#9065)

view details

David CARLIER

commit sha cf5547227d9fffd9fb0043ce0b5633b831536eb6

Complete Haiku platform support. (#10311) Fixing linkage/libraries missing issue. Implements missing platform specifics.

view details

BenjaminRi

commit sha f5a203fbcd3af358bc1639467014063ba8409d3e

Fix light overflow of u8 if light is saturated at 255 (#10305)

view details

Vincent Robinson

commit sha 47948793c16fc293c1d6b4ccee05421bc0864360

Auto focus on OK button in main menu error messages (#10300)

view details

adrido

commit sha 3c2890692bb4c292023a8260cf9ce70f82b2e780

Fix MSVC compiler warnings (#10197)

view details

EvidenceB

commit sha 287f3fb2e3317bb6bd6d8608f1aa051c601aeca4

Avoid drawing clipped out formspec elements (#10095)

view details

Kezi

commit sha 3e5bce2251deb8e5fcbaa266431f8c0f10078bf2

darken tabheader background color (#10299)

view details

Desour

commit sha f27cf4777933f06f85fa2f013d56ca0a2cf1d588

Properly handle mod-errors in on_shutdown

view details

mntmn

commit sha 44c98089cf923fda924902bceec4edb01f36ce2c

shaders: Fix transparency on GC7000L (#10036) Workaround for the missing GL_ALPHA_TEST implementation in Mesa (etnaviv driver).

view details

David CARLIER

commit sha b262184acf34896f36b4270aba29546fc5b0e65b

NetBSD build fix proposal. (#10308) Fixing thread naming call and let the class setting RANDOM_MIN/RANDOM_MAX.

view details

Maksim

commit sha 788f29759565f1eb35fb2189a79a6b2a41e1eb73

Android: drop simple MainMenu (#10227) The default (PC-style) MainMenu works great on Android. Provides access to ContentDB and allows players to create many worlds in a few clicks. Makes the interface consistent and eliminates player confusion.

view details

karamel59

commit sha d052593c7ab3c57f83ea250fc10f7c1927962c09

Lua API: Register missing get_texture_mod function (#10338)

view details

karamel59

commit sha 1eaff3dfa4091c638be7a1e9777d35b5f665972c

Improve set_texture_mod documentation (#10339) Properly documents the select_x_by_camera values

view details

DS

commit sha 454009a7f2a798dfa70d881a3c9811f7e29481f7

Fix luacheck warnings in builtin/common/tests (#10322)

view details

SmallJoker

commit sha d28f1b01707dfa15e770096a26495452513bc56f

Mapgen: Fix on-by-default flags broken since eca6ee9 (#10318)

view details

Lars Müller

commit sha 3693b6871eba268ecc79b3f52d00d3cefe761131

Prevent players accessing inventories of other players (#10341)

view details

Hugues Ross

commit sha 9976f36b18b8d227e3240feb24000dda0916ee44

Make bgcolor tint button background images (#9818)

view details

DS

commit sha 28e87ce9d5fdf163c1eb0daf83279e949f84765d

Add vector.offset (#10321)

view details

push time in 2 months

pull request commentminetest/minetest

remove Thread::kill()

as you are in destructor, you can drop all asignment there because after destructor we won't read them :D

I was more concerned by concurrent access than about what can happens after destructor.

I don't know enough C++ to be sure that if the destructor is called it means really nothing has reference on it and could race with the code inside the destructor. So I was conservative.

semarie

comment created time in 2 months

pull request commentminetest/minetest

make Thread::kill() private

It should require a BSD to test.

The testThreadKill tested that a Thread could be killed and restarted safely (something not used in minetest). But it was relying on undefined behaviour for that: the fact that a random thread could unlock a mutex hold by a cancelled thread (something forbidden on BSD, but allowed with glibc on Linux).

Now that the kill() method is merged in the destructor, it is explicit that a Thread is killed only in the destructor: the thread couldn't be reused.

semarie

comment created time in 2 months

delete branch semarie/minetest

delete branch : stable-5

delete time in 2 months

delete branch semarie/minetest

delete branch : stable-0.4

delete time in 2 months

delete branch semarie/minetest

delete branch : stable-0.3

delete time in 2 months

delete branch semarie/minetest

delete branch : stable-0.2

delete time in 2 months

push eventsemarie/minetest

Sébastien Marie

commit sha b55c301400457f51ab9a88677f4639c4cb1b02c8

properly remove kill()

view details

push time in 2 months

push eventsemarie/minetest

David CARLIER

commit sha cf5547227d9fffd9fb0043ce0b5633b831536eb6

Complete Haiku platform support. (#10311) Fixing linkage/libraries missing issue. Implements missing platform specifics.

view details

BenjaminRi

commit sha f5a203fbcd3af358bc1639467014063ba8409d3e

Fix light overflow of u8 if light is saturated at 255 (#10305)

view details

Vincent Robinson

commit sha 47948793c16fc293c1d6b4ccee05421bc0864360

Auto focus on OK button in main menu error messages (#10300)

view details

adrido

commit sha 3c2890692bb4c292023a8260cf9ce70f82b2e780

Fix MSVC compiler warnings (#10197)

view details

EvidenceB

commit sha 287f3fb2e3317bb6bd6d8608f1aa051c601aeca4

Avoid drawing clipped out formspec elements (#10095)

view details

Kezi

commit sha 3e5bce2251deb8e5fcbaa266431f8c0f10078bf2

darken tabheader background color (#10299)

view details

Desour

commit sha f27cf4777933f06f85fa2f013d56ca0a2cf1d588

Properly handle mod-errors in on_shutdown

view details

mntmn

commit sha 44c98089cf923fda924902bceec4edb01f36ce2c

shaders: Fix transparency on GC7000L (#10036) Workaround for the missing GL_ALPHA_TEST implementation in Mesa (etnaviv driver).

view details

David CARLIER

commit sha b262184acf34896f36b4270aba29546fc5b0e65b

NetBSD build fix proposal. (#10308) Fixing thread naming call and let the class setting RANDOM_MIN/RANDOM_MAX.

view details

Maksim

commit sha 788f29759565f1eb35fb2189a79a6b2a41e1eb73

Android: drop simple MainMenu (#10227) The default (PC-style) MainMenu works great on Android. Provides access to ContentDB and allows players to create many worlds in a few clicks. Makes the interface consistent and eliminates player confusion.

view details

karamel59

commit sha d052593c7ab3c57f83ea250fc10f7c1927962c09

Lua API: Register missing get_texture_mod function (#10338)

view details

karamel59

commit sha 1eaff3dfa4091c638be7a1e9777d35b5f665972c

Improve set_texture_mod documentation (#10339) Properly documents the select_x_by_camera values

view details

DS

commit sha 454009a7f2a798dfa70d881a3c9811f7e29481f7

Fix luacheck warnings in builtin/common/tests (#10322)

view details

SmallJoker

commit sha d28f1b01707dfa15e770096a26495452513bc56f

Mapgen: Fix on-by-default flags broken since eca6ee9 (#10318)

view details

Lars Müller

commit sha 3693b6871eba268ecc79b3f52d00d3cefe761131

Prevent players accessing inventories of other players (#10341)

view details

Hugues Ross

commit sha 9976f36b18b8d227e3240feb24000dda0916ee44

Make bgcolor tint button background images (#9818)

view details

DS

commit sha 28e87ce9d5fdf163c1eb0daf83279e949f84765d

Add vector.offset (#10321)

view details

HybridDog

commit sha 386d5f778a299cc0d891eb476674f3eddb108376

Document normalmap textures (#10096)

view details

EvidenceB

commit sha 5c4b560b6812bbdf7a9d3202c95bad5c9df97d66

Add compass HUD element (#9312) Co-authored-by: Jean-Patrick Guerrero <jeanpatrick.guerrero@gmail.com> Co-authored-by: Pierre-Yves Rollo <dev@pyrollo.com> Co-authored-by: SmallJoker <SmallJoker@users.noreply.github.com>

view details

LoneWolfHT

commit sha c18dbadcb898db6d1f68b72afec56c599af317ec

Fix dropped craftitems/tools not using light_source values (#9438)

view details

push time in 2 months

pull request commentminetest/minetest

make Thread::kill() private

I will look to merge the kill() method inside the destructor

semarie

comment created time in 2 months

push eventsemarie/rust-ports

Sébastien Marie

commit sha f440d06e41fea6dea75495030c72eefb14503471

cvs sync

view details

push time in 2 months

push eventsemarie/rust-ports

Sébastien Marie

commit sha 42d0594f92c294d48c263e82655cd78f00001bcc

1.46.0: aarch64 bootstrap

view details

push time in 2 months

push eventsemarie/rust-ports

Sebastien Marie

commit sha c13ef02fae2290dc09e86fe1f2915b49d0f8bd7d

1.46.0: i386 bootstrap

view details

Sébastien Marie

commit sha 74a5125a64938abc4f50eba2b7fbaac988b2192e

1.46.0: sparc64 bootstrap

view details

push time in 2 months

push eventsemarie/rust-ports

Sébastien Marie

commit sha a30784994e079924ea5f1ccb0a8fedfb04337a01

1.46.0: amd64 bootstrap

view details

push time in 2 months

push eventsemarie/rust-ports

Sébastien Marie

commit sha 2ebd45001803bb24581b842293cfacf6b9e4755f

1.46.0: update distinfo + patches + plist

view details

push time in 2 months

PR opened minetest/minetest

make Thread::kill() private

The Thread kill() method isn't used outside testThreadKill unit test and Thread destructor. It could be make private.

The testThreadKill test should be removed: it tests the kill() feature in a way minetest doesn't use it (kill and restart a thread), specially because some pthreads implementations on BSD will not allow to lock again the m_start_finished_mutex which is hold when the thread is killed.

Closes: #6065

This PR is Ready for Review.

Eventually, the Thread::kill() method could be merged inside Thread::~Thread()

+8 -33

0 comment

2 changed files

pr created time in 2 months

create barnchsemarie/minetest

branch : thread-kill-private

created branch time in 2 months

issue commentminetest/minetest

mutex unlock issue

Here my understanding of the problem:

  • main thread is creating a "SimpleTest" thread and start it
  • the "SimpleTest" thread lock m_start_finished_mutex (in Thread::threadProc) and sleep
  • the main thread kills "SimpleTest" thread
    • the m_start_finished_mutex mutex is still locked, and the owner is still set to "SimpleTest" pthread_t
  • the main thread starts the "SimpleTest" thread a second time
    • the m_start_finished_mutex mutex is try_lock by the main thread
    • the mutex is already locked (and owner is "SimpleTest" pthread_t), so try_lock continues
    • a std::thread(threadProc, this) is created
    • the main thread tries to unlock m_start_finished_mutex
      • the pthread code raise an abort because the mutex is lock by "SimpleTest" thread and it is the main thread which tries to unlock it

So the problem isn't unlocking a unlocked mutex, but unlocking a mutex locked by someone else.

stormchaser3000

comment created time in 2 months

issue commentminetest/minetest

mutex unlock issue

please note that the default mutex type is PTHREAD_MUTEX_DEFAULT which stand for PTHREAD_MUTEX_STRICT_NP (aka "strict error checking")

stormchaser3000

comment created time in 2 months

more