Closed Bug 1557338 Opened 5 months ago Closed 4 months ago

clang trunk builds fail with: TestSprintfLiteral.cpp Line 7: 'snprintf' size argument is too large; destination buffer has size 100, but size argument is 101

Categories

(Firefox Build System :: Source Code Analysis, defect, P3)

defect

Tracking

(firefox69 fixed)

RESOLVED FIXED
mozilla69
Tracking Status
firefox69 --- fixed

People

(Reporter: dmajor, Assigned: dmajor)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

These checks were added in https://reviews.llvm.org/rC356397.

13:53:50     INFO -    File z:/build/build/src/build/clang-plugin/tests/TestSprintfLiteral.cpp Line 7: 'snprintf' size argument is too large; destination buffer has size 100, but size argument is 101
13:53:50     INFO -    File z:/build/build/src/build/clang-plugin/tests/TestSprintfLiteral.cpp Line 11: 'snprintf' size argument is too large; destination buffer has size 100, but size argument is 101
13:53:50     INFO -    File z:/build/build/src/build/clang-plugin/tests/TestSprintfLiteral.cpp Line 30: 'vsnprintf' size argument is too large; destination buffer has size 100, but size argument is 101
13:53:50     INFO -    File z:/build/build/src/build/clang-plugin/tests/TestSprintfLiteral.cpp Line 34: 'vsnprintf' size argument is too large; destination buffer has size 100, but size argument is 101

What's the best way to get around this without breaking existing clang 8.0.0 builds?

Since I have no particular attachment to this code, my first choice would be to delete the offending lines. :-)

One could argue that the file should only test that the printf checker works in general, not whether we're handling illegal cases correctly.

I agree with you on this one, the TestSprintfLiteral.cpp is to test the sanity of it's corresponding checker and not any other diagnostic message generated by clang. Removing lines 7, 11, 30, 34 doesn't impair the test of our checker, so I will r+ this kind of patch.

The priority flag is not set for this bug.
:sylvestre, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(sledru)
Flags: needinfo?(sledru)
Priority: -- → P3

LLVM r356397 added some new warnings to the compiler that in this file complain about size argument is too large; destination buffer has size 100, but size argument is 101.

The easiest path is to just remove those lines; doing so doesn't really weaken the test coverage of the SprintfLiteral checker.

Pushed by dmajor@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/23973e3a5e95
Fix up TestSprintfLiteral.cpp for warnings on clang trunk r=andi

Backed out changeset 23973e3a5e95 for causing bustages on OS X Cross Compiled.

Backout link: https://hg.mozilla.org/integration/autoland/rev/ed65b4d20a8969f6b6d9789270fe574a36793bff

Push with failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&resultStatus=pending%2Crunning%2Csuccess%2Ctestfailed%2Cbusted%2Cexception&searchStr=os%2Cx%2Ccross%2Ccompiled%2Cshippable%2Copt%2Cbuild-signing-macosx64-shippable%2Fopt%2C%28bs%29&fromchange=23973e3a5e9503919dbf529d531ac1212cf4641a&tochange=ed65b4d20a8969f6b6d9789270fe574a36793bff&selectedJob=254309262

Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=254309262&repo=autoland&lineNumber=536

Traceback (most recent call last):
File "/builds/dep2/bin/iscript", line 11, in <module>
load_entry_point('iscript', 'console_scripts', 'iscript')()
File "/builds/dep2/scriptworker-scripts/iscript/src/iscript/script.py", line 85, in main
return sync_main(async_main, default_config=get_default_config())
File "/builds/dep2/scriptworker-scripts/scriptworker_client/src/scriptworker_client/client.py", line 125, in sync_main
loop.run_until_complete(_handle_asyncio_loop(async_main, config, task))
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/base_events.py", line 584, in run_until_complete
return future.result()
File "/builds/dep2/scriptworker-scripts/scriptworker_client/src/scriptworker_client/client.py", line 156, in _handle_asyncio_loop
await async_main(config, task)
File "/builds/dep2/scriptworker-scripts/iscript/src/iscript/script.py", line 55, in async_main
await sign_and_pkg_behavior(config, task)
File "/builds/dep2/scriptworker-scripts/iscript/src/iscript/mac.py", line 1171, in sign_and_pkg_behavior
await sign_all_apps(config, key_config, entitlements_path, all_paths)
File "/builds/dep2/scriptworker-scripts/iscript/src/iscript/mac.py", line 600, in sign_all_apps
await raise_future_exceptions(futures)
File "/builds/dep2/scriptworker-scripts/scriptworker_client/src/scriptworker_client/aio.py", line 55, in raise_future_exceptions
raise exceptions[0]
File "/builds/dep2/scriptworker-scripts/iscript/src/iscript/mac.py", line 238, in sign_app
await sign_libclearkey(contents_dir, sign_command, app_path)
File "/builds/dep2/scriptworker-scripts/iscript/src/iscript/mac.py", line 281, in sign_libclearkey
retry_exceptions=(IScriptError,),
File "/builds/dep2/scriptworker-scripts/scriptworker_client/src/scriptworker_client/aio.py", line 154, in retry_async
return await func(*args, **kwargs)
TypeError: run_command() missing 1 required positional argument: 'cmd'
exit code: 1

Flags: needinfo?(dmajor)
Pushed by dmajor@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f0ac391dd02a
Fix up TestSprintfLiteral.cpp for warnings on clang trunk r=andi

Indeed, it was an infra issue, I was just going to re-land,
Sorry for that :D

Status: NEW → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla69
Assignee: nobody → dmajor
You need to log in before you can comment on or make changes to this bug.