Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 685092 - www-client/seamonkey-2.49.9.1_p0 needs a patch for gcc-9.1
Summary: www-client/seamonkey-2.49.9.1_p0 needs a patch for gcc-9.1
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Lars Wendler (Polynomial-C) (RETIRED)
URL:
Whiteboard:
Keywords: PATCH
: 686084 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-05-05 10:29 UTC by Helmut Jarausch
Modified: 2019-10-14 06:43 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
patch needed for gcc-9.1 (seamonkey-gcc9.patch,811 bytes, patch)
2019-05-05 10:29 UTC, Helmut Jarausch
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Helmut Jarausch 2019-05-05 10:29:49 UTC
Created attachment 575286 [details, diff]
patch needed for gcc-9.1

gcc-9 doesn't allow NULL parameters to printf.
The attached patch checks for this.

The error was

/var/tmp/Big_Tmp/portage/www-client/seamonkey-2.49.9.1_p0/work/thunderbird-52.9.1/mozilla/js/xpconnect/src/XPCWrappedNative.cpp:2221:41: error: '%s' directive argument is null [-Werror=format-overflow=]
 2221 |                 name = JS_sprintf_append(name, fmt,
      |                        ~~~~~~~~~~~~~~~~~^~~~~~~~~~~
 2222 |                                          array[i]->GetNameString());
      |                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~
Comment 1 Jonas Stein gentoo-dev 2019-05-05 10:53:12 UTC
is it a wrong patch? Only whitespace was removed in the patch.
Comment 2 Helmut Jarausch 2019-05-05 11:53:48 UTC
(In reply to Jonas Stein from comment #1)
> is it a wrong patch? Only whitespace was removed in the patch.

Why do you think so?

Here is the patch again
--- a/mozilla/js/xpconnect/src/XPCWrappedNative.cpp.ORIG	2018-07-09 21:54:43.000000000 +0200
+++ b/mozilla/js/xpconnect/src/XPCWrappedNative.cpp	2019-05-04 17:49:23.893560494 +0200
@@ -2218,15 +2218,16 @@
                 const char* fmt = (i == 0) ?
                                     "(%s" : (i == count-1) ?
                                         ", %s)" : ", %s";
+                
+                if (!name) {
+                    return nullptr;
+                }
                 name = JS_sprintf_append(name, fmt,
                                          array[i]->GetNameString());
             }
         }
     }
 
-    if (!name) {
-        return nullptr;
-    }
     const char* fmt = "[xpconnect wrapped %s" FMT_ADDR FMT_STR(" (native")
         FMT_ADDR FMT_STR(")") "]";
     if (si) {

i.e. the check if(!name) has been moved up before the JS_sprintf_append
function call.
Comment 3 tt_1 2019-05-09 13:17:58 UTC
Seems as if all firefox and thunderbird based on esr have the same problem, and spidermonkey too? I don't have yet set up gcc-9.1, just had a glance at the file. Would you mind to check?
Comment 4 Jory A. Pratt gentoo-dev 2019-05-09 23:56:15 UTC
(In reply to tt_1 from comment #3)
> Seems as if all firefox and thunderbird based on esr have the same problem,
> and spidermonkey too? I don't have yet set up gcc-9.1, just had a glance at
> the file. Would you mind to check?

Please do not assume anything. I have done tested thunderbird-60.x and it is fine with gcc-9.
Comment 5 Jory A. Pratt gentoo-dev 2019-05-17 00:41:24 UTC
*** Bug 686084 has been marked as a duplicate of this bug. ***
Comment 6 Larry the Git Cow gentoo-dev 2019-06-17 14:31:27 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4306d728998b0eaf3e863d887920813e6af91e1a

commit 4306d728998b0eaf3e863d887920813e6af91e1a
Author:     Lars Wendler <polynomial-c@gentoo.org>
AuthorDate: 2019-06-17 14:31:18 +0000
Commit:     Lars Wendler <polynomial-c@gentoo.org>
CommitDate: 2019-06-17 14:31:18 +0000

    www-client/seamonkey: Fixed build with gcc9
    
    Thanks-to: Helmut Jarausch <jarausch@igpm.rwth-aachen.de>
    Closes: https://bugs.gentoo.org/685092
    Package-Manager: Portage-2.3.67, Repoman-2.3.14
    Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>

 www-client/seamonkey/files/seamonkey-gcc9.patch   | 22 ++++++++++++++++++++++
 www-client/seamonkey/seamonkey-2.49.9.1_p0.ebuild |  5 ++++-
 2 files changed, 26 insertions(+), 1 deletion(-)
Comment 7 Larry the Git Cow gentoo-dev 2019-10-14 06:43:48 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=50c601ef08f894524b063c37e3eff641b7e1df23

commit 50c601ef08f894524b063c37e3eff641b7e1df23
Author:     Jory Pratt <anarchy@gentoo.org>
AuthorDate: 2019-10-14 02:58:46 +0000
Commit:     Lars Wendler <polynomial-c@gentoo.org>
CommitDate: 2019-10-14 06:43:38 +0000

    www-client/seamonkey: Fix gcc-9 support to not break plugins
    
    Closes: https://bugs.gentoo.org/685092
    
    Signed-off-by: Jory Pratt <anarchy@gentoo.org>
    Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>

 www-client/seamonkey/files/seamonkey-gcc9.patch    | 22 ----------------------
 ...ey-2.49.5.ebuild => seamonkey-2.49.5-r1.ebuild} |  6 +++---
 www-client/seamonkey/seamonkey-2.49.9.1_p0.ebuild  |  6 +++---
 3 files changed, 6 insertions(+), 28 deletions(-)