[SERVER-54383] JSStringWrapper warning on gcc-10 Created: 08/Feb/21  Updated: 29/Mar/23  Resolved: 29/Mar/23

Status: Closed
Project: Core Server
Component/s: JavaScript
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Mathias Stearn Assignee: Serhii Lysenko
Resolution: Won't Fix Votes: 0
Labels: mathias-sa-triage, neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Query Execution
Operating System: ALL
Sprint: QE 2023-04-03
Participants:

 Description   

This appears to be a valid warning in our code:

FAILED: build/ninja/mongo/scripting/mozjs/jsstringwrapper.dyn.o
PATH='/usr/local/bin:/opt/bin:/bin:/usr/bin' CCACHE_NOCPP2='1' ICECC_CARET_WORKAROUND='0' CCACHE_PREFIX='/home/ubuntu/mongo/build/scons/icecream/run-icecc.sh' /usr/bin/ccache /usr/bin/g++-10 @build/ninja/mongo/scripting/mozjs/jsstringwrapper.dyn.o.rsp
In file included from /usr/include/string.h:494,
                 from /usr/include/c++/10/cstring:42,
                 from src/third_party/mozjs-60/include/mozilla/Span.h:33,
                 from src/third_party/mozjs-60/include/mozilla/Range.h:12,
                 from src/third_party/mozjs-60/include/jsapi.h:15,
                 from src/mongo/scripting/mozjs/jsstringwrapper.h:33,
                 from src/mongo/scripting/mozjs/jsstringwrapper.cpp:32:
In function 'char* strncpy(char*, const char*, size_t)',
    inlined from 'mongo::mozjs::JSStringWrapper::JSStringWrapper(int32_t)' at src/mongo/scripting/mozjs/jsstringwrapper.cpp:48:12:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:34: error: 'char* __builtin_strncpy(char*, const char*, long unsigned int)' specified bound 64 equals destination size [-Werror=stringop-truncation]
cc1plus: all warnings being treated as errors



 Comments   
Comment by Serhii Lysenko [ 29/Mar/23 ]

already fixed by https://github.com/serhiitea/mongo/commit/285b313a0571fc6b648f123277cbdce3d0202a2d 

Comment by Serhii Lysenko [ 29/Mar/23 ]

https://github.com/serhiitea/mongo/commit/285b313a0571fc6b648f123277cbdce3d0202a2d already resolved

Comment by Lauren Lewis (Inactive) [ 18/Mar/22 ]

We haven’t heard back from you for some time, so we're going to close this ticket. If this is still an issue for you, please provide additional information and we will reopen the ticket.

Generated at Thu Feb 08 05:33:23 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.