public inbox for [email protected]
help / color / mirror / Atom feed[PATCH v6 07/10] is vs are plural
3+ messages / 3 participants
[nested] [flat]
* [PATCH v6 07/10] is vs are plural
@ 2019-04-04 23:57 Justin Pryzby <[email protected]>
0 siblings, 0 replies; 3+ messages in thread
From: Justin Pryzby @ 2019-04-04 23:57 UTC (permalink / raw)
Should backpatch to v12
---
doc/src/sgml/ref/alter_table.sgml | 2 +-
doc/src/sgml/sources.sgml | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml
index b2eb7097a9..fa848e0bdf 100644
--- a/doc/src/sgml/ref/alter_table.sgml
+++ b/doc/src/sgml/ref/alter_table.sgml
@@ -889,7 +889,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
from the parent table will be created in the partition, if they don't
already exist.
If any of the <literal>CHECK</literal> constraints of the table being
- attached is marked <literal>NO INHERIT</literal>, the command will fail;
+ attached are marked <literal>NO INHERIT</literal>, the command will fail;
such constraints must be recreated without the
<literal>NO INHERIT</literal> clause.
</para>
diff --git a/doc/src/sgml/sources.sgml b/doc/src/sgml/sources.sgml
index 283c3e0357..12704c6fdf 100644
--- a/doc/src/sgml/sources.sgml
+++ b/doc/src/sgml/sources.sgml
@@ -466,8 +466,8 @@ Hint: the addendum
enough for error messages. Detail and hint messages can be relegated to a
verbose mode, or perhaps a pop-up error-details window. Also, details and
hints would normally be suppressed from the server log to save
- space. Reference to implementation details is best avoided since users
- aren't expected to know the details.
+ space. References to implementation details are best avoided since users
+ aren't expected to know them.
</para>
</simplesect>
--
2.17.0
--C+ts3FVlLX8+P6JN
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="v6-0008-doc-backup-manifests.patch"
^ permalink raw reply [nested|flat] 3+ messages in thread
* jsonapi: scary new warnings with LTO enabled
@ 2025-04-16 21:42 Tom Lane <[email protected]>
2025-04-16 22:17 ` Re: jsonapi: scary new warnings with LTO enabled Ranier Vilela <[email protected]>
0 siblings, 1 reply; 3+ messages in thread
From: Tom Lane @ 2025-04-16 21:42 UTC (permalink / raw)
To: [email protected]
I noticed some new warnings from buildfarm member chafer,
which I'm able to reproduce locally on a Fedora 41 box
by building with "meson setup build -Db_lto=true":
ninja: Entering directory `build'
[1515/2472] Linking target src/interfaces/libpq/libpq.so.5.18
In function 'freeJsonLexContext',
inlined from 'freeJsonLexContext' at ../src/common/jsonapi.c:688:1,
inlined from 'handle_oauth_sasl_error' at ../src/interfaces/libpq/fe-auth-oauth.c:547:2:
../src/common/jsonapi.c:723:17: warning: 'free' called on unallocated object 'lex' [-Wfree-nonheap-object]
723 | FREE(lex);
| ^
../src/interfaces/libpq/fe-auth-oauth.c: In function 'handle_oauth_sasl_error':
../src/interfaces/libpq/fe-auth-oauth.c:479:24: note: declared here
479 | JsonLexContext lex = {0};
| ^
[2407/2472] Linking target src/test/modules/test_json_parser/test_json_parser_incremental_shlib
In function 'freeJsonLexContext',
inlined from 'freeJsonLexContext' at ../src/common/jsonapi.c:688:1,
inlined from 'main' at ../src/test/modules/test_json_parser/test_json_parser_incremental.c:198:2:
../src/common/jsonapi.c:723:17: warning: 'free' called on unallocated object 'lex' [-Wfree-nonheap-object]
723 | FREE(lex);
| ^
../src/test/modules/test_json_parser/test_json_parser_incremental.c: In function 'main':
../src/test/modules/test_json_parser/test_json_parser_incremental.c:87:24: note: declared here
87 | JsonLexContext lex;
| ^
[2426/2472] Linking target src/test/modules/test_json_parser/test_json_parser_incremental
In function 'pg_free',
inlined from 'pfree' at ../src/common/fe_memutils.c:135:2,
inlined from 'freeJsonLexContext' at ../src/common/jsonapi.c:723:3,
inlined from 'freeJsonLexContext' at ../src/common/jsonapi.c:688:1,
inlined from 'main' at ../src/test/modules/test_json_parser/test_json_parser_incremental.c:198:2:
../src/common/fe_memutils.c:107:9: warning: 'free' called on unallocated object 'lex' [-Wfree-nonheap-object]
107 | free(ptr);
| ^
../src/test/modules/test_json_parser/test_json_parser_incremental.c: In function 'main':
../src/test/modules/test_json_parser/test_json_parser_incremental.c:87:24: note: declared here
87 | JsonLexContext lex;
| ^
AFAICT there is no actual bug here: the FREE() call is reached only if
the JSONLEX_FREE_STRUCT flag is set, which it should not be for these
call sites. But evidently the LTO optimizer is not quite smart enough
to realize that.
It seems fairly dangerous to ignore -Wfree-nonheap-object warnings.
I feel like we ought to move to prevent these somehow. I'm not sure
how other than giving up on stack allocation of JsonLexContexts,
though, especially if we consider the jsonapi API frozen. But seeing
that there are only three such call sites and none of them seem in the
least performance-critical, maybe we should just do that?
regards, tom lane
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: jsonapi: scary new warnings with LTO enabled
2025-04-16 21:42 jsonapi: scary new warnings with LTO enabled Tom Lane <[email protected]>
@ 2025-04-16 22:17 ` Ranier Vilela <[email protected]>
0 siblings, 0 replies; 3+ messages in thread
From: Ranier Vilela @ 2025-04-16 22:17 UTC (permalink / raw)
To: Tom Lane <[email protected]>; +Cc: [email protected]
Em qua., 16 de abr. de 2025 às 18:42, Tom Lane <[email protected]> escreveu:
> I noticed some new warnings from buildfarm member chafer,
> which I'm able to reproduce locally on a Fedora 41 box
> by building with "meson setup build -Db_lto=true":
>
> ninja: Entering directory `build'
> [1515/2472] Linking target src/interfaces/libpq/libpq.so.5.18
> In function 'freeJsonLexContext',
> inlined from 'freeJsonLexContext' at ../src/common/jsonapi.c:688:1,
> inlined from 'handle_oauth_sasl_error' at
> ../src/interfaces/libpq/fe-auth-oauth.c:547:2:
> ../src/common/jsonapi.c:723:17: warning: 'free' called on unallocated
> object 'lex' [-Wfree-nonheap-object]
> 723 | FREE(lex);
> | ^
> ../src/interfaces/libpq/fe-auth-oauth.c: In function
> 'handle_oauth_sasl_error':
> ../src/interfaces/libpq/fe-auth-oauth.c:479:24: note: declared here
> 479 | JsonLexContext lex = {0};
> | ^
> [2407/2472] Linking target
> src/test/modules/test_json_parser/test_json_parser_incremental_shlib
> In function 'freeJsonLexContext',
> inlined from 'freeJsonLexContext' at ../src/common/jsonapi.c:688:1,
> inlined from 'main' at
> ../src/test/modules/test_json_parser/test_json_parser_incremental.c:198:2:
> ../src/common/jsonapi.c:723:17: warning: 'free' called on unallocated
> object 'lex' [-Wfree-nonheap-object]
> 723 | FREE(lex);
> | ^
> ../src/test/modules/test_json_parser/test_json_parser_incremental.c: In
> function 'main':
> ../src/test/modules/test_json_parser/test_json_parser_incremental.c:87:24:
> note: declared here
> 87 | JsonLexContext lex;
> | ^
> [2426/2472] Linking target
> src/test/modules/test_json_parser/test_json_parser_incremental
> In function 'pg_free',
> inlined from 'pfree' at ../src/common/fe_memutils.c:135:2,
> inlined from 'freeJsonLexContext' at ../src/common/jsonapi.c:723:3,
> inlined from 'freeJsonLexContext' at ../src/common/jsonapi.c:688:1,
> inlined from 'main' at
> ../src/test/modules/test_json_parser/test_json_parser_incremental.c:198:2:
> ../src/common/fe_memutils.c:107:9: warning: 'free' called on unallocated
> object 'lex' [-Wfree-nonheap-object]
> 107 | free(ptr);
> | ^
> ../src/test/modules/test_json_parser/test_json_parser_incremental.c: In
> function 'main':
> ../src/test/modules/test_json_parser/test_json_parser_incremental.c:87:24:
> note: declared here
> 87 | JsonLexContext lex;
> | ^
>
> AFAICT there is no actual bug here: the FREE() call is reached only if
> the JSONLEX_FREE_STRUCT flag is set, which it should not be for these
> call sites.
See the function *makeJsonLexContextCstringLen* (line 400)
The JSONLEX_FREE_STRUCT is enabled, no?
fe-auth-oauth.c (line 507)
makeJsonLexContextCstringLen(&lex, msg, msglen, PG_UTF8, true);
Worst, on a second call, with lex not NULL, the flags is reseted
and the struct will no longer be released?
best regards,
Ranier Vilela
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2025-04-16 22:17 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-04-04 23:57 [PATCH v6 07/10] is vs are plural Justin Pryzby <[email protected]>
2025-04-16 21:42 jsonapi: scary new warnings with LTO enabled Tom Lane <[email protected]>
2025-04-16 22:17 ` Re: jsonapi: scary new warnings with LTO enabled Ranier Vilela <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox