bug#31923: FAIL: t0501-duplicate on Alpine Linux s390x

2019-08-05 Thread Brian C. Lane
On Mon, Aug 05, 2019 at 12:55:08AM -0500, A. Wilcox wrote:
> found 31923 3.2
> 
> We've hit this on Adélie Linux on ppc64.  This actually is an endianness
> bug.
> 
> The attached patch fixes the bug and allows it to pass the test suite
> and correctly create a new BSD disk label on big endian computers.
> 
> If this patch is acceptable, I can create it in Git format.  Or you can
> yourself, my Author line should be:
> 
> Author: A. Wilcox 
> 
> 
> Best,
> --arw
> 
> -- 
> A. Wilcox (awilfox)
> Project Lead, Adélie Linux
> https://www.adelielinux.org

> See-Also: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=31923
> 
> --- parted-3.2/libparted/labels/bsd.c.old 2014-06-15 18:17:43.0 
> +
> +++ parted-3.2/libparted/labels/bsd.c 2019-08-05 05:48:52.914401379 +
> @@ -364,7 +364,7 @@
>   max_part = i;
>   }
>  
> - label->d_npartitions = PED_CPU_TO_LE16 (max_part) + 1;
> + label->d_npartitions = PED_CPU_TO_LE16 (max_part + 1);
>   label->d_checksum = xbsd_dkcksum (label);
>  
>   alpha_bootblock_checksum (bsd_specific->boot_code);


Ack, thanks!



-- 
Brian C. Lane (PST8PDT) - weldr.io - lorax - parted





bug#31923: FAIL: t0501-duplicate on Alpine Linux s390x

2019-08-04 Thread A. Wilcox
found 31923 3.2

We've hit this on Adélie Linux on ppc64.  This actually is an endianness
bug.

The attached patch fixes the bug and allows it to pass the test suite
and correctly create a new BSD disk label on big endian computers.

If this patch is acceptable, I can create it in Git format.  Or you can
yourself, my Author line should be:

Author: A. Wilcox 


Best,
--arw

-- 
A. Wilcox (awilfox)
Project Lead, Adélie Linux
https://www.adelielinux.org
See-Also: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=31923

--- parted-3.2/libparted/labels/bsd.c.old   2014-06-15 18:17:43.0 
+
+++ parted-3.2/libparted/labels/bsd.c   2019-08-05 05:48:52.914401379 +
@@ -364,7 +364,7 @@
max_part = i;
}
 
-   label->d_npartitions = PED_CPU_TO_LE16 (max_part) + 1;
+   label->d_npartitions = PED_CPU_TO_LE16 (max_part + 1);
label->d_checksum = xbsd_dkcksum (label);
 
alpha_bootblock_checksum (bsd_specific->boot_code);


signature.asc
Description: OpenPGP digital signature


bug#31923: FAIL: t0501-duplicate on Alpine Linux s390x

2018-06-21 Thread Phillip Susi
On 6/21/2018 4:17 AM, Natanael Copa wrote:
> A wild guess is that xbsd_dkcksum does not work properly on big endian
> machines.

It looks like it handles endianess correctly, but I did notice that it
is using something called "u_short" instead of uint16_t.  I wonder if on
your machine "u_short" isn't 16 bits?  Try changing it to uint16_t.





signature.asc
Description: OpenPGP digital signature


bug#31923: FAIL: t0501-duplicate on Alpine Linux s390x

2018-06-21 Thread Natanael Copa
Hi!

It seems that the tests/duplicate segfaults on Alpine Linux s390x when
called as:

  ./duplicate bsd


+ duplicate bsd
./t0501-duplicate.sh: line 21:  3803 Segmentation fault  duplicate

I have attached the test-suite.log.

Backtrace:

Core was generated by 
`/home/ncopa/aports/main/parted/src/parted-3.2/tests/.libs/lt-duplicate bsd'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x03ff8ad23f32 in xbsd_dkcksum (lp=0x3ff8ac54c80) at bsd.c:134
134 sum ^= *start++;
(gdb) bt
#0  0x03ff8ad23f32 in xbsd_dkcksum (lp=0x3ff8ac54c80) at bsd.c:134
#1  bsd_write (disk=0x3ff8ac54ac0) at bsd.c:368
#2  0x03ff8ad12afe in ped_disk_commit_to_dev (disk=0x3ff8ac54ac0) at 
disk.c:500
#3  0x03ff8ad12b66 in ped_disk_commit (disk=0x3ff8ac54ac0) at disk.c:529
#4  0x02aa275814a4 in main (argc=, argv=) at 
duplicate.c:39


A wild guess is that xbsd_dkcksum does not work properly on big endian
machines.


==
   GNU parted 3.2: tests/test-suite.log
==

# TOTAL: 65
# PASS:  35
# SKIP:  29
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

SKIP: t0203-gpt-create-on-min-sized-device
==

++ initial_cwd_=/home/ncopa/aports/main/parted/src/parted-3.2/tests
++ fail=0
+++ testdir_prefix_
+++ printf gt
++ pfx_=gt
+++ mktempd_ /home/ncopa/aports/main/parted/src/parted-3.2/tests gt-t0203-gpt-create-on-min-sized-device.sh.
+++ case $# in
+++ destdir_=/home/ncopa/aports/main/parted/src/parted-3.2/tests
+++ template_=gt-t0203-gpt-create-on-min-sized-device.sh.
+++ MAX_TRIES_=4
+++ case $destdir_ in
+++ case $template_ in
 unset TMPDIR
+++ d=
+++ fail=1
+++ case $d in
+++ fail=1
+++ test -d ''
+++ fail=1
 tr S -
 ls -dgo ''
+++ perms=
+++ case $perms in
+++ fail=1
+++ test 1 = 0
 echo gt-t0203-gpt-create-on-min-sized-device.sh.
 sed 's/XX*$//'
+++ base_template_=gt-t0203-gpt-create-on-min-sized-device.sh.
  wc echo -cgt-t0203-gpt-create-on-min-sized-device.sh.

+++ template_length_=48
 echo gt-t0203-gpt-create-on-min-sized-device.sh.
 wc -c
+++ nx_=44
 expr 48 - 44
+++ nx_=4
+++ err_=
+++ i_=1
+++ :
 rand_bytes_ 4
 n_=4
 chars_=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
 dev_rand_=/dev/urandom
 test -r /dev/urandom
 dd ibs=4 count=1 if=/dev/urandom
 LC_ALL=C
 tr -c abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 01234567abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
 return
+++ X_=ZG4A
+++ candidate_dir_=/home/ncopa/aports/main/parted/src/parted-3.2/tests/gt-t0203-gpt-create-on-min-sized-device.sh.ZG4A
 mkdir -m 0700 /home/ncopa/aports/main/parted/src/parted-3.2/tests/gt-t0203-gpt-create-on-min-sized-device.sh.ZG4A
+++ err_=
+++ echo /home/ncopa/aports/main/parted/src/parted-3.2/tests/gt-t0203-gpt-create-on-min-sized-device.sh.ZG4A
+++ return
++ test_dir_=/home/ncopa/aports/main/parted/src/parted-3.2/tests/gt-t0203-gpt-create-on-min-sized-device.sh.ZG4A
++ cd /home/ncopa/aports/main/parted/src/parted-3.2/tests/gt-t0203-gpt-create-on-min-sized-device.sh.ZG4A
++ gl_init_sh_nl_='
'
++ IFS=' 	
'
++ for sig_ in 1 2 3 13 15
+++ expr 1 + 128
++ eval 'trap '\''Exit 129'\'' 1'
+++ trap 'Exit 129' 1
++ for sig_ in 1 2 3 13 15
+++ expr 2 + 128
++ eval 'trap '\''Exit 130'\'' 2'
+++ trap 'Exit 130' 2
++ for sig_ in 1 2 3 13 15
+++ expr 3 + 128
++ eval 'trap '\''Exit 131'\'' 3'
+++ trap 'Exit 131' 3
++ for sig_ in 1 2 3 13 15
+++ expr 13 + 128
++ eval 'trap '\''Exit 141'\'' 13'
+++ trap 'Exit 141' 13
++ for sig_ in 1 2 3 13 15
+++ expr 15 + 128
++ eval 'trap '\''Exit 143'\'' 15'
+++ trap 'Exit 143' 15
++ trap remove_tmp_ 0
+ path_prepend_ ../parted
+ test 1 '!=' 0
+ path_dir_=../parted
+ case $path_dir_ in
+ abs_path_dir_=/home/ncopa/aports/main/parted/src/parted-3.2/tests/../parted
+ case $abs_path_dir_ in
+ PATH=/home/ncopa/aports/main/parted/src/parted-3.2/tests/../parted:/home/ncopa/aports/main/parted/src/parted-3.2/parted:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+ create_exe_shims_ /home/ncopa/aports/main/parted/src/parted-3.2/tests/../parted
+ case $EXEEXT in
+ return 0
+ shift
+ test 0 '!=' 0
+ export PATH
+ require_512_byte_sector_size_
+ test 1024 = 512
+ skip_ FS test with sector size '!=' 512
+ warn_ 't0203-gpt-create-on-min-sized-device.sh: skipped test: FS' test with sector size '!=' 512
+ case $IFS in
+ printf '%s\n' 't0203-gpt-create-on-min-sized-device.sh: skipped test: FS test with sector size != 512'
t0203-gpt-create-on-min-sized-device.sh: skipped test: FS test with sector size != 512
+ test 9 = 2
+ printf '%s\n' 't0203-gpt-create-on-min-sized-device.sh: skipped test: FS test with sector size != 512'
+ sed 1q
+ Exit 77
+ set +e
+ exit 77
+ exit 77
+ remove_tmp_
+ __st=77