Bug#813452: fpc-3.0 regression in armhf and armel architectures

2016-02-27 Thread Gianfranco Costamagna
control: retitle -1 fpc can not build -fPIC with -O2 on arm*
control: severity -1 important
control: tags -1 fixed-upstream

I was wondering the same :)

cheers,

G.



Processed: Re: Bug#813452: fpc-3.0 regression in armhf and armel architectures

2016-02-27 Thread Debian Bug Tracking System
Processing control commands:

> retitle -1 fpc can not build -fPIC with -O2 on arm*
Bug #813452 [src:fpc] fpc-3.0 regression in armhf and armel architectures
Changed Bug title to 'fpc can not build -fPIC with -O2 on arm*' from 'fpc-3.0 
regression in armhf and armel architectures'
> severity -1 important
Bug #813452 [src:fpc] fpc can not build -fPIC with -O2 on arm*
Severity set to 'important' from 'serious'
> tags -1 fixed-upstream
Bug #813452 [src:fpc] fpc can not build -fPIC with -O2 on arm*
Added tag(s) fixed-upstream.

-- 
813452: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=813452
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems



Bug#813452: fpc-3.0 regression in armhf and armel architectures

2016-02-27 Thread Paul Gevers
Hi Gianfranco,

On 27-02-16 13:11, Gianfranco Costamagna wrote:
> confirmed, with 3.1.1 on trunk I built it successfully.

Great.

> Do you think you can backport a patch?

Once the required code has been found. Abou requested help from upstream
to identify it.

> I also tried to build with the current fpc and no fPIC for the pascal part, 
> and the build is successful.
> 
> actually fPIC was broken also before, according to the Cmake file
> if(${CMAKE_Pascal_COMPILER_VERSION} VERSION_GREATER 2.7 OR 
> ${CMAKE_TARGET_ARCHITECTURES} MATCHES "x86_64" OR 
> ${CMAKE_TARGET_ARCHITECTURES} MATCHES "i386")
> add_flag_append(CMAKE_Pascal_FLAGS "-fPIC")
> endif()
> 
> 
> so, disabling it again is not a "real" regression :)

Hmm, that also means we can lower the severity of this bug (no
regression) and have it migrate to testing, agreed? I would leave this
bug as important, but still have fpc 3 migrate to testing. Is anybody
objecting?

Proposal:
control: retitle -1 fpc can not build -fPIC with -O2 on arm*
control: severity -1 important
control: tags -1 fixed-upstream

Paul



signature.asc
Description: OpenPGP digital signature


Bug#813452: fpc-3.0 regression in armhf and armel architectures

2016-02-27 Thread Gianfranco Costamagna
Hi,

>Trunk is already at 3.1.1. So you apparently did not get trunk this way.


wrong link is wrong :)
>And Abou in the message before yours to this bug report already showed
>that the issue with fprint IS fixed in trunk.


confirmed, with 3.1.1 on trunk I built it successfully.

Do you think you can backport a patch?



I also tried to build with the current fpc and no fPIC for the pascal part, and 
the build is successful.

actually fPIC was broken also before, according to the Cmake file
if(${CMAKE_Pascal_COMPILER_VERSION} VERSION_GREATER 2.7 OR 
${CMAKE_TARGET_ARCHITECTURES} MATCHES "x86_64" OR ${CMAKE_TARGET_ARCHITECTURES} 
MATCHES "i386")
add_flag_append(CMAKE_Pascal_FLAGS "-fPIC")
endif()


so, disabling it again is not a "real" regression :)

let me know, and thanks for all the support, this time compiling fpc was really 
faster :)

(harris.d.o has the built deb files if you want to give them a try)

cheers,

G.



Bug#813452: fpc-3.0 regression in armhf and armel architectures

2016-02-26 Thread Paul Gevers
Hi Gianfranco,

On 26-02-16 10:53, Gianfranco Costamagna wrote:
> fpc 
> Free Pascal Compiler version 3.0.1+dfsg-1 [2016/02/25] for arm
> Copyright (c) 1993-2015 by Florian Klaempfl and others
> /usr/bin/fpc-3.0.1 [options]  [options]
> 
> so fPIC seems to be *not* fixed in current trunk (unless I did something 
> seriously wrong).
> Moreover current trunk doesn't build :)

Trunk is already at 3.1.1. So you apparently did not get trunk this way.

And Abou in the message before yours to this bug report already showed
that the issue with fprint IS fixed in trunk.

Paul



signature.asc
Description: OpenPGP digital signature


Bug#813452: [Pkg-pascal-devel] Bug#813452: [Core] Bug#813452: Bug#813452: fpc-3.0 regression in armhf and armel architectures

2016-02-26 Thread Gianfranco Costamagna
Hi

>I'm not sure but if you checkout (untar) a snpashot on abel.debian.org and 
>just run make all it would work.

I did:
wget ftp://ftp.freepascal.org/pub/fpc/snapshot/fixes/source/fpcbuild.zip

unzip fpcbuild.zip
cd fpcsrc
make all.

the builds fails with 

as  -o 
/home/locutusofborg/fpc-3.1~alpha+dfsg/fpcsrc/rtl/units/arm-linux/ucprt0.o 
arm/ucprt0.as
/usr/bin/ppcarm -Ur -Ur -Xs -O2 -n -Fi../inc -Fi../arm -Fi../unix -Fiarm -FE. 
-FU/home/locutusofborg/fpc-3.1~alpha+dfsg/fpcsrc/rtl/units/arm-linux -darm 
-dRELEASE -Us -Sg system.pp
arm.inc(18,2) Error: Illegal assembler style specified "GAS"
system.inc(1824,8) Warning: Implicit string type conversion from 
"RawByteString" to "UnicodeString"


I tried also to patch the debian packaging to work with the latest trunk and 
I'm attaching it)
the packaging didn't change too much, just an arm64 patch deleted, and some 
patch refresh.
amd64 build went fine, so this seems to be an armhf regression.


>Normally you need to checkout the fpcbuild repository and just replace debian 
>folder by the one from our git. If things did not diverge too much it should 
>work.
>I'll see if this works for amd64 and puch the changes.
the problem is on armel and armhf, so I'm trying the latter, that should be 
faster :)
let me know if you have some more fixes to test,

I deleted line 18 on arm.inc and restarted the build.

with the newly shiny built fpc 3.0.1 I did a rebuild of hedgewars on my local 
pbuilder-dist armhf chroot.

same result.

make[1]: Entering directory '/hedgewars-0.9.22-dfsg/obj-arm-linux-gnueabihf'
Running tests...
/usr/bin/ctest --force-new-ctest-process -j1
Test project /hedgewars-0.9.22-dfsg/obj-arm-linux-gnueabihf
Start 1: drillrockets_drill.lua
1/6 Test #1: drillrockets_drill.lua ...***Failed0.33 sec
An unhandled exception occurred at $000C054C:
EInOutError: File not open
$000C054C  WriteLn,  line 467 of /hedgewars-0.9.22-dfsg/hedgewars/uUtils.pas


Start 2: drillrockets_boom.lua
2/6 Test #2: drillrockets_boom.lua ***Failed0.22 sec
An unhandled exception occurred at $000C054C:
EInOutError: File not open
$000C054C  WriteLn,  line 467 of /hedgewars-0.9.22-dfsg/hedgewars/uUtils.pas


Start 3: twothousandmines.lua
3/6 Test #3: twothousandmines.lua .***Failed0.22 sec
An unhandled exception occurred at $000C054C:
EInOutError: File not open
$000C054C  WriteLn,  line 467 of /hedgewars-0.9.22-dfsg/hedgewars/uUtils.pas


Start 4: hellfire_burns.lua
4/6 Test #4: hellfire_burns.lua ...***Failed0.23 sec
An unhandled exception occurred at $000C054C:
EInOutError: File not open
$000C054C  WriteLn,  line 467 of /hedgewars-0.9.22-dfsg/hedgewars/uUtils.pas


Start 5: luaAPI/zoom_get_set.lua
5/6 Test #5: luaAPI/zoom_get_set.lua ..***Failed0.22 sec
An unhandled exception occurred at $000C054C:
EInOutError: File not open
$000C054C  WriteLn,  line 467 of /hedgewars-0.9.22-dfsg/hedgewars/uUtils.pas


Start 6: luaAPI/gravity_get_set.lua
6/6 Test #6: luaAPI/gravity_get_set.lua ...***Failed0.22 sec
An unhandled exception occurred at $000C054C:
EInOutError: File not open
$000C054C  WriteLn,  line 467 of /hedgewars-0.9.22-dfsg/hedgewars/uUtils.pas



0% tests passed, 6 tests failed out of 6

Total Test time (real) =   1.48 sec

The following tests FAILED:
1 - drillrockets_drill.lua (Failed)
2 - drillrockets_boom.lua (Failed)
3 - twothousandmines.lua (Failed)
4 - hellfire_burns.lua (Failed)
5 - luaAPI/zoom_get_set.lua (Failed)
6 - luaAPI/gravity_get_set.lua (Failed)
Errors while running CTest
Makefile:129: recipe for target 'test' failed
make[1]: *** [test] Error 8
make[1]: Leaving directory '/hedgewars-0.9.22-dfsg/obj-arm-linux-gnueabihf'
dh_auto_test: make -j1 test ARGS+=-j1 returned exit code 2


fpc 
Free Pascal Compiler version 3.0.1+dfsg-1 [2016/02/25] for arm
Copyright (c) 1993-2015 by Florian Klaempfl and others
/usr/bin/fpc-3.0.1 [options]  [options]

so fPIC seems to be *not* fixed in current trunk (unless I did something 
seriously wrong).
Moreover current trunk doesn't build :)

cheers,
HTH

G.

fpc_3.0.1~alpha+dfsg-1.debian.tar.xz
Description: application/xz


Bug#813452: [Pkg-pascal-devel] Bug#813452: [Core] Bug#813452: Bug#813452: fpc-3.0 regression in armhf and armel architectures

2016-02-25 Thread Abou Al Montacir
Hi Sven,
On Mon, 2016-02-22 at 17:44 +0100, Abou Al Montacir wrote:
> Hi Sven
> 
> On Mon, 2016-02-22 at 07:58 +0100, Sven Barth wrote:
> > >  Looks like PIC code was broken in 3.0. Is there anyone aware of that? How
> > can we fix that?
> > >
> > Would you please try the current development version of FPC (3.1.1) to check
> > whether the issue persists there?
> Yes, sure I'll do and let you know.
I've tested the FPC trunk and it works well. Here is the log of both wersions:
(sid_armel-dchroot)abou@abel:~/hedgewars-0.9.22-dfsg/obj-arm-linux-gnueabi/hedgewars$
 fpc -fPIC test2 && ./test2
