Bug#806208: src:gegl: FTBFS on sparc64, tools/introspect segfaults

2016-06-04 Thread Patrick Baggett
On Saturday, June 4, 2016, John Paul Adrian Glaubitz <
glaub...@physik.fu-berlin.de> wrote:

> On 06/03/2016 11:49 PM, John Paul Adrian Glaubitz wrote:
> > So, maybe we're lucky and just the above patch will be enough :).
> >
> > Will build gegl now to verify this.
>
> And, indeed, gegl now builds fine on sparc64 [1].
> Note the comments in the upstream bug tracker though [2] where it
> is suggested to use the following code instead:
>
>  dst[0] = src[0];
>  dst[1] = src[1];
>  dst[2] = src[2];
>  dst[3] = 255;
>
> I have not verified that yet, but it seems this should actually work.
>
> Yeah, the memcpy with a word will probably be wrong due to endian issues
when it is stored because dst[3] would be written in the first byte, but
they are assuming that dst[3] is the last byte, given that they do OR with
0xff << 24, i.e. filling dst[3] = 0xff.

Bonus points if you find a way to do this with VIS intrinsics! ;)



> Adrian
>
> > [1]
> https://buildd.debian.org/status/fetch.php?pkg=gegl&arch=sparc64&ver=0.3.6-4&stamp=1465032322
> > [2] https://bugzilla.gnome.org/show_bug.cgi?id=767219
>
> --
>  .''`.  John Paul Adrian Glaubitz
> : :' :  Debian Developer - glaub...@debian.org 
> `. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
> 
>   `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
>
>


Bug#806208: src:gegl: FTBFS on sparc64, tools/introspect segfaults

2016-06-04 Thread John Paul Adrian Glaubitz
On 06/04/2016 05:53 PM, Patrick Baggett wrote:
> Yeah, the memcpy with a word will probably be wrong due to endian issues when 
> it is stored because dst[3] would be written in the first byte, but they are
> assuming that dst[3] is the last byte, given that they do OR with 0xff << 24, 
> i.e. filling dst[3] = 0xff.

That was actually my concern as well, thanks for reaffirming this.

> Bonus points if you find a way to do this with VIS intrinsics! ;)

Sounds fancy but I'd always prefer portable and robust code in these
situations. I wonder whether it's actually such a time-critical section
that using the byte-wise assignments would make the code much slower.

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913



Bug#806208: src:gegl: FTBFS on sparc64, tools/introspect segfaults

2016-06-04 Thread John Paul Adrian Glaubitz
On 06/03/2016 11:49 PM, John Paul Adrian Glaubitz wrote:
> So, maybe we're lucky and just the above patch will be enough :).
> 
> Will build gegl now to verify this.

And, indeed, gegl now builds fine on sparc64 [1].
Note the comments in the upstream bug tracker though [2] where it
is suggested to use the following code instead:

 dst[0] = src[0];
 dst[1] = src[1];
 dst[2] = src[2];
 dst[3] = 255;

I have not verified that yet, but it seems this should actually work.

Adrian

> [1] 
> https://buildd.debian.org/status/fetch.php?pkg=gegl&arch=sparc64&ver=0.3.6-4&stamp=1465032322
> [2] https://bugzilla.gnome.org/show_bug.cgi?id=767219

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913



Bug#806208: src:gegl: FTBFS on sparc64, tools/introspect segfaults

2016-06-03 Thread John Paul Adrian Glaubitz
On 06/03/2016 10:25 PM, John Paul Adrian Glaubitz wrote:
> Ok, there is unfortunately more of these broken pointer arithmetics throughout
> babl. That will take some time to get all of these fixed. *sigh*

Ok, after applying the suggested changes above, the following bus errors which 
occur
when building babl [1] will actually go away:

Making all in graphics
/bin/bash: line 1: 11007 Bus error   
../tests/babl_fish_path_fitness > BablFishPath.txt
UTF8: BablFishPath.txt Fail
HTML: index.html. [OK]
/bin/bash: line 1: 11445 Bus error   ../tests/babl_fish_path_dhtml 
> BablFishPath.html
HTML: BablFishPath.html Fail

So, maybe we're lucky and just the above patch will be enough :).

Will build gegl now to verify this.

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913



Bug#806208: src:gegl: FTBFS on sparc64, tools/introspect segfaults

2016-06-03 Thread John Paul Adrian Glaubitz
On 06/03/2016 09:44 PM, John Paul Adrian Glaubitz wrote:
> Which seems to fix the problem. In any case, I'll re-assign this to src:gegl.

Ok, there is unfortunately more of these broken pointer arithmetics throughout
babl. That will take some time to get all of these fixed. *sigh*

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913



Bug#806208: src:gegl: FTBFS on sparc64, tools/introspect segfaults

2016-06-03 Thread John Paul Adrian Glaubitz
Control: reassign -1 src:babl

On 06/03/2016 09:17 PM, John Paul Adrian Glaubitz wrote:
> Program received signal SIGBUS, Bus error.
> 0xfff8000101a21378 in ?? () from /usr/lib/sparc64-linux-gnu/babl-0.1/gggl.so
> (gdb) bt
> #0  0xfff8000101a21378 in ?? () from 
> /usr/lib/sparc64-linux-gnu/babl-0.1/gggl.so
> #1  0xfff8000100bc5970 in babl_conversion_process () from 
> /usr/lib/sparc64-linux-gnu/libbabl-0.1.so.0
> #2  0xfff8000100bc7868 in babl_process () from 
> /usr/lib/sparc64-linux-gnu/libbabl-0.1.so.0
> #3  0xfff8000100bc5d9c in babl_conversion_error () from 
> /usr/lib/sparc64-linux-gnu/libbabl-0.1.so.0
> #4  0xfff8000100bc7a58 in ?? () from 
> /usr/lib/sparc64-linux-gnu/libbabl-0.1.so.0
> Backtrace stopped: previous frame identical to this frame (corrupt stack?)
> (gdb)

Which seems to be:

Program received signal SIGBUS, Bus error.
0xfff80001009d5338 in conv_rgb8_rgba8 (
src=0x22b7d3
"\373\327\253\276\242\\܄c\373\247\330\306\376\306\311{\347\340h\202G\374\316\323(d\246\205b\266\210\237\321\063g(\332\327\363\270\210ζ\271\261Y\333a\353\213K\246\313\320\371\374\375\\\265\350i\315\317\353\366\367\317\356\264_ĻlIW8\247k\355N\376\330\324\302\a\355\353\343Ψ\267\350ʢ\245\275\262~\271\313ױ\341ɱ\207\070\210\362\354Ӵ\354\367\322\362\016\215\314\333\351`\253\347\352ī\220ә\373}\347\374\213\351\363\264\346\332C\226\374`U\372\362\345\244yӯ\373\251\340{\334\062\300\367\321ݞ\262ӭý\274\223\221\325옍\232\325H\264幘\255\372\224\225\337\366n\265\334\373\031G\326",
...,
dst=0x22ec14 "", samples=128) at gggl.c:758
758   *(unsigned int *) dst = (*(unsigned int *) src) | (255 << 24);

I have replaced this with:

  unsigned int tmp;
  memcpy(&tmp, src, sizeof(unsigned int));
  tmp = tmp | (255 << 24);
  memcpy(dst, &tmp, sizeof(unsigned int));

Which seems to fix the problem. In any case, I'll re-assign this to src:gegl.

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913



Bug#806208: src:gegl: FTBFS on sparc64, tools/introspect segfaults

2016-06-03 Thread John Paul Adrian Glaubitz
Hi Matteo!

On 11/25/2015 06:35 PM, Matteo F. Vescovi wrote:
> Having a look at [1] seems like sparc64 is out of luck since a looong time ;-)
> 
> Hope to have some spare time to investigate further on the issue.

I have had some time now and according to gdb, it's actually crashing in 
libbabl:

root@deb4g:~/gegl/docs# GEGL_SWAP=RAM GEGL_PATH=../operations 
../tools/operation_reference --json-db > operations.json
+ sed_quote_subst='s|\([`"$\\]\)|\\\1|g'
+ test -n ''
+ case `(set -o) 2>/dev/null` in
+ set -o posix
+ BIN_SH=xpg4
+ export BIN_SH
+ DUALCASE=1
+ export DUALCASE
+ unset CDPATH
+ relink_command='(cd /root/gegl/tools; { test -z "${LIBRARY_PATH+set}" || 
unset LIBRARY_PATH || { LIBRARY_PATH=; export LIBRARY_PATH; }; }; { test -z
"${COMPILER_PATH+set}" || unset COMPILER_PATH || { COMPILER_PATH=; export 
COMPILER_PATH; }; }; { test -z "${GCC_EXEC_PREFIX+set}" || unset 
GCC_EXEC_PREFIX || {
GCC_EXEC_PREFIX=; export GCC_EXEC_PREFIX; }; }; { test -z "${LD_RUN_PATH+set}" 
|| unset LD_RUN_PATH || { LD_RUN_PATH=; export LD_RUN_PATH; }; }; { test -z
"${LD_LIBRARY_PATH+set}" || unset LD_LIBRARY_PATH || { LD_LIBRARY_PATH=; export 
LD_LIBRARY_PATH; }; };
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin; export PATH; 
gcc -pthread -I/usr/include/json-glib-1.0 -I/usr/include/gio-unix-2.0/
-I/usr/include/glib-2.0 -I/usr/lib/sparc64-linux-gnu/glib-2.0/include 
-I/usr/include/babl-0.1 -g -O3 -Wall -Wdeclaration-after-statement 
-Wmissing-prototypes
-Wmissing-declarations -Winit-self -Wpointer-arith -Wold-style-definition 
-DG_LOG_DOMAIN=\"GEGL-\"__FILE__ -Wl,--export-dynamic -pthread -pthread -o
$progdir/$file operation_reference.o  ../gegl/.libs/libgegl-0.3.so 
-lgmodule-2.0 -ljson-glib-1.0 -lgio-2.0 -lgobject-2.0 -lgthread-2.0 -lglib-2.0 
-lbabl-0.1 -lm
-pthread -Wl,-rpath -Wl,/root/gegl/gegl/.libs)'
+ test '' = '%%%MAGIC variable%%%'
+ test '' '!=' '%%%MAGIC variable%%%'
+ file=../tools/operation_reference
+ ECHO='printf %s\n'
+ lt_option_debug=
+ func_parse_lt_options ../tools/operation_reference --json-db
+ lt_script_arg0=../tools/operation_reference
+ shift
+ for lt_opt in '"$@"'
+ case "$lt_opt" in
+ test -n ''
++ printf '%s\n' ../tools/operation_reference
++ /bin/sed 's%/[^/]*$%%'
+ thisdir=../tools
+ test x../tools = x../tools/operation_reference
++ ls -ld ../tools/operation_reference
++ /bin/sed -n 's/.*-> //p'
+ file=
+ test -n ''
+ WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=no
+ test no = yes
++ cd ../tools
++ pwd
+ absdir=/root/gegl/tools
+ test -n /root/gegl/tools
+ thisdir=/root/gegl/tools
+ program=lt-operation_reference
+ progdir=/root/gegl/tools/.libs
+ test '!' -f /root/gegl/tools/.libs/lt-operation_reference
++ ls -1dt /root/gegl/tools/.libs/lt-operation_reference 
/root/gegl/tools/.libs/../lt-operation_reference
++ /bin/sed 1q
+ file=/root/gegl/tools/.libs/lt-operation_reference
+ test X/root/gegl/tools/.libs/lt-operation_reference '!=' 
X/root/gegl/tools/.libs/lt-operation_reference
+ test -f /root/gegl/tools/.libs/lt-operation_reference
+ test '' '!=' '%%%MAGIC variable%%%'
+ func_exec_program --json-db
+ case " $* " in
+ func_exec_program_core --json-db
+ test -n ''
+ exec /root/gegl/tools/.libs/lt-operation_reference --json-db
Bus error
root@deb4g:~/gegl/docs# /root/gegl/tools/.libs/lt-operation_reference
Bus error
root@deb4g:~/gegl/docs# gdb /root/gegl/tools/.libs/lt-operation_reference
GNU gdb (Debian 7.10-1+b1) 7.10
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "sparc64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
.
Find the GDB manual and other documentation resources online at:
.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /root/gegl/tools/.libs/lt-operation_reference...done.
(gdb) run
Starting program: /root/gegl/tools/.libs/lt-operation_reference
BFD: /usr/lib/debug/.build-id/4a/2be3888dfebbf721816e4df21fa6546ccf8e59.debug: 
unable to initialize decompress status for section .debug_aranges
BFD: /usr/lib/debug/.build-id/4a/2be3888dfebbf721816e4df21fa6546ccf8e59.debug: 
unable to initialize decompress status for section .debug_aranges
warning: File 
"/usr/lib/debug/.build-id/4a/2be3888dfebbf721816e4df21fa6546ccf8e59.debug" has 
no build-id, file skipped
BFD: /usr/lib/debug/.build-id/32/5145ec18ef1f1729dd9480cb374706fb208225.debug: 
unable to initialize decompress status for section .debug_aranges
BFD: /usr/lib/debug/.build-id/32/5145ec18ef1f1729dd9480cb374706fb208225.debug: 
unable to initialize decompress status for section .debug_aranges
warning: File 
"/usr/lib/debug/.build-id/32/5145e

