Re: Bug#651934: How to debug seed FTBFS on sparc?

2012-03-04 Thread Gustavo Noronha Silva
Hey,

On Sun, 2012-03-04 at 10:06 +, peter green wrote:
> 1: when we backtraced the crash it was an unaligned access in 
> libjavascriptcore (part of webkit)
> 2: webkit has a specific define in it's code already for whether the CPU 
> needs aligned access
> 3: the aforementioned define was not previously set on sparc even though 
> sparc is known to require aligned accesses
> 4: when jurij rebuilt webkit with a patch to set the aforementioned 
> define on sparc seed built successfully
> 5: the earliest version of webkit/javascriptcore with which I have 
> reproduced the issue is 1.6.1-5

Thanks for your work and investigation, I'll upload a new package with
this fix later today and will also upstream the patch.

Cheers,

-- 
Gustavo Noronha Silva 
Debian


signature.asc
Description: This is a digitally signed message part


Re: Bug#651934: How to debug seed FTBFS on sparc?

2012-03-04 Thread peter green

reassign 651934 libjavascriptcoregtk-3.0-0 1.6.1-5
retitle 651934 unaligned access problems in libjavascriptcore on sparc 
leading to seed FTBFS

affects 651934 seed
tags 651934 patch
thanks

Jurij Smakov wrote:
It built successfully this time! And after I installed the resulting 
debs, seed built successfully too. The webkit patch I used is 
attached.


Best regards,
  

Thanks

Based on the evidence that
1: when we backtraced the crash it was an unaligned access in 
libjavascriptcore (part of webkit)
2: webkit has a specific define in it's code already for whether the CPU 
needs aligned access
3: the aforementioned define was not previously set on sparc even though 
sparc is known to require aligned accesses
4: when jurij rebuilt webkit with a patch to set the aforementioned 
define on sparc seed built successfully
5: the earliest version of webkit/javascriptcore with which I have 
reproduced the issue is 1.6.1-5


I am reassigning this to libjavascriptcoregtk-3.0-0 1.6.1-5, retitling 
it, marking it as affecting seed and replacing the help tag with a patch tag


Webkit maintainers can you please upload Jurij's patch.


--
To UNSUBSCRIBE, email to debian-sparc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4f533ea1.6000...@p10link.net



Re: Bug#651934: How to debug seed FTBFS on sparc?

2012-03-04 Thread Jurij Smakov
On Sat, Mar 03, 2012 at 08:07:33AM +, Jurij Smakov wrote:
[...]
> Unfortunately, the build I tried last week failed with the following 
> messages while compiling Source/WebCore/svg/SVGFilterElement.cpp:
> 
> ../Source/JavaScriptCore/wtf/ListHashSet.h:192:70: warning: cast from 'char*' 
> to 'WTF::ListHashSetNodeAllocator::Node* {aka 
> WTF::ListHashSetNode*}' increases required alignment 
> of target type [-Wcast-align]
> /tmp/ccJFyoyk.s: Assembler messages:
> /tmp/ccJFyoyk.s:107726: Error: unknown pseudo-op: `.ua'
> /tmp/ccJFyoyk.s:107726: Error: junk at end of line, first unrecognized 
> character is `3'
> make[1]: *** [Source/WebCore/svg/libWebCore_la-SVGFilterElement.lo] Error 1
> make[1]: Leaving directory `/home/jurij/seed/webkit-1.6.3/build-3.0'
> make: *** [build-stamp] Error 2
> 
> Last 500 lines of the logs are attached.
> 
> I'll try again today with the latest toolchain to see whether this was 
> some transient problem.

It built successfully this time! And after I installed the resulting 
debs, seed built successfully too. The webkit patch I used is 
attached.

Best regards,
-- 
Jurij Smakov   ju...@wooyd.org
Key: http://www.wooyd.org/pgpkey/  KeyID: C99E03CC
diff -aur a/Source/JavaScriptCore/wtf/Platform.h b/Source/JavaScriptCore/wtf/Platform.h
--- a/Source/JavaScriptCore/wtf/Platform.h	2012-02-25 11:10:13.0 +
+++ b/Source/JavaScriptCore/wtf/Platform.h	2012-02-25 11:26:17.992010602 +
@@ -295,7 +295,7 @@
 
 #endif /* ARM */
 
-#if CPU(ARM) || CPU(MIPS) || CPU(SH4)
+#if CPU(ARM) || CPU(MIPS) || CPU(SH4) || CPU(SPARC)
 #define WTF_CPU_NEEDS_ALIGNED_ACCESS 1
 #endif
 


Re: Bug#651934: How to debug seed FTBFS on sparc?

2012-03-01 Thread peter green

Michael Biebl wrote:


Could you try building seed 3.2 against the same version of webkit as 
seed 3.0 was built?

I removed all webkit and javascriptcore packages and installed

http://snapshot.debian.org/archive/debian/20110505T052259Z/pool/main/w/webkitgtk%2B/libwebkitgtk-3.0-0_1.4.0-1_sparc.deb
http://snapshot.debian.org/archive/debian/20110502T205251Z/pool/main/w/webkitgtk%2B/libwebkitgtk-3.0-common_1.4.0-1_all.deb
http://snapshot.debian.org/archive/debian/20110505T052259Z/pool/main/w/webkitgtk%2B/libwebkitgtk-3.0-dev_1.4.0-1_sparc.deb
http://snapshot.debian.org/archive/debian/20101126T030215Z/pool/main/i/icu/libicu44_4.4.2-2_sparc.deb
http://snapshot.debian.org/archive/debian/20110709T030911Z/pool/main/libj/libjpeg6b/libjpeg62_6b1-2_sparc.deb

The first thing I ran into was that seed currently has a build-depends 
on libwebkitgtk-3.0-dev (>= 1.5.2), I de-versioned that build-depends so 
I could continue with the test.


After doing so seed built successfully!

You can get those packages from snapshot.d.o [3].
This should help narrow down the problem.

I notice that "libjavascriptcore" didn't exist in that version of webkit.

IMO this result points the finger even more in webkit's direction (it 
was already looking that way)


I guess the next thing to do is to wait for jurij's results with his 
patched version of webkit. Jurij what is the status of that? (still 
waiting for webkit to build?).



--
To UNSUBSCRIBE, email to debian-sparc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4f4f2a52.1060...@p10link.net



Re: Bug#651934: How to debug seed FTBFS on sparc?

2012-02-29 Thread Michael Biebl

tags 651934 + help
thanks

Hi Peter,

Am 26.02.2012 03:19, schrieb peter green:


mmm, the webkit (webkit is the source package for libjavascriptcore)
build log has a huge number of cast alignment warnings :( worse the file
in which the error occoured is generated at webkit build time and is
therefore not available in the webkit source package. I don't have the
resources to build webkit on sparc in a reasonable time.

Since testing an unstable have different versions of both seed and
webkit. I decided the next thing to try was to build both testing's
version of seed and unstable's versions of seed in both testing and
unstable to try and narrow down which package caused the regression.
However all four combinations failed with a bus error so it seems this
regression happened before the version of webkit that is now in testing.


Could you try building seed 3.2 against the same version of webkit as 
seed 3.0 was built? According to [1], this should be 1.4.2-1 [2].


You can get those packages from snapshot.d.o [3].
This should help narrow down the problem.

Michael


[1] 
https://buildd.debian.org/status/fetch.php?pkg=seed&arch=sparc&ver=3.0.0-2&stamp=1310476647

[2]
Get:235 http://mirror-ubc.debian.org/debian/ unstable/main 
libwebkitgtk-3.0-common all 1.4.2-1 [782 kB]
Get:236 http://mirror-ubc.debian.org/debian/ unstable/main 
libwebkitgtk-3.0-0 sparc 1.4.2-1 [6312 kB]
Get:237 http://mirror-ubc.debian.org/debian/ unstable/main 
libwebkitgtk-3.0-dev sparc 1.4.2-1 [163 kB]

[3] http://snapshot.debian.org/package/webkitgtk%2B/1.4.0-1/
--
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?


--
To UNSUBSCRIBE, email to debian-sparc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4f4e35cc.8000...@michaelbiebl.de



Re: How to debug seed FTBFS on sparc?

2012-02-26 Thread Jurij Smakov
On Sun, Feb 26, 2012 at 02:19:59AM +, peter green wrote:
> Found 651934 3.0.0-2
> Thanks
> 
> Thanks jurij for your help.
> >'disassemble' command may be used to look up the assembler code
> >around the instruction which caused the crash:
> Some further notes on the dissasemble command I ran into while
> trying to use it.
> 
> 1: it seems you have to explicitly select a range unless you want a
> whole function
> 2: if you have debug symbols installed you have to use "info frame"
> to get the address of the program counter
> 3: the addresses were different on my system, i'm not sure whether
> this was because my system was slightly out of date at the time or
> because of address randomisation.
> >Figuring out why this happens is the tricky part :-).
> mmm, the webkit (webkit is the source package for libjavascriptcore)
> build log has a huge number of cast alignment warnings :( worse the
> file in which the error occoured is generated at webkit build time
> and is therefore not available in the webkit source package. I don't
> have the resources to build webkit on sparc in a reasonable time.
> 
> Since testing an unstable have different versions of both seed and
> webkit. I decided the next thing to try was to build both testing's
> version of seed and unstable's versions of seed in both testing and
> unstable to try and narrow down which package caused the regression.
> However all four combinations failed with a bus error so it seems
> this regression happened before the version of webkit that is now in
> testing.
> 
> I'm now marking this bug as affecting the version in testing as well.
> 
> Webkit maintainers: Is any form of testsuite for libjavascriptcore
> run at webkit build time? I didn't spot anything on a quick look at
> the log but the log is massive so it's possible I missed it.

I poked around the webkit source a bit and found that there is a 
WTF_CPU_NEEDS_ALIGNED_ACCESS macro, which is conditionally set to 1 
only for ARM, MIPS and SH4 CPUs. I'm currently trying to build webkit 
with attached patch to see whether this improves things.

Best regards,
-- 
Jurij Smakov   ju...@wooyd.org
Key: http://www.wooyd.org/pgpkey/  KeyID: C99E03CC
diff -aur a/Source/JavaScriptCore/wtf/Platform.h b/Source/JavaScriptCore/wtf/Platform.h
--- a/Source/JavaScriptCore/wtf/Platform.h	2012-02-25 11:10:13.0 +
+++ b/Source/JavaScriptCore/wtf/Platform.h	2012-02-25 11:26:17.992010602 +
@@ -295,7 +295,7 @@
 
 #endif /* ARM */
 
-#if CPU(ARM) || CPU(MIPS) || CPU(SH4)
+#if CPU(ARM) || CPU(MIPS) || CPU(SH4) || CPU(SPARC)
 #define WTF_CPU_NEEDS_ALIGNED_ACCESS 1
 #endif
 


Re: How to debug seed FTBFS on sparc?

2012-02-25 Thread peter green

Found 651934 3.0.0-2
Thanks

Thanks jurij for your help.
'disassemble' command may be used to look up the assembler code around 
the instruction which caused the crash:
  
Some further notes on the dissasemble command I ran into while trying to 
use it.


1: it seems you have to explicitly select a range unless you want a 
whole function
2: if you have debug symbols installed you have to use "info frame" to 
get the address of the program counter
3: the addresses were different on my system, i'm not sure whether this 
was because my system was slightly out of date at the time or because of 
address randomisation.

Figuring out why this happens is the tricky part :-).
  
mmm, the webkit (webkit is the source package for libjavascriptcore) 
build log has a huge number of cast alignment warnings :( worse the file 
in which the error occoured is generated at webkit build time and is 
therefore not available in the webkit source package. I don't have the 
resources to build webkit on sparc in a reasonable time.


Since testing an unstable have different versions of both seed and 
webkit. I decided the next thing to try was to build both testing's 
version of seed and unstable's versions of seed in both testing and 
unstable to try and narrow down which package caused the regression. 
However all four combinations failed with a bus error so it seems this 
regression happened before the version of webkit that is now in testing.


I'm now marking this bug as affecting the version in testing as well.

Webkit maintainers: Is any form of testsuite for libjavascriptcore run 
at webkit build time? I didn't spot anything on a quick look at the log 
but the log is massive so it's possible I missed it.



--
To UNSUBSCRIBE, email to debian-sparc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4f4996cf.3040...@p10link.net



Re: How to debug seed FTBFS on sparc?

2012-02-23 Thread Mark Morgan Lloyd

Jurij Smakov wrote:

The offending instruction tries to load a 4-byte word located at 
address %l0 into %g1 register, so it's expected to be aligned on a 
4-byte boundary, however it is obviously not:


(gdb) info reg l0
l0 0xf581f42e   -176032722
(gdb)

Figuring out why this happens is the tricky part :-).


Noting that Peter is active in the debian-arm mailing list, I think it's 
worth remarking that at least some ARM variants are sensitive to the 
same alignment issues as SPARC. I've hassled the FPC developers a lot 
over this, and in general a fix that was good for one architecture 
turned out to be good for the others.


--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]


--
To UNSUBSCRIBE, email to debian-sparc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/ji5tfo$p3u$1...@pye-srv-01.telemetry.co.uk



Re: How to debug seed FTBFS on sparc?

2012-02-23 Thread Jurij Smakov
On Thu, Feb 23, 2012 at 10:30:45AM +, peter green wrote:
> seed currently FTBFS on sparc with a bus error.
> 
> I've reproduced this on a sparc box that Tom Theisen made available
> (thanks tom) but i'm kinda stuck on how to debug it.
> 
> Any ideas on how to debug this? Normally i'd start by turning down
> the optimisation but this package doesn't seem to be using any in
> the first place. I tried to use gdb but ran into issues with the
> libtool wrapper scripts.

To find out which binary actually gets invoked by the wrapper script 
you can change the first line of the script to

#! /bin/bash -x

The '-x' option will cause every command executed to be printed out. 
After you run the crashing command you'll see this:

jurij@debian:~/seed/seed-3.2.0/doc/modules/readline$ ../../../src/seed 
../../../doc/modules/make-functions.js ../../../doc/modules/readline/readline.js
[...]
+ func_exec_program_core ../../../doc/modules/make-functions.js 
../../../doc/modules/readline/readline.js
+ test -n ''
+ exec /home/jurij/seed/seed-3.2.0/src/.libs/lt-seed 
../../../doc/modules/make-functions.js ../../../doc/modules/readline/readline.js
Bus error

This is the binary:

jurij@debian:~/seed/seed-3.2.0/doc/modules/readline$ file 
/home/jurij/seed/seed-3.2.0/src/.libs/lt-seed 
/home/jurij/seed/seed-3.2.0/src/.libs/lt-seed: ELF 32-bit MSB executable, 
SPARC32PLUS, V8+ Required, version 1 (SYSV), dynamically linked (uses shared 
libs), for GNU/Linux 2.6.26, 
BuildID[sha1]=0x06c16562047979adb84cd930e74723b3935b2cc8, not stripped

And the crash is still reproducible if it's run by hand:

jurij@debian:~/seed/seed-3.2.0/doc/modules/readline$ 
/home/jurij/seed/seed-3.2.0/src/.libs/lt-seed 
../../../doc/modules/make-functions.js ../../../doc/modules/readline/readline.js
Bus error

Now gdb will give you a backtrace:

jurij@debian:~/seed/seed-3.2.0/doc/modules/readline$ gdb 
/home/jurij/seed/seed-3.2.0/src/.libs/lt-seed
[...]
(gdb) run ../../../doc/modules/make-functions.js 
../../../doc/modules/readline/readline.js
Starting program: /home/jurij/seed/seed-3.2.0/src/.libs/lt-seed 
../../../doc/modules/make-functions.js 
../../../doc/modules/readline/readline.js
[Thread debugging using libthread_db enabled]
Using host libthread_db library 
"/lib/sparc-linux-gnu/libthread_db.so.1".
[New Thread 0xf60e7b70 (LWP 10943)]
[New Thread 0xf57c3b70 (LWP 10944)]

Program received signal SIGBUS, Bus error.
0xf7a6a400 in JSC::Lexer::lex(JSC::JSTokenData*, JSC::JSTokenInfo*, unsigned 
int, bool) () from /usr/lib/libjavascriptcoregtk-3.0.so.0
(gdb) bt
#0  0xf7a6a400 in JSC::Lexer::lex(JSC::JSTokenData*, JSC::JSTokenInfo*, 
unsigned int, bool) () from /usr/lib/libjavascriptcoregtk-3.0.so.0
#1  0xf7a58ef4 in JSC::ASTBuilder::Expression 
JSC::JSParser::parseMemberExpression(JSC::ASTBuilder&) () from 
/usr/lib/libjavascriptcoregtk-3.0.so.0
#2  0xf7a3deac in ?? () from /usr/lib/libjavascriptcoregtk-3.0.so.0
#3  0xf7a3deac in ?? () from /usr/lib/libjavascriptcoregtk-3.0.so.0
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

It's not a very useful one, but it points to 
libjavascriptcoregtk-3.0.so.0 as the culprit and there is a 
corresponding debug symbol package (libjavascriptcoregtk-3.0-0-dbg). 
Installing it and running the binary under gdb again produces a much 
more informative stack trace:

Program received signal SIGBUS, Bus error.
parseKeyword (data=0xceb0, this=0xf57faba0) at 
./Source/JavaScriptCore/KeywordLookup.h:201
201 ./Source/JavaScriptCore/KeywordLookup.h: No such file or directory.
(gdb) bt
#0  parseKeyword (data=0xceb0, this=0xf57faba0) at 
./Source/JavaScriptCore/KeywordLookup.h:201
#1  parseIdentifier (strictMode=false, lexType=0, tokenData=0xceb0, 
this=0xf57faba0) at ../Source/JavaScriptCore/parser/Lexer.cpp:435
#2  JSC::Lexer::lex (this=0xf57faba0, tokenData=0xceb0, 
tokenInfo=0xceb8, lexType=0, strictMode=false) at 
../Source/JavaScriptCore/parser/Lexer.cpp:1133
#3  0xf7a58ef4 in next (lexType=0, this=0xce60) at 
../Source/JavaScriptCore/parser/JSParser.cpp:118
#4  consume (flags=0, expected=JSC::OPENPAREN, this=0xce60) at 
../Source/JavaScriptCore/parser/JSParser.cpp:138
#5  parseArguments (context=..., this=0xce60) at 
../Source/JavaScriptCore/parser/JSParser.cpp:2250
[...]

'disassemble' command may be used to look up the assembler code around 
the instruction which caused the crash:

   0xf7a6a3f8 <+5368>:  be,pn   %icc, 0xf7a6c3f4 

   0xf7a6a3fc <+5372>:  sethi  %hi(0x72), %g3
=> 0xf7a6a400 <+5376>:  ld  [ %l0 ], %g1
   0xf7a6a404 <+5380>:  or  %g3, 0x65, %g4
   0xf7a6a408 <+5384>:  cmp  %g1, %g4

The offending instruction tries to load a 4-byte word located at 
address %l0 into %g1 register, so it's expected to be aligned on a 
4-byte boundary, however it is obviously not:

(gdb) info reg l0
l0 0xf581f42e   -176032722
(gdb)

Figuring out why this happens is the tricky part :-).

Best regards,
-- 
Jurij Smakov

How to debug seed FTBFS on sparc?

2012-02-23 Thread peter green

seed currently FTBFS on sparc with a bus error.

I've reproduced this on a sparc box that Tom Theisen made available 
(thanks tom) but i'm kinda stuck on how to debug it.


Any ideas on how to debug this? Normally i'd start by turning down the 
optimisation but this package doesn't seem to be using any in the first 
place. I tried to use gdb but ran into issues with the libtool wrapper 
scripts.



--
To UNSUBSCRIBE, email to debian-sparc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4f461555.4030...@postgrad.manchester.ac.uk