Free Pascal Compiler version 3.0.0+dfsg-2 [2016/01/28] for arm
Copyright (c) 1993-2015 by Florian Klaempfl and others
Target OS: Linux for ARMEL
Compiling test2.pas
Assembling test
Linking test2
/usr/bin/ld.bfd: warning: link.res contains output sections; did you forget -T?
4 lines compiled, 0.3 sec
Runtime error 103 at $000101D8
  $000101D8
  $00010124
(sid_armel-dchroot)abou@abel:~/hedgewars-0.9.22-dfsg/obj-arm-linux-gnueabi/hedgewars$
 /home/abou/fpc-3.1.1/fpc-3.1.1/build/fpc-3.1.1/fpcsrc/compiler/ppcarm 
-Fu/home/abou/fpc-3.1.1/fpc-3.1.1/build/fpc-3.1.1/fpcsrc/ 
-Fu/home/abou/fpc-3.1.1/fpc-3.1.1/build/fpc-3.1.1/fpcsrc/rtl/units/arm-linux 
-fPIC test2 && ./test2
Free Pascal Compiler version 3.1.1-0 [2016/02/24] for arm
Copyright (c) 1993-2015 by Florian Klaempfl and others
Target OS: Linux for ARMEL
Compiling test2.pas
Linking test2
4 lines compiled, 0.2 sec
Hello
(sid_armel-dchroot)abou@abel:~/hedgewars-0.9.22-dfsg/obj-arm-linux-gnueabi/hedgewars$
 
This shows that the issue was fixed in trunk. Can you please help finding the 
revision that may fixed that so we can extract a patch and fix 3.0.0?
As long as this bug is open, fpc transition to testing is blocked and this is 
quite unpleasing for many of our users.
-- 
Cheers,
Abou Al Montacir

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


Bug#813452: [Pkg-pascal-devel] Bug#813452: [Core] Bug#813452: Bug#813452: fpc-3.0 regression in armhf and armel architectures

2016-02-23 Thread Abou Al Montacir
Hi Paul, Hi Gianfranco,

On Tue, 2016-02-23 at 20:39 +0100, Paul Gevers wrote:
> Hi Gianfranco,
> 
> On 23-02-16 17:18, Gianfranco Costamagna wrote:
> > Paul do you have any way to upload a deb file somewhere? (even experimental
> > would be awesome)
I'm not sure but if you checkout (untar) a snpashot on abel.debian.org and just
run make all it would work.
I can try to provide a binary, but you will also need RTL.
As Paul said, making .deb is probably much more complicated.
> Not anytime soon. Getting snapshots into a shape suitable for building
> 

That answers my question in the other mail.
> packages was a not so nice experience when Graham and I tried to debug
> the relro issue on arm* in the summer of 2015 (I didn't manage before
> 3.0.0~rc1 was released). We/I don't have a working way-of-working yet,
> so I like to postpone that until close to a new release.

I used to keep FPC trunk able to generate .deb snapshots, but I have les and
less time to do that.
Normally you need to checkout the fpcbuild repository and just replace debian
folder by the one from our git. If things did not diverge too much it should
work.
I'll see if this works for amd64 and puch the changes.
-- 
Cheers,
Abou Al Montacir


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


Bug#813452: [Pkg-pascal-devel] [Core] Bug#813452: Bug#813452: fpc-3.0 regression in armhf and armel architectures

2016-02-23 Thread Paul Gevers
Hi Gianfranco,

On 23-02-16 17:18, Gianfranco Costamagna wrote:
> Paul do you have any way to upload a deb file somewhere? (even experimental 
> would be awesome)

Not anytime soon. Getting snapshots into a shape suitable for building
packages was a not so nice experience when Graham and I tried to debug
the relro issue on arm* in the summer of 2015 (I didn't manage before
3.0.0~rc1 was released). We/I don't have a working way-of-working yet,
so I like to postpone that until close to a new release.

Paul



signature.asc
Description: OpenPGP digital signature


Bug#813452: [Core] [Pkg-pascal-devel] Bug#813452: Bug#813452: fpc-3.0 regression in armhf and armel architectures

2016-02-23 Thread Gianfranco Costamagna
Hi,
>
>Would you please try the current development version of FPC (3.1.1) to check 
>whether the issue persists there?


I would really appreciate some armhf/armel builds because last time I tried I 
really had troubles in compiling it for arm,
and with qemu even some segfaults (IIRC).

Paul do you have any way to upload a deb file somewhere? (even experimental 
would be awesome)

thanks!

Gianfranco



Bug#813452: [Pkg-pascal-devel] Bug#813452: [Core] Bug#813452: Bug#813452: fpc-3.0 regression in armhf and armel architectures

2016-02-22 Thread Abou Al Montacir
Hi Sven
On Mon, 2016-02-22 at 07:58 +0100, Sven Barth wrote:
> >  Looks like PIC code was broken in 3.0. Is there anyone aware of that? How
> can we fix that?
> >
> Would you please try the current development version of FPC (3.1.1) to check
> whether the issue persists there?
Yes, sure I'll do and let you know.
-- 
Cheers,
Abou Al Montacir

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


Bug#813452: [Core] [Pkg-pascal-devel] Bug#813452: Bug#813452: fpc-3.0 regression in armhf and armel architectures

