~cnx

Ulsan, South Korea

https://cnx.gdn

Vietnamese free software enthusiast

Join the FSF

~cnx/loang

Last active 14 days ago

~cnx/site

Last active a month ago

~cnx/misc

Last active a month ago

~cnx/blackshades

Last active 10 months ago

~cnx/ipwhl-discuss

Last active 1 year, 9 days ago

~cnx/ipwhl-announce

Last active 1 year, 8 months ago

~cnx/ipwhl-devel

Last active 1 year, 8 months ago

~cnx/tzigame

Last active 2 years ago

~cnx/palace

Last active 2 years ago

~cnx/nwsim

Last active 2 years ago
View more

Recent activity

[PATCH] test/fpcnv: skip of inexactly converted integers 3 days ago

From Nguyễn Gia Phong to ~mpu/qbe

In C, if a floating point cannot be represented exactly as an integer,
conversion from the former to the latter is implementation-defined.
Therefore, it can be flaky to test this against QBE-defined behavior.

This was discovered from (unsigned int) 4294967295.0f being an UB,
because (uint64_t) 4294967295.0f is 4294967296 > UINT_MAX
on amd64 when compiled by either gcc or clang.
---
 test/fpcnv.ssa | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/test/fpcnv.ssa b/test/fpcnv.ssa
index 3466ed278a75..3fe078f796fd 100644
--- a/test/fpcnv.ssa
[message trimmed]

[PATCH] remove duplicated function declarations 6 days ago

From Nguyễn Gia Phong to ~mpu/qbe

References: 12f9d16c7b000 ("create cfg.c for cfg-related functions")
---
 all.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/all.h b/all.h
index e421b9c24ed4..129dfbf947e3 100644
--- a/all.h
+++ b/all.h
@@ -540,8 +540,6 @@ void loadopt(Fn *);

/* ssa.c */
void filluse(Fn *);
void fillpreds(Fn *);
[message trimmed]

[PATCH] declare check-rv64 as a phony make target 6 days ago

From Nguyễn Gia Phong to ~mpu/qbe

References: 4e93eeaa3b63b ("add rv64 backend")
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index f5e8a76876c0..bed718a0e4bf 100644
--- a/Makefile
+++ b/Makefile
@@ -90,4 +90,4 @@ src:
		}" < $$F;                          \
	done

.PHONY: clean clean-gen check check-arm64 src 80 install uninstall
[message trimmed]

[PATCH aerc v2] exec: look up sh in PATH for consistency 17 days ago

From Nguyễn Gia Phong to ~rjarry/aerc-devel

Signed-off-by: Nguyễn Gia Phong <cnx@loang.net>
---
Now with the developer certificate of origin d-;
 app/compose.go           | 2 +-
 commands/patch/rebase.go | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/app/compose.go b/app/compose.go
index 451981cd516e..4ec50f047a09 100644
--- a/app/compose.go
+++ b/app/compose.go
@@ -1236,7 +1236,7 @@ func (c *Composer) showTerminal() error {
	if err != nil {
		c.acct.PushError(fmt.Errorf("could not start editor: %w", err))
[message trimmed]

[PATCH aerc] exec: look up sh in PATH for consistency 17 days ago

From Nguyễn Gia Phong to ~rjarry/aerc-devel

---
I noticed the inconsistency (most other executions, including sh,
don't use absolute path) while updating the Guix package.
 app/compose.go           | 2 +-
 commands/patch/rebase.go | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/app/compose.go b/app/compose.go
index 451981cd516e..4ec50f047a09 100644
--- a/app/compose.go
+++ b/app/compose.go
@@ -1236,7 +1236,7 @@ func (c *Composer) showTerminal() error {
	if err != nil {
		c.acct.PushError(fmt.Errorf("could not start editor: %w", err))
[message trimmed]

Re: NULL arithmetic UB on Blk.ins a month ago

From Nguyễn Gia Phong to ~mpu/qbe

On 2024-01-11 at 00:12+09:00, Nguyễn Gia Phong wrote:
> I used clang to compile qbe with UBSan and the tests trigger
> the runtime trap at &b->ins[b->nins], where b is a (Blk *),
> when b->ins is NULL, leading to NULL + b->nins being UB.
>
> This occur throughout the codebase and while at some spots
> it's contained and could be trivially fixed like so
>
> -for (i=b->ins; i<&b->ins[b->nins]; i++)
> +for (i=b->ins; i && i<&b->ins[b->nins]; i++)
>
> for others it affects the following blocks, so without
> clear preconditions it's not easy to determine
> if there could be a potential bug (?).

NULL arithmetic UB on Blk.ins a month ago

From Nguyễn Gia Phong to ~mpu/qbe

Hi,

I used clang to compile qbe with UBSan and the tests trigger
the runtime trap at &b->ins[b->nins], where b is a (Blk *),
when b->ins is NULL, leading to NULL + b->nins being UB.

This occur throughout the codebase and while at some spots
it's contained and could be trivially fixed like so

-for (i=b->ins; i<&b->ins[b->nins]; i++)
+for (i=b->ins; i && i<&b->ins[b->nins]; i++)

for others it affects the following blocks, so without
clear preconditions it's not easy to determine

Re: [PATCH fead v3] Add option to skip errors a month ago

From Nguyễn Gia Phong to ~cnx/misc

Sorry for the extremely late response!
I've reworked this a bit and pushed the change to 
https://trong.loang.net/~cnx/fead/commit/?id=3307272b5590

Version 1.0.0 (yay!), which includes it, has been tagged,
and published to PyPI as well.  Please package
for your distribution if desired.

Re: License checker misses "LICENSE-MIT" license 2 months ago

From Nguyễn Gia Phong to ~sircmpwn/sr.ht-discuss

On 2023-12-03 at 16:03-08:00, Dev Email wrote:
> Some of my projects are licensed under MIT and Apache-2.0 license. In 
> this case,
>
> I include "LICENSE-MIT" and "LICENSE-APACHE" file in my repository. However,
>
> sr.ht does not seem to detect them, as I see this message:
>
>
>  > *Heads up!* We couldn't find a license file for your repository...

Sourcehut has primitive support for REUSE, which looks for
license files in LICENSES (and declaration for each source file
but git.sr.ht does not do anything about that AFAICT).

Re: Vulnerability Scanner 4 months ago

From Nguyễn Gia Phong to ~sircmpwn/sr.ht-discuss

On 2023-10-19 at 09:35-04:00, Sashanoraa wrote:
> I miss [...] the automatic vulnerability scanner thingy.
> [...] I've been considering cooking up something [...]
>
> So I'm asking the community, is this something
> y'all are interested in?

Like Stappers said, since you need it, go for it.
Vulnerability scanner is always nice to have,
although note that distributions actively keep track of packages
they maintain, so IMHO it'd even be better to acquite dependencies
from downstream instead of pinning to a specific version
and relying on being notified by a bot.