Bug#806208: src:gegl: FTBFS on sparc64, tools/introspect segfaults

2015-11-25 Thread Matteo F. Vescovi
Hi!

On Wed, Nov 25, 2015 at 1:21 PM, John Paul Adrian Glaubitz
 wrote:
> [...]
>
> gegl currently fails to build from source on sparc64 since tools/introspect
> segfaults during build. I haven't come up with a patch yet, but I am filing
> this bug for visibility and tagging it with the appropriate user tags.

Having a look at [1] seems like sparc64 is out of luck since a looong time ;-)

Hope to have some spare time to investigate further on the issue.

Cheers.


[1] https://buildd.debian.org/status/logs.php?pkg=gegl&arch=sparc64

-- 
Matteo F. Vescovi



Bug#806208: src:gegl: FTBFS on sparc64, tools/introspect segfaults

2015-11-25 Thread John Paul Adrian Glaubitz
Package: src:gegl
Version: 0.3.2-1
Severity: normal
User: debian-sp...@lists.debian.org
Usertags: sparc64

Hello!

gegl currently fails to build from source on sparc64 since tools/introspect
segfaults during build. I haven't come up with a patch yet, but I am filing
this bug for visibility and tagging it with the appropriate user tags.

Here's the relevant output from the build log [1]:

make[3]: Entering directory '/«PKGBUILDDIR»/docs'
GEGL_SWAP=RAM GEGL_PATH=../operations \
../tools/introspect > class-hierarchy.html
Generating example images
/bin/bash: line 1: 18521 Bus error   GEGL_SWAP=RAM 
GEGL_PATH=../operations ../tools/introspect > class-hierarchy.html
make[3]: *** [class-hierarchy.html] Error 138
Makefile:788: recipe for target 'class-hierarchy.html' failed
make[3]: *** Waiting for unfinished jobs
/bin/bash: line 6: 18520 Bus error   GEGL_SWAP=RAM 
GEGL_PATH=../operations ../bin/gegl-tester --all -o images/examples -d ./images 
-e 
"load|buffer-source|pixbuf|nop|clone|convert-format|introspect|layer|image-compare|load|open-buffer|svg-load|exr-load|jpg-load|png-load|magick-load|box-blur|stretch-contrast|remap|matting-global|exp-combine|dropshadow|kuwahara|box-percentile|disc-percentile|snn-percentile|line-profile|buffer-cache|warp|mandelbrot|hstack"
make[3]: *** [examples] Error 138

Cheers,
Adrian

> [1] 
> https://buildd.debian.org/status/fetch.php?pkg=gegl&arch=sparc64&ver=0.3.2-1&stamp=1448442183

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913