2016-02-21 Thread Sven Barth
Am 22.02.2016 07:16 schrieb "Abou Al Montacir" :
>
> I finally managed to find the wrong option! It is -fPIC.
> Below are  tests with only -fPIC and with only -O2.
>
> (sid_armel-dchroot)abou@abel:~/hedgewars-0.9.22-dfsg/obj-arm-linux-gnueabi/hedgewars$
fpc -fPIC test2 && ./test2
>
> Free Pascal Compiler version 3.0.0+dfsg-2 [2016/01/28] for arm
>
> Copyright (c) 1993-2015 by Florian Klaempfl and others
>
> Target OS: Linux for ARMEL
>
> Compiling test2.pas
>
> Assembling test
>
> Linking test2
>
> /usr/bin/ld.bfd: warning: link.res contains output sections; did you
forget -T?
>
> 4 lines compiled, 0.3 sec
>
> Runtime error 103 at $000101D8
>
>   $000101D8
>
>   $00010124
>
>
> (sid_armel-dchroot)abou@abel:~/hedgewars-0.9.22-dfsg/obj-arm-linux-gnueabi/hedgewars$
fpc -O2 test2 && ./test2
>
> Free Pascal Compiler version 3.0.0+dfsg-2 [2016/01/28] for arm
>
> Copyright (c) 1993-2015 by Florian Klaempfl and others
>
> Target OS: Linux for ARMEL
>
> Compiling test2.pas
>
> Assembling test
>
> Linking test2
>
> /usr/bin/ld.bfd: warning: link.res contains output sections; did you
forget -T?
>
> 4 lines compiled, 0.3 sec
>
> Hello
>
> (sid_armel-dchroot)abou@abel
:~/hedgewars-0.9.22-dfsg/obj-arm-linux-gnueabi/hedgewars$
>
>
>  Looks like PIC code was broken in 3.0. Is there anyone aware of that?
How can we fix that?
>

Would you please try the current development version of FPC (3.1.1) to
check whether the issue persists there?

Regards,
Sven


Bug#813452: [Pkg-pascal-devel] Bug#813452: Bug#813452: fpc-3.0 regression in armhf and armel architectures

2016-02-21 Thread Abou Al Montacir
Dear All,
On Mon, 2016-02-22 at 00:32 +0100, Abou Al Montacir wrote:
> Hi Paul,
> 
> On Wed, 2016-02-17 at 22:26 +0100, Paul Gevers wrote:
> > Hmm, I was a tiny little bit wrong earlier.
> > 
> > I modified hedgewars a tiny bit (patch attached) and build in on
> > debomatic¹. You can see that the failing line reads:
> > "Lua test file specified: /<>/tests/lua/hellfire_burns.lua"
> ...
> > Anyways, it now fails for an access violation. I don't like this at all,
> > but it is hard to say if this is a fpc error or hedgewars'.
> I've tried some simpler code and it looks like the compilation options used by
> hedgewars cause the issue. I don't know if this is normal or not but at least
> we know now that it is not an issue in the code itself but rather in the
> compilation flags.
> 
> I'm copying FPC core in case some one can help with the impact of the used
> compilation flags.
> 
> Here are my experimentation:
> I first created very small programs:
> (sid_armel-dchroot)abou@abel:~/hedgewars-0.9.22-dfsg/obj-arm-linux-
> gnueabi/hedgewars$ cat test1.pas 
> program test;
> begin
> WriteLn('Hello');
> end.
> (sid_armel-dchroot)abou@abel:~/hedgewars-0.9.22-dfsg/obj-arm-linux-
> gnueabi/hedgewars$ cat test2.pas 
> program test;
> begin
> WriteLn(stdout, 'Hello');
> end.
> (sid_armel-dchroot)abou@abel:~/hedgewars-0.9.22-dfsg/obj-arm-linux-
> gnueabi/hedgewars$ 
> 
> I first compile using no special flags and both programs execute well:
> (sid_armel-dchroot)abou@abel:~/hedgewars-0.9.22-dfsg/obj-arm-linux-
> gnueabi/hedgewars$ fpc test1
> Free Pascal Compiler version 3.0.0+dfsg-2 [2016/01/28] for arm
> Copyright (c) 1993-2015 by Florian Klaempfl and others
> Target OS: Linux for ARMEL
> Compiling test1.pas
> Assembling test
> Linking test1
> /usr/bin/ld.bfd: warning: link.res contains output sections; did you forget
> -T?
> 4 lines compiled, 0.3 sec
> (sid_armel-dchroot)abou@abel:~/hedgewars-0.9.22-dfsg/obj-arm-linux-
> gnueabi/hedgewars$ ./test1
> Hello
> (sid_armel-dchroot)abou@abel:~/hedgewars-0.9.22-dfsg/obj-arm-linux-
> gnueabi/hedgewars$ fpc test2
> Free Pascal Compiler version 3.0.0+dfsg-2 [2016/01/28] for arm
> Copyright (c) 1993-2015 by Florian Klaempfl and others
> Target OS: Linux for ARMEL
> Compiling test2.pas
> Assembling test
> Linking test2
> /usr/bin/ld.bfd: warning: link.res contains output sections; did you forget
> -T?
> 4 lines compiled, 0.3 sec
> (sid_armel-dchroot)abou@abel:~/hedgewars-0.9.22-dfsg/obj-arm-linux-
> gnueabi/hedgewars$ ./test2
> Hello
> 
> Now, we use a subset of compilation flags from hedgewars and we can just
> reproduce the issue on second program but not the first one:
> (sid_armel-dchroot)abou@abel:~/hedgewars-0.9.22-dfsg/obj-arm-linux-
> gnueabi/hedgewars$ fpc -FU/home/abou/hedgewars-0.9.22-dfsg/obj-arm-linux-
> gnueabi/hedgewars/CMakeFiles/hwengine.dir -k-rpath
> -k'\$ORIGIN/../lib/:\$ORIGIN/:/usr/lib/hedgewars/lib/' -FD/usr/bin -Cs200
> -fPIC -Fl/home/abou/hedgewars-0.9.22-dfsg/obj-arm-linux-gnueabi/bin -k-
> L/usr/lib/arm-linux-gnueabi -Fl/usr/lib/arm-linux-gnueabi -Fl/usr/lib/arm-
> linux-gnueabi -XLAlua=lua5.1 -Fl/usr/lib/arm-linux-gnueabi/libphysfs.so -O2 -g
> -gl -gp   -dUSE_VIDEO_RECORDING -dPNG_SCREENSHOTS -dSDL_MIXER_NEWER
> -dSDL_IMAGE_NEWER -dDEBUGFILE  test1
> Free Pascal Compiler version 3.0.0+dfsg-2 [2016/01/28] for arm
> Copyright (c) 1993-2015 by Florian Klaempfl and others
> Target OS: Linux for ARMEL
> Compiling test1.pas
> Assembling test
> Linking test1
> /usr/bin/ld.bfd: warning: link.res contains output sections; did you forget
> -T?
> 4 lines compiled, 0.3 sec
> (sid_armel-dchroot)abou@abel:~/hedgewars-0.9.22-dfsg/obj-arm-linux-
> gnueabi/hedgewars$ ./test1
> Hello
> (sid_armel-dchroot)abou@abel:~/hedgewars-0.9.22-dfsg/obj-arm-linux-
> gnueabi/hedgewars$ fpc -FU/home/abou/hedgewars-0.9.22-dfsg/obj-arm-linux-
> gnueabi/hedgewars/CMakeFiles/hwengine.dir -k-rpath
> -k'\$ORIGIN/../lib/:\$ORIGIN/:/usr/lib/hedgewars/lib/' -FD/usr/bin -Cs200
> -fPIC -Fl/home/abou/hedgewars-0.9.22-dfsg/obj-arm-linux-gnueabi/bin -k-
> L/usr/lib/arm-linux-gnueabi -Fl/usr/lib/arm-linux-gnueabi -Fl/usr/lib/arm-
> linux-gnueabi -XLAlua=lua5.1 -Fl/usr/lib/arm-linux-gnueabi/libphysfs.so -O2 -g
> -gl -gp   -dUSE_VIDEO_RECORDING -dPNG_SCREENSHOTS -dSDL_MIXER_NEWER
> -dSDL_IMAGE_NEWER -dDEBUGFILE  test2
> Free Pascal Compiler version 3.0.0+dfsg-2 [2016/01/28] for arm
> Copyright (c) 1993-2015 by Florian Klaempfl and others
> Target OS: Linux for ARMEL
> Compiling test2.pas
> Assembling test
> Linking test2
> /usr/bin/ld.bfd: warning: link.res contains output sections; did you forget
> -T?
> 4 lines compiled, 0.3 sec
> (sid_armel-dchroot)abou@abel:~/hedgewars-0.9.22-dfsg/obj-arm-linux-
> gnueabi/hedgewars$ ./test2
> Runtime error 103 at $000101C8
>   $000101C8  $main,  line 3 of test2.pas
> 
> It is not clear for me why RTE 103 is thrown, in the second case but not in
> the first one. I'd expect either both work or neither. Also I don't see what
> is the impact of 

Bug#813452: [Pkg-pascal-devel] Bug#813452: fpc-3.0 regression in armhf and armel architectures

2016-02-21 Thread Abou Al Montacir
Hi Paul,

On Wed, 2016-02-17 at 22:26 +0100, Paul Gevers wrote:
> Hmm, I was a tiny little bit wrong earlier.
> 
> I modified hedgewars a tiny bit (patch attached) and build in on
> debomatic¹. You can see that the failing line reads:
> "Lua test file specified: /<>/tests/lua/hellfire_burns.lua"
...
> Anyways, it now fails for an access violation. I don't like this at all,
> but it is hard to say if this is a fpc error or hedgewars'.
I've tried some simpler code and it looks like the compilation options used by
hedgewars cause the issue. I don't know if this is normal or not but at least we
know now that it is not an issue in the code itself but rather in the
compilation flags.
I'm copying FPC core in case some one can help with the impact of the used
compilation flags.
Here are my experimentation:
I first created very small programs:
(sid_armel-dchroot)abou@abel:~/hedgewars-0.9.22-dfsg/obj-arm-linux-
gnueabi/hedgewars$ cat test1.pas 
program test;
begin
WriteLn('Hello');
end.
(sid
_armel-dchroot)abou@abel:~/hedgewars-0.9.22-dfsg/obj-arm-linux-
gnueabi/hedgewars$ cat test2.pas 
program test;
begin
WriteLn(stdout, 'Hello');
end.
(sid_armel-dchroot)abou@abel:~/hedgewars-0.9.22-dfsg/obj-arm-linux-
gnueabi/hedgewars$ 
I first compile using no special flags and both programs execute well:
(sid_armel-dchroot)abou@abel:~/hedgewars-0.9.22-dfsg/obj-arm-linux-gnueabi/hedgewars$
 fpc test1
