Same code from LCL project throw error in console application

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Same code from LCL project throw error in console application

Krzysztof
Hi,

I have strange issue. Simple mpg123 player which work fine on LCL project, on console application throw floating error in line "mh_e := mpg123_read(mh, @outbuf[0], buffer_size, done);"

Here you can download demo:

You find two projects in zip file. LCL and console.

Before you run project:
1. Copy shared libs from libs folder for your OS (I attached for linux only) into project folder
2. Copy "Michita - Aurapporo.MP3" into your project folder

When you run console application it should play music and crash at 10 second. Please ignore code style etc. I just copied and modified source from my original project

Regards

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Same code from LCL project throw error in console application

José Mejuto
El 16/04/2013 21:23, Krzysztof escribió:
> Hi,
>
> I have strange issue. Simple mpg123 player which work fine on LCL
> project, on console application throw floating error in line "mh_e :=
> mpg123_read(mh, @outbuf[0], buffer_size, done);"

Hello,

I'm not sure but I think that the GTK2 Widgetset disables some exception
masks because GTK2 code here and there raises some float exceptions
(division by cero, and others).

Try to do it in your console code before the mpg123 calls.

Unit math

SetExceptionMask (if my memory serves me).


--

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Same code from LCL project throw error in console application

Michael Van Canneyt
In reply to this post by Krzysztof


On Tue, 16 Apr 2013, Krzysztof wrote:

> Hi,
> I have strange issue. Simple mpg123 player which work fine on LCL project, on console application throw floating error in line "mh_e := mpg123_read(mh,
> @outbuf[0], buffer_size, done);"
>
> Here you can download demo:
> http://ubuntuone.com/34XmBk7Lr2yCliPPTxcYI1
>
> You find two projects in zip file. LCL and console.
>
> Before you run project:
> 1. Copy shared libs from libs folder for your OS (I attached for linux only) into project folder
> 2. Copy "Michita - Aurapporo.MP3" into your project folder
>
> When you run console application it should play music and crash at 10 second. Please ignore code style etc. I just copied and modified source from my original
> project

It seems to work fine here.
It stops after 10 seconds, but no errors are reported.

Michael.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Same code from LCL project throw error in console application

Krzysztof
In reply to this post by José Mejuto
Thanks! exInvalidOp exception mask solved problem. But I don't understand. Same error I had in fpGUI project. fpGUI interface doesn't use GTK, QT etc, it drawing over pure X11 so how it is possible that application catch GTK errors?

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Same code from LCL project throw error in console application

José Mejuto
El 16/04/2013 22:46, Krzysztof escribió:
> Thanks! exInvalidOp exception mask solved problem. But I don't
> understand. Same error I had in fpGUI project. fpGUI interface doesn't
> use GTK, QT etc, it drawing over pure X11 so how it is possible that
> application catch GTK errors?
>

Hello,

Almost any 'C' library mask that errors, so the programmers do not take
them in account and anyone, like the X11, can raise that exceptions.

--

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal