~yerinalexey

Russia (UTC+3)

TODO


#880 unix::signal: accessing siginfo segfaults on FreeBSD 24 days ago

Comment by ~yerinalexey on ~sircmpwn/hare

Oops, turns out you need to pass SA_SIGINFO to get a valid siginfo pointer. The real solution is to warn about this somewhere in the documentation, as well as providing flag::SIGINFO.

REPORTED RESOLVED NOT_OUR_BUG

#880 unix::signal: accessing siginfo segfaults on FreeBSD 24 days ago

bug added by ~yerinalexey on ~sircmpwn/hare

#880 unix::signal: accessing siginfo segfaults on FreeBSD 24 days ago

freebsd added by ~yerinalexey on ~sircmpwn/hare

#880 unix::signal: accessing siginfo segfaults on FreeBSD 24 days ago

Ticket created by ~yerinalexey on ~sircmpwn/hare

Looks like the second parameter to the signal handler is null.

use unix::signal;
use rt;
use fmt;

fn handle(sig: signal::sig, info: *signal::siginfo, uctx: *opaque) void = {
	fmt::printfln("signal={} errno={} code={}",
		signal::signame(sig), rt::strerror(info.errno), info.code: int)!;
	abort();
};

export fn main() void = {
	signal::handle(signal::sig::FPE, &handle);

	fmt::println(1 / 0)!;
};
Process 988 stopped
* thread 1, name = 'b', stop reason = signal SIGFPE: integer divide by zero
    frame 0: 0x00000000080181c2 b`main at sigtest.ha:15
   12  	export fn main() void = {
   13  		signal::handle(signal::sig::FPE, &handle);
   14  	
-> 15  		fmt::println(1 / 0)!;
   16  	};
Process 988 resuming
Process 988 stopped
* thread 1, name = 'b', stop reason = signal SIGSEGV: invalid address (fault address: 0x6)
    frame 0: 0x00000000080182ca b`handle at sigtest.ha:7
   4   	
   5   	fn handle(sig: signal::sig, info: *signal::siginfo, uctx: *opaque) void = {
   6   		fmt::printfln("signal={} errno={} code={}",
-> 7   			signal::signame(sig), rt::strerror(info.errno),
   8   			info.code: int)!;
   9   		abort();
   10  	};

#807 allow using static assert/abort in global context a month ago

Comment by ~yerinalexey on ~sircmpwn/hare

Sebastian referenced this ticket in commit 8ec5041.

#868 Function pointers are not assignable to pointers to aliases of functions within tagged unions a month ago

Ticket created by ~yerinalexey on ~sircmpwn/hare

type some_func = fn() void;
type t = (*some_func | int);

export fn main() void = {
	func(&empty);
};

fn func(v: t) void = void;
fn empty() void = void;

This currently fails with Argument type *fn() void is not assignable to parameter type t. Works fine if the pointer is moved into the alias, or if &empty is explicitly cast to *some_func.

Might be related to type hints somehow.

Relevant commits: f2723ad7 - Make pointer/slice assignability rules more strict

#109 Allow abort/assert to accept non-constant strings for reason 3 months ago

Comment by ~yerinalexey on ~sircmpwn/hare

Bor Grošelj Simić referenced this ticket in commit f4ab18a.

#40 A query command with unknown options terminates himitsud 1 year, 3 months ago

Ticket created by ~yerinalexey on ~sircmpwn/himitsu

Example:

$ nc -U $XDG_RUNTIME_DIR/himitsu
query -y proto=irc

The same problem occurs with -h flag.

We should probably either not use getopt in this case, or add an alternative getopt that reports an error instead of exiting.

#728 qbe: rv64/emit.c: dying: no match for swap(d) 1 year, 3 months ago

Comment by ~yerinalexey on ~sircmpwn/hare

#728 qbe: rv64/emit.c: dying: no match for swap(d) 1 year, 3 months ago

Comment by ~yerinalexey on ~sircmpwn/hare

math::hypotf64 seems to be causing it. IL source: https://paste.sr.ht/~yerinalexey/884434fae1a12db5917ca591343ae2df5dcb22c1