Free Pascal Compiler version 3.0.0+dfsg-2 [2016/01/28] for arm
Copyright (c) 1993-2015 by Florian Klaempfl and others
Target OS: Linux for ARMEL
Compiling test1.pas
Assembling test
Linking test1
/usr/bin/ld.bfd: warning: link.res contains output sections; did you forget -T?
4 lines compiled, 0.3 sec
(sid_armel-dchroot)abou@abel:~/hedgewars-0.9.22-dfsg/obj-arm-linux-gnueabi/hedgewars$
 ./test1
Hello
(sid_armel-dchroot)abou@abel:~/hedgewars-0.9.22-dfsg/obj-arm-linux-gnueabi/hedgewars$
 fpc test2
Free Pascal Compiler version 3.0.0+dfsg-2 [2016/01/28] for arm
Copyright (c) 1993-2015 by Florian Klaempfl and others
Target OS: Linux for ARMEL
Compiling test2.pas
Assembling test
Linking test2
/usr/bin/ld.bfd: warning: link.res contains output sections; did you forget -T?
4 lines compiled, 0.3 sec
(sid_armel-dchroot)abou@abel:~/hedgewars-0.9.22-dfsg/obj-arm-linux-gnueabi/hedgewars$
 ./test2
Hello
Now, we use a subset of compilation flags from hedgewars and we can just
reproduce the issue on second program but not the first one:
(sid_armel-dchroot)abou@abel:~/hedgewars-0.9.22-dfsg/obj-arm-linux-gnueabi/hedgewars$
 fpc 
-FU/home/abou/hedgewars-0.9.22-dfsg/obj-arm-linux-gnueabi/hedgewars/CMakeFiles/hwengine.dir
 -k-rpath -k'\$ORIGIN/../lib/:\$ORIGIN/:/usr/lib/hedgewars/lib/' -FD/usr/bin 
-Cs200 -fPIC -Fl/home/abou/hedgewars-0.9.22-dfsg/obj-arm-linux-gnueabi/bin 
-k-L/usr/lib/arm-linux-gnueabi -Fl/usr/lib/arm-linux-gnueabi 
-Fl/usr/lib/arm-linux-gnueabi -XLAlua=lua5.1 
-Fl/usr/lib/arm-linux-gnueabi/libphysfs.so -O2 -g -gl -gp   
-dUSE_VIDEO_RECORDING -dPNG_SCREENSHOTS -dSDL_MIXER_NEWER -dSDL_IMAGE_NEWER 
-dDEBUGFILE  test1
Free Pascal Compiler version 3.0.0+dfsg-2 [2016/01/28] for arm
Copyright (c) 1993-2015 by Florian Klaempfl and others
Target OS: Linux for ARMEL
Compiling test1.pas
Assembling test
Linking test1
/usr/bin/ld.bfd: warning: link.res contains output sections; did you forget -T?
4 lines compiled, 0.3 sec
(sid_armel-dchroot)abou@abel:~/hedgewars-0.9.22-dfsg/obj-arm-linux-gnueabi/hedgewars$
 ./test1
Hello
(sid_armel-dchroot)abou@abel:~/hedgewars-0.9.22-dfsg/obj-arm-linux-gnueabi/hedgewars$
 fpc 
-FU/home/abou/hedgewars-0.9.22-dfsg/obj-arm-linux-gnueabi/hedgewars/CMakeFiles/hwengine.dir
 -k-rpath -k'\$ORIGIN/../lib/:\$ORIGIN/:/usr/lib/hedgewars/lib/' -FD/usr/bin 
-Cs200 -fPIC -Fl/home/abou/hedgewars-0.9.22-dfsg/obj-arm-linux-gnueabi/bin 
-k-L/usr/lib/arm-linux-gnueabi -Fl/usr/lib/arm-linux-gnueabi 
-Fl/usr/lib/arm-linux-gnueabi -XLAlua=lua5.1 
-Fl/usr/lib/arm-linux-gnueabi/libphysfs.so -O2 -g -gl -gp   
-dUSE_VIDEO_RECORDING -dPNG_SCREENSHOTS -dSDL_MIXER_NEWER -dSDL_IMAGE_NEWER 
-dDEBUGFILE  test2
Free Pascal Compiler version 3.0.0+dfsg-2 [2016/01/28] for arm
Copyright (c) 1993-2015 by Florian Klaempfl and others
Target OS: Linux for ARMEL
Compiling test2.pas
Assembling test
Linking test2
/usr/bin/ld.bfd: warning: link.res contains output sections; did you forget -T?
4 lines compiled, 0.3 sec
(sid_armel-dchroot)abou@abel:~/hedgewars-0.9.22-dfsg/obj-arm-linux-gnueabi/hedgewars$
 ./test2
Runtime error 103 at $000101C8
  $000101C8  $main,  line 3 of test2.pas
It is not clear for me why RTE 103 is thrown, in the second case but not in the
first one. I'd expect either both work or neither. Also I don't see what is the
impact of the compilation flags that are used. Maybe I should perform more
experimentations in order to find a smaller subset. but that will be enough for
tonight!
-- 
Cheers,
Abou Al Montacir


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


Bug#813452: fpc-3.0 regression in armhf and armel architectures

2016-02-17 Thread Paul Gevers
Hmm, I was a tiny little bit wrong earlier.

I modified hedgewars a tiny bit (patch attached) and build in on
debomatic¹. You can see that the failing line reads:
"Lua test file specified: /<>/tests/lua/hellfire_burns.lua"

When I grep for the beginning of that line I get only one answer:
paul@ruapehu ~/tmp/packages/hedgewars $ rgrep "Lua test file specified" *
hedgewars/ArgParsers.pas:{--lua-test}35 : begin
cTestLua := true; SetSound(false); cScriptName :=
getstringParameter(arg, paramIndex, parseParameter); WriteLn(stdout,
'Lua test file specified: ' + cScriptName);end;

So it wasn't stderr, but stdout.

Anyways, it now fails for an access violation. I don't like this at all,
but it is hard to say if this is a fpc error or hedgewars'.

Paul

¹
http://debomatic-armhf.debian.net/distribution#unstable/hedgewars/0.9.22-dfsg-4+debug+elbrus/buildlog
Description: Writeln inside try/except statement
Author: Paul Gevers 
X-Dgit-Generated: 0.9.22-dfsg-4+debug+elbrus 
ad588659e3d59e33080149b6ce14f2f6f64fd2de

---

--- hedgewars-0.9.22-dfsg.orig/hedgewars/uUtils.pas
+++ hedgewars-0.9.22-dfsg/hedgewars/uUtils.pas
@@ -464,7 +464,16 @@ end;
 
 procedure WriteLn(var f: textfile; s: shortstring);
 begin
-system.writeln(f, s)
+   {$I+}
+   try
+   system.writeln(f, s);
+   except
+   on E: EInOutError do
+   begin
+   system.writeln('File handling error occurred. Details: ', E.ClassName, 
'/', E.Message);
+   system.writeln(s);
+   end;
+   end
 end;
 
 function StrLength(s: PChar): Longword;


signature.asc
Description: OpenPGP digital signature


Bug#813452: [Pkg-pascal-devel] Bug#813452: fpc-3.0 regression in armhf and armel architectures

2016-02-17 Thread Gianfranco Costamagna
Hi Abou,


>I could notice in the build log on sid the following warnings:
>hwengine.pas(626) Warning: "crtbeginS.o" not found, this will probably cause a 
>linking failure
>hwengine.pas(626) Warning: "crtendS.o" not found, this will probably cause a 
>linking failure
>On the other hand these files seem to belong to libgcc-5-dev on my system
>$dpkg -S /usr/lib/gcc/x86_64-linux-gnu/5/crtbeginS.o
>libgcc-5-dev:amd64: /usr/lib/gcc/x86_64-linux-gnu/5/crtbeginS.o
>Can you please check if they are availables on the arm box you are using?

>

sure:

ls /usr/lib/gcc/arm-linux-gnueabihf/5/crt*S.o -l
-rw-r--r-- 1 root root 2424 Feb  6 17:23 
/usr/lib/gcc/arm-linux-gnueabihf/5/crtbeginS.o
-rw-r--r-- 1 root root 1100 Feb  6 17:23 
/usr/lib/gcc/arm-linux-gnueabihf/5/crtendS.o


(I'm doing the work under a qemu arm environment, but it shouldn't make any 
difference)


to reproduce:
pbuilder-dist sid armhf create
pbuilder-dist sid armhf login
install vim ubuntu-dev-tools wget liburi-perl
pull-debian-source hedgewars
dpkg-buildpackage it :)

>The reason I think these warnings are related is that stdin/stdout are open by 
>parent process so may be related to the C code initialization.
>

>I can probably be completely wrong, but let's check this first.-- 


I'm not sure if my answer helps actually, but I hope I did all the requested 
stuff correctly.

thanks a lot!


Gianfranco



Bug#813452: [Pkg-pascal-devel] Bug#813452: fpc-3.0 regression in armhf and armel architectures

2016-02-16 Thread Abou Al Montacir
Hi Gianfranco,
On Tue, 2016-02-02 at 08:09 +, Gianfranco Costamagna wrote:
> Source: fpc
> Version: 3.0.0+dfsg-2
> Severity: serious
> 
> 
> Hi, I open this ticket to discuss with you the regression I found on armel and
> armhf platforms
> in my hedgewars upload yesterday.
> 
> I checked in a stretch clean pbuilder environment (both logs are attached),
> and the testsuite runs correctly,
> the only sensible change has been the fpc upgrade, and this is the reason for
> this bug report.
> 
> Test project /build/hedgewars-0.9.22-dfsg/obj-arm-linux-gnueabihf
> Start 1: drillrockets_drill.lua
> 1/6 Test #1: drillrockets_drill.lua ...***Failed0.92 sec
> An unhandled exception occurred at $000C0300:
> EInOutError: File not open
> $000C0300  WriteLn,  line 467 of /build/hedgewars-0.9.22-
> dfsg/hedgewars/uUtils.pas
> 
> 
> the strange thing is that the affected line seems rather simple:
> procedure WriteLn(var f: textfile; s: shortstring);
> begin
> system.writeln(f, s)
> end;
> 
> 
> and the testsuite works perfectly on every other architecture, so I presume
> this is an fpc specific regression.
> (I can also ask to remove the hedgewars arm* architectures if needed)
I could notice in the build log on sid the following warnings:
hwengine.pas(626)
Warning: "crtbeginS.o" not found, this will probably cause a linking failure
hwen
gine.pas(626) Warning: "crtendS.o" not found, this will probably cause a linking
failure
On the other hand these files seem to belong to libgcc-5-dev on my system
$dpkg -S /usr/lib/gcc/x86_64-linux-gnu/5/crtbeginS.o
libgcc-5-dev:amd64:
/usr/lib/gcc/x86_64-linux-gnu/5/crtbeginS.o
Can you please check if they are availables on the arm box you are using?
The reason I think these warnings are related is that stdin/stdout are open by
parent process so may be related to the C code initialization.
I can probably be completely wrong, but let's check this first.
-- 
Cheers,
Abou Al Montacir

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


