• [gnuplot:bugs] #2195 html fails to compile on mipsel platform

    From Anton Gladky@21:1/5 to All on Tue Sep 3 22:20:02 2019
    Dear mips porters,

    I am maintaining the gnuplot in the Debian and there is a segfault on the mipsel, what I reported to upstream [1].

    There is a question from the gnuplot author, which I am not able to response. Could you please have a look?

    It segfaults somewhere in the static global structure. And the problem appeared recently, maybe due to the GCC-9 migration. There were not problems with GCC-8. Some regressions?

    [1] https://sourceforge.net/p/gnuplot/bugs/2195/

    Thank you

    Anton

    Am Di., 3. Sept. 2019 um 21:27 Uhr schrieb Ethan Merritt <sfeam@users.sourceforge.net>:

    This trace does not make sense to me.
    The code lines highlighted are:

    } else if (r >= R_AXIS.min) {
    /* We store internally as if plotting r(theta) - rmin */
    r = r - R_AXIS.min;

    R_AXIS is a static global structure that has been accessed repeated in the immediately preceding code, so I don't see any way it could cause a segfault here. r is a parameter to this routine so I would expect it to be on the stack (but I don't know
    mipsel compiler calling conventions so maybe not). Could the compiler somehow be setting a read-only flag that prevents modifying a local parameter?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Aurelien Jarno@21:1/5 to Anton Gladky on Sat Sep 14 18:40:01 2019
    On 2019-09-03 21:59, Anton Gladky wrote:
    Dear mips porters,

    I am maintaining the gnuplot in the Debian and there is a segfault on the mipsel, what I reported to upstream [1].

    There is a question from the gnuplot author, which I am not able to response. Could you please have a look?

    It segfaults somewhere in the static global structure. And the problem appeared
    recently, maybe due to the GCC-9 migration. There were not problems with GCC-8.
    Some regressions?

    I confirm it's a regression due introduced by GCC 9. I have reported the
    bug upstream: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91769


    Until this bug is fixed, you can use the following workaround:

    --- gnuplot-5.2.6+dfsg1.orig/src/axis.c
    +++ gnuplot-5.2.6+dfsg1/src/axis.c
    @@ -2698,6 +2698,9 @@ map_y(double value)
    * If update is TRUE then check and update rrange autoscaling
    */
    coord_type
    +#ifdef __mips
    +__attribute__((optimize("-O1")))
    +#endif
    polar_to_xy( double theta, double r, double *x, double *y, TBOOLEAN update)
    {
    coord_type status = INRANGE;

    --
    Aurelien Jarno GPG: 4096R/1DDD8C9B aurelien@aurel32.net http://www.aurel32.net

    --
    Aurelien Jarno GPG: 4096R/1DDD8C9B aurelien@aurel32.net http://www.aurel32.net

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Anton Gladky@21:1/5 to All on Sun Sep 15 13:20:02 2019
    Hello Aurelien,

    thanks for the note. It really helped!

    @Ethan, could you please close the issue in gnuplot-tracker? It should
    be fixed in GCC.

    Regards

    Anton

    Am Sa., 14. Sept. 2019 um 18:38 Uhr schrieb Aurelien Jarno <aurelien@aurel32.net>:


    On 2019-09-03 21:59, Anton Gladky wrote:
    Dear mips porters,

    I am maintaining the gnuplot in the Debian and there is a segfault on the mipsel, what I reported to upstream [1].

    There is a question from the gnuplot author, which I am not able to response.
    Could you please have a look?

    It segfaults somewhere in the static global structure. And the problem appeared
    recently, maybe due to the GCC-9 migration. There were not problems with GCC-8.
    Some regressions?

    I confirm it's a regression due introduced by GCC 9. I have reported the
    bug upstream: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91769


    Until this bug is fixed, you can use the following workaround:

    --- gnuplot-5.2.6+dfsg1.orig/src/axis.c
    +++ gnuplot-5.2.6+dfsg1/src/axis.c
    @@ -2698,6 +2698,9 @@ map_y(double value)
    * If update is TRUE then check and update rrange autoscaling
    */
    coord_type
    +#ifdef __mips
    +__attribute__((optimize("-O1")))
    +#endif
    polar_to_xy( double theta, double r, double *x, double *y, TBOOLEAN update)
    {
    coord_type status = INRANGE;

    --
    Aurelien Jarno GPG: 4096R/1DDD8C9B aurelien@aurel32.net http://www.aurel32.net

    --
    Aurelien Jarno GPG: 4096R/1DDD8C9B aurelien@aurel32.net http://www.aurel32.net

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Anton Gladky@21:1/5 to All on Thu Oct 17 21:00:01 2019
    Hello Aurelien,

    thanks for this information. I have dropped the patch.

    Regards

    Anton

    Am Do., 17. Okt. 2019 um 20:22 Uhr schrieb Aurelien Jarno <aurelien@aurel32.net>:

    Hi Anton,

    On 2019-09-15 13:01, Anton Gladky wrote:
    Hello Aurelien,

    thanks for the note. It really helped!

    Please note that the problem has now been fixed in the Debian gcc-9
    package, and this fixed version is installed on the buildds. Therefore
    you should be able to drop the workaround in next upload.

    Aurelien

    --
    Aurelien Jarno GPG: 4096R/1DDD8C9B aurelien@aurel32.net http://www.aurel32.net

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Aurelien Jarno@21:1/5 to Anton Gladky on Thu Oct 17 20:30:01 2019
    Hi Anton,

    On 2019-09-15 13:01, Anton Gladky wrote:
    Hello Aurelien,

    thanks for the note. It really helped!

    Please note that the problem has now been fixed in the Debian gcc-9
    package, and this fixed version is installed on the buildds. Therefore
    you should be able to drop the workaround in next upload.

    Aurelien

    --
    Aurelien Jarno GPG: 4096R/1DDD8C9B aurelien@aurel32.net http://www.aurel32.net

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)