Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2010-11

SIGTERM problem

7 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Евгений Семенов (Evgeniy Semenov

Hello.

Help me anybody, please. My program runs on arm-linux system and when it receive SIGTERM i can't handle this signal, program instantly terminate. Can someone suggest to me, what's the problem? May be it bug? Or where i can see rtl code which handle linux signals. Exact same program normally handle SIGTERM signal on i386-linux system.

С Уважением, Евгений Семенов Best regards, Evgeniy Semenov.
Jonas Maebe
to Евгений Семенов (Evgeniy Semenov
Евгений Семенов wrote 6 lines
Help me anybody, please. My program runs on arm-linux system and when it receive SIGTERM i can't handle this signal, program instantly terminate. Can someone suggest to me, what's the problem? May be it bug? Or where i can see rtl code which handle linux signals. Exact same program normally handle SIGTERM signal on i386- linux system.

Which FPC version, which ARM-linux system (eabi, oabi), how was your compiler/rtl compiled?

Jonas

Евгений Семенов (Evgeniy Semenov
to Jonas Maebe

24.11.2010 12:25, Jonas Maebe пишет:

Show quoted text 11 lines
On 23 Nov 2010, at 22:01, Евгений Семенов (Evgeniy Semenov) wrote: > Help me anybody, please. My program runs on arm-linux system and when > it receive SIGTERM i can't handle this signal, program instantly > terminate. Can someone suggest to me, what's the problem? May be it > bug? Or where i can see rtl code which handle linux signals. Exact > same program normally handle SIGTERM signal on i386-linux system. Which FPC version, which ARM-linux system (eabi, oabi), how was your compiler/rtl compiled?

fpc 2.4.0 eabi linux

making crosscompiler

make all OS_TARGET=linux CPU_TARGET=arm
BINUTILSPREFIX=/home/sem/gcc/arm-none-linux-gnueabi/bin/ NOGDB=1 OPT='-O-' CROSSOPT='-Xd -CfSOFT -CaEABI -darm -dFPC_ARMEL -gl -O- -CpARMV5 -Fl/home/sem/gcc/arm-none-linux-gnueabi/libc/marvell-f/lib -Fl/home/sem/gcc/arm-none-linux-gnueabi/libc/marvell-f/usr/lib -Xr/home/sem/gcc/arm-none-linux-gnueabi/libc/marvell-f/lib' CROSSINSTALL=1 PREFIX=/usr

i tried to test my program compiled with fpc 2.5.1, program immediately crash after start. same result with 2.4.2.

Mark Morgan Lloyd
to Евгений Семенов (Evgeniy Semenov
Евгений Семенов wrote 27 lines
24.11.2010 12:25, Jonas Maebe пишет: > > On 23 Nov 2010, at 22:01, Евгений Семенов (Evgeniy Semenov) wrote: > >> Help me anybody, please. My program runs on arm-linux system and when >> it receive SIGTERM i can't handle this signal, program instantly >> terminate. Can someone suggest to me, what's the problem? May be it >> bug? Or where i can see rtl code which handle linux signals. Exact >> same program normally handle SIGTERM signal on i386-linux system. > > Which FPC version, which ARM-linux system (eabi, oabi), how was your > compiler/rtl compiled? fpc 2.4.0 eabi linux making crosscompiler make all OS_TARGET=linux CPU_TARGET=arm BINUTILSPREFIX=/home/sem/gcc/arm-none-linux-gnueabi/bin/ NOGDB=1 OPT='-O-' CROSSOPT='-Xd -CfSOFT -CaEABI -darm -dFPC_ARMEL -gl -O- -CpARMV5 -Fl/home/sem/gcc/arm-none-linux-gnueabi/libc/marvell-f/lib -Fl/home/sem/gcc/arm-none-linux-gnueabi/libc/marvell-f/usr/lib -Xr/home/sem/gcc/arm-none-linux-gnueabi/libc/marvell-f/lib' CROSSINSTALL=1 PREFIX=/usr i tried to test my program compiled with fpc 2.5.1, program immediately crash after start. same result with 2.4.2.

Do you have an example program (as short as possible) that demonstrates this? I've got 2.4.2 etc. running here and would be interested to try it.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]
Евгений Семенов (Evgeniy Semenov
to Mark Morgan Lloyd

25.11.2010 10:50, Mark Morgan Lloyd пишет:

Show quoted text 34 lines
Евгений Семенов (Evgeniy Semenov) wrote: > 24.11.2010 12:25, Jonas Maebe пишет: >> >> On 23 Nov 2010, at 22:01, Евгений Семенов (Evgeniy Semenov) wrote: >> >>> Help me anybody, please. My program runs on arm-linux system and >>> when it receive SIGTERM i can't handle this signal, program >>> instantly terminate. Can someone suggest to me, what's the problem? >>> May be it bug? Or where i can see rtl code which handle linux >>> signals. Exact same program normally handle SIGTERM signal on >>> i386-linux system. >> >> Which FPC version, which ARM-linux system (eabi, oabi), how was your >> compiler/rtl compiled? > > fpc 2.4.0 eabi linux > > making crosscompiler > > make all OS_TARGET=linux CPU_TARGET=arm > BINUTILSPREFIX=/home/sem/gcc/arm-none-linux-gnueabi/bin/ NOGDB=1 > OPT='-O-' CROSSOPT='-Xd -CfSOFT -CaEABI -darm -dFPC_ARMEL -gl -O- > -CpARMV5 -Fl/home/sem/gcc/arm-none-linux-gnueabi/libc/marvell-f/lib > -Fl/home/sem/gcc/arm-none-linux-gnueabi/libc/marvell-f/usr/lib > -Xr/home/sem/gcc/arm-none-linux-gnueabi/libc/marvell-f/lib' > CROSSINSTALL=1 PREFIX=/usr > > i tried to test my program compiled with fpc 2.5.1, program > immediately crash after start. same result with 2.4.2. Do you have an example program (as short as possible) that demonstrates this? I've got 2.4.2 etc. running here and would be interested to try it.

I'll make a test program later and post here.

С Уважением, Евгений Семенов Best regards, Evgeniy Semenov.
Jonas Maebe
to Евгений Семенов (Evgeniy Semenov: 24.11.2010 12:25, Jonas Maebe пишет: fpc 2.4.0 eabi linux making crosscompiler make…
Евгений Семенов wrote 16 lines
24.11.2010 12:25, Jonas Maebe пишет: > > On 23 Nov 2010, at 22:01, Евгений Семенов (Evgeniy > Semenov) wrote: > >> Help me anybody, please. My program runs on arm-linux system and >> when it receive SIGTERM i can't handle this signal, program >> instantly terminate. Can someone suggest to me, what's the >> problem? May be it bug? Or where i can see rtl code which handle >> linux signals. Exact same program normally handle SIGTERM signal >> on i386-linux system. > > Which FPC version, which ARM-linux system (eabi, oabi), how was > your compiler/rtl compiled? fpc 2.4.0 eabi linux

FPC 2.4.0 had broken return trampolines for signals on EABI. This was fixed in 2.4.2, but that version still contains a serious bug in the handling of syscalls with 5 parameters or more that causes random errors.

Show quoted text 8 lines
making crosscompiler make all OS_TARGET=linux CPU_TARGET=arm BINUTILSPREFIX=/home/sem/gcc/ arm-none-linux-gnueabi/bin/ NOGDB=1 OPT='-O-' CROSSOPT='-Xd -CfSOFT - CaEABI -darm -dFPC_ARMEL -gl -O- -CpARMV5 -Fl/home/sem/gcc/arm-none- linux-gnueabi/libc/marvell-f/lib -Fl/home/sem/gcc/arm-none-linux- gnueabi/libc/marvell-f/usr/lib -Xr/home/sem/gcc/arm-none-linux- gnueabi/libc/marvell-f/lib' CROSSINSTALL=1 PREFIX=/usr

You have to move -dFPC_ARMEL from CROSSOPT to OPT. The above command will compile an OABI cross-compiler.

Jonas

Евгений Семенов (Evgeniy Semenov
to Jonas Maebe

25.11.2010 12:47, Jonas Maebe пишет:

Show quoted text 41 lines
On 25 Nov 2010, at 01:28, Евгений Семенов (Evgeniy Semenov) wrote: > 24.11.2010 12:25, Jonas Maebe пишет: >> >> On 23 Nov 2010, at 22:01, Евгений Семенов (Evgeniy Semenov) wrote: >> >>> Help me anybody, please. My program runs on arm-linux system and >>> when it receive SIGTERM i can't handle this signal, program >>> instantly terminate. Can someone suggest to me, what's the problem? >>> May be it bug? Or where i can see rtl code which handle linux >>> signals. Exact same program normally handle SIGTERM signal on >>> i386-linux system. >> >> Which FPC version, which ARM-linux system (eabi, oabi), how was your >> compiler/rtl compiled? > > fpc 2.4.0 eabi linux FPC 2.4.0 had broken return trampolines for signals on EABI. This was fixed in 2.4.2, but that version still contains a serious bug in the handling of syscalls with 5 parameters or more that causes random errors. > making crosscompiler > > make all OS_TARGET=linux CPU_TARGET=arm > BINUTILSPREFIX=/home/sem/gcc/arm-none-linux-gnueabi/bin/ NOGDB=1 > OPT='-O-' CROSSOPT='-Xd -CfSOFT -CaEABI -darm -dFPC_ARMEL -gl -O- > -CpARMV5 -Fl/home/sem/gcc/arm-none-linux-gnueabi/libc/marvell-f/lib > -Fl/home/sem/gcc/arm-none-linux-gnueabi/libc/marvell-f/usr/lib > -Xr/home/sem/gcc/arm-none-linux-gnueabi/libc/marvell-f/lib' > CROSSINSTALL=1 PREFIX=/usr You have to move -dFPC_ARMEL from CROSSOPT to OPT. The above command will compile an OABI cross-compiler. Jonas_______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Thanks Jonas. I've corrected 'make' string, add -dFPC_ARMEL то OPT. Recompile application with fpc 2.4.2 and now it works, signal handling works fine. Thanks.

С Уважением, Евгений Семенов Best regards, Evgeniy Semenov.