Bug#813452: [Pkg-pascal-devel] Bug#813452: Bug#813452: fpc-3.0 regression in armhf and armel architectures

2016-02-08 Thread Gianfranco Costamagna
Hi Paul and Abou,

First thanks for having a look at the problem :)
>The "file" it tries to open is stderr ;)


>I agree with that statement. Unless we find out that it never worked on
>arm*, we just have to fix whatever needs fixing.

sure, in general if you want to support arm* you would like to fix this issue.

I was saying instead:
"I'm not sure many people runs hedgewars on arm* architectures", so if you think
this is a corner case for some arm architecture, and consider not worth a fix, 
feel
free to close (I have no knowledge about the topic, so I'll accept your 
decision).

(but for sure, if there is a bug, fixing is always the best option)


cheers,

Gianfranco



Bug#813452: [Pkg-pascal-devel] Bug#813452: Bug#813452: fpc-3.0 regression in armhf and armel architectures

2016-02-05 Thread Paul Gevers
Hi Abou,
On 05-02-16 09:17, Abou Al Montacir wrote:
> Fine not open? Are you sure the Reset/ReWrite/... open function did not
> return an error? Maybe check IoResult after opening the file.
> Anyway this is strange as it would not worked before unless the OS
> backend open function use is not the same as in previous version.
> Can you please provide code snippet about when the file was open, which
> mode and so on?

The "file" it tries to open is stderr ;)

>> the strange thing is that the affected line seems rather simple:
>> procedure WriteLn(var f: textfile; s: shortstring);
>> begin
>> system.writeln(f, s)
>> end;
> I'm almost sure this is not the faulty code, but something before that
> made the file not correctly open.

The annoying thing is that on other archs it works and with fpc 2.6.4 it
works, so I agree with Gianfranco that it seems to be related to fpc
3.0.0. However, from my preliminary scan I couldn't find anything in fpc
on that low level that changed.

>> and the testsuite works perfectly on every other architecture, so I presume 
>> this is an fpc specific regression.
>> (I can also ask to remove the hedgewars arm* architectures if needed)
> I don't think we should remove any package form any arch, just be
> patient and fix the bug.

I agree with that statement. Unless we find out that it never worked on
arm*, we just have to fix whatever needs fixing.

Paul



signature.asc
Description: OpenPGP digital signature


Bug#813452: [Pkg-pascal-devel] Bug#813452: fpc-3.0 regression in armhf and armel architectures

2016-02-05 Thread Abou Al Montacir
Hi Gianfranco,
Glad to support such nice game as hedgewars.
On Tue, 2016-02-02 at 08:09 +, Gianfranco Costamagna wrote:
> Source: fpc
> Version: 3.0.0+dfsg-2
> Severity: serious
> 
> Hi, I open this ticket to discuss with you the regression I found on armel 
> and armhf platforms
> in my hedgewars upload yesterday.
> 

Was not aware that hedgewars was build depending on FPC. Nice to know so that
next time we can test before uploading a major release.
> I checked in a stretch clean pbuilder environment (both logs are attached), 
> and the testsuite runs correctly,
> the only sensible change has been the fpc upgrade, and this is the reason for 
> this bug report.
> 
> Test project /build/hedgewars-0.9.22-dfsg/obj-arm-linux-gnueabihf
> Start 1: drillrockets_drill.lua
> 1/6 Test #1: drillrockets_drill.lua ...***Failed0.92 sec
> An unhandled exception occurred at $000C0300:
> EInOutError: File not open
> $000C0300  WriteLn,  line 467 of 
> /build/hedgewars-0.9.22-dfsg/hedgewars/uUtils.pas
> 

Fine not open? Are you sure the Reset/ReWrite/... open function did not return
an error? Maybe check IoResult after opening the file.
Anyway this is strange as it would not worked before unless the OS backend open
function use is not the same as in previous version.
Can you please provide code snippet about when the file was open, which mode and
so on?
> the strange thing is that the affected line seems rather simple:
> procedure WriteLn(var f: textfile; s: shortstring);
> begin
> system.writeln(f, s)
> end;
> 

I'm almost sure this is not the faulty code, but something before that made the
file not correctly open.
> and the testsuite works perfectly on every other architecture, so I presume 
> this is an fpc specific regression.
> (I can also ask to remove the hedgewars arm* architectures if needed)
I don't think we should remove any package form any arch, just be patient and
fix the bug.
-- 
Cheers,
Abou Al Montacir

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