Github messages for voidlinux
 help / color / mirror / Atom feed
* [ISSUE] libunistring: segfault on musl
@ 2022-10-02 17:38 tranzystorek-io
  2022-10-03 13:36 ` libunistring: `u32_move` segfaults " tranzystorek-io
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: tranzystorek-io @ 2022-10-02 17:38 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 859 bytes --]

New issue by tranzystorek-io on void-packages repository

https://github.com/void-linux/void-packages/issues/39624

Description:
### Is this a new report?

Yes

### System Info

Void 5.19.10_1 x86_64-musl GenuineIntel/VM uptodate FF

### Package(s) Affected

libunistring-1.0_1

### Does a report exist for this bug with the project's home (upstream) and/or another distro?

_No response_

### Expected behaviour

Tests for the `boxes` project run correctly

### Actual behaviour

One of the tests segfaults (https://github.com/ascii-boxes/boxes/issues/103#issuecomment-1264611505)

### Steps to reproduce

On a x86_64-musl void system (e.g. `ghcr.io/void-linux/void-linux:latest-full-x86_64-musl`):

1. `xbps-install bison flex libunistring-devel pcre2-devel xxd git base-devel`
2. `git clone https://github.com/ascii-boxes/boxes`
3. `make && make test`

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: libunistring: `u32_move` segfaults on musl
  2022-10-02 17:38 [ISSUE] libunistring: segfault on musl tranzystorek-io
@ 2022-10-03 13:36 ` tranzystorek-io
  2022-10-03 14:43 ` sgn
  2022-10-03 14:43 ` [ISSUE] [CLOSED] " sgn
  2 siblings, 0 replies; 4+ messages in thread
From: tranzystorek-io @ 2022-10-03 13:36 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 265 bytes --]

New comment by tranzystorek-io on void-packages repository

https://github.com/void-linux/void-packages/issues/39624#issuecomment-1265453062

Comment:
Same scenario run on alpine doesn't cause a segfault, which suggests our build of `libunistring` might be flawed.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: libunistring: `u32_move` segfaults on musl
  2022-10-02 17:38 [ISSUE] libunistring: segfault on musl tranzystorek-io
  2022-10-03 13:36 ` libunistring: `u32_move` segfaults " tranzystorek-io
@ 2022-10-03 14:43 ` sgn
  2022-10-03 14:43 ` [ISSUE] [CLOSED] " sgn
  2 siblings, 0 replies; 4+ messages in thread
From: sgn @ 2022-10-03 14:43 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1383 bytes --]

New comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/issues/39624#issuecomment-1265562019

Comment:
Their code is broken, not our libunistring:
```diff
diff --git a/src/Makefile b/src/Makefile
index e1a1827..5b38eab 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -14,6 +14,7 @@
 
 
 CC         = gcc
+CFLAGS_ADDTL = -O0 -g -pipe
 
 OUT_DIR    = ../out
 SRC_DIR    = ../src
@@ -65,7 +66,6 @@ debug: flags_$(BOXES_PLATFORM) | $(OUT_DIR)
 
 boxes: $(ALL_OBJ) | check_dir
 	$(CC) $(LDFLAGS) $^ -o $@ -lunistring -lpcre2-32
-	if [ "$(STRIP)" = "true" ] ; then strip $@ ; fi
 
 boxes.static: $(ALL_OBJ) | check_dir
 	$(CC) $(LDFLAGS) $^ -o $(BOXES_EXECUTABLE_NAME) -l:libunistring.a -l:libpcre2-32.a
diff --git a/src/remove.c b/src/remove.c
index c4dae4b..4346edb 100644
--- a/src/remove.c
+++ b/src/remove.c
@@ -986,7 +986,7 @@ int remove_box()
                         (int) (input.lines[j].num_chars - c + 1), (int) input.lines[j].posmap[c]);
             #endif
             u32_move(input.lines[j].mbtext, input.lines[j].mbtext + input.lines[j].posmap[c],
-                     input.lines[j].num_chars - c + 1);  /* +1 for zero byte */
+                     input.lines[j].num_chars - input.lines[j].posmap[c] + 1);  /* +1 for zero byte */
             input.lines[j].num_chars -= c;
         }
     }

```

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ISSUE] [CLOSED] libunistring: `u32_move` segfaults on musl
  2022-10-02 17:38 [ISSUE] libunistring: segfault on musl tranzystorek-io
  2022-10-03 13:36 ` libunistring: `u32_move` segfaults " tranzystorek-io
  2022-10-03 14:43 ` sgn
@ 2022-10-03 14:43 ` sgn
  2 siblings, 0 replies; 4+ messages in thread
From: sgn @ 2022-10-03 14:43 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 900 bytes --]

Closed issue by tranzystorek-io on void-packages repository

https://github.com/void-linux/void-packages/issues/39624

Description:
### Is this a new report?

Yes

### System Info

Void 5.19.10_1 x86_64-musl GenuineIntel/VM uptodate FF

### Package(s) Affected

libunistring-1.0_1

### Does a report exist for this bug with the project's home (upstream) and/or another distro?

_No response_

### Expected behaviour

Tests for the `boxes` project run correctly

### Actual behaviour

One of the tests segfaults (https://github.com/ascii-boxes/boxes/issues/103#issuecomment-1264611505)

### Steps to reproduce

On a x86_64-musl void system (e.g. `ghcr.io/void-linux/void-linux:latest-full-x86_64-musl`):

1. `xbps-install bison flex libunistring-devel pcre2-devel xxd git base-devel`
2. `git clone https://github.com/ascii-boxes/boxes`
3. `cd boxes && make && make test`

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-10-03 14:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-02 17:38 [ISSUE] libunistring: segfault on musl tranzystorek-io
2022-10-03 13:36 ` libunistring: `u32_move` segfaults " tranzystorek-io
2022-10-03 14:43 ` sgn
2022-10-03 14:43 ` [ISSUE] [CLOSED] " sgn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).