git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Re* jc/http-clear-finished-pointer

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Jun 1, 2022, 07:26 UTC
Message-ID
<220601.86pmjs2679.gmgdl@evledraar.gmail.com>
In-Reply-To
<xmqq7d68ytj8.fsf_-_@gitster.g>
On Thu, May 26 2022, Junio C Hamano wrote:
Show 38 quoted lines
> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
>
>> On Thu, May 26 2022, Junio C Hamano wrote:
>>
>>> * jc/http-clear-finished-pointer (2022-05-24) 1 commit
>>>  - http.c: clear the 'finished' member once we are done with it
>>>
>>>  Meant to go with js/ci-gcc-12-fixes
>>>
>>>  Will merge to 'next'?
>>>  source: <xmqqczgqjr8y.fsf_-_@gitster.g>
>>
>> The end of the proposed commit message says:
>>
>>     [...]Clear the finished member before the control leaves the
>>     function, which has a side effect of unconfusing compilers like
>>     recent GCC 12 that is over-eager to warn against such an assignment.
>>
>> I cannot reproduce this suppressing the warning as noted in past
>> exchanges, it's not affected by this "clear if we set it" pattern. It
>> needs to be unconditionally cleared.
>
> Interesting.  I still have conditional clearing in the tree, though
> I was reasonably sure I got rid of the conditional and made it
> always clear, when I rewrote that part of the log message.  After
> all, I ran "commit --amend" so that I do not forget the issue after
> sending https://lore.kernel.org/git/xmqqleurlt31.fsf@gitster.g/ X-<.
>
> Thanks for catching.  What is queued is not what I intended to
> queue.
>
> But there is one thing that is puzzling.  Ever since this, together
> with the three patches from Dscho for gcc12, got included in 'seen',
> the branch started passing the Windows build that used to complain
> and did not work, so at least with the version of gcc12 used over
> there, it apparently is sufficient to clear only when we are
> responsible for placing an address that is about to become invalid,
> while leaving the pointer we didn't stuff in unmodified.

I didn't find what specific build(s) you were referring to, but perhaps this is due to an interaction with 9c539d1027d (config.mak.dev: alternative workaround to gcc 12 warning in http.c, 2022-04-15)? I.e. with DEVELOPER=1 we'd already get past the warning with gcc+Windows, presumably (but I haven't confirmed whether the detect-compiler etc. works the same there).

Show 14 quoted lines
> As far as I understand, with the most recent analysis by Dscho on
> the http-push codepath, we can return to the loop while the slot is
> holding a different request that is unrelated to ours that has
> already finished without recursively calling run_active_slot(), and
> with the current *(slot->finished)=1 trick, it will successfully
> notify our loop that our request is done, even though slot->in_use
> is set to true back again when it happens.  But by definition, at
> that point, slot->finished is not used by anybody (obviously not by
> us, but also not by the request that is currently using the slot,
> because it hasn't used run_active_slot() and slot->finished is not
> touched by it), so it is safe to unconditionally clear the member.
>
> ----- >8 --------- >8 --------- >8 --------- >8 --------- >8 -----
> Subject: [PATCH v3] http.c: clear the 'finished' member once we are done with it

I see this is in "next" already, as a follow-up we should have a revert of 9c539d1027d (config.mak.dev: alternative workaround to gcc 12 warning in http.c, 2022-04-15) which this patch makes redundant.

Previous: Junio C HamanoNext: Junio C Hamano
Message 18 of 24 in “What's cooking in git.git (May 2022, #07; Wed, 25)”
  1. Junio C HamanoMay 26, 2022
  2. Victoria DyeMay 26, 2022
  3. Junio C HamanoMay 26, 2022
  4. Ævar Arnfjörð BjarmasonMay 26, 2022
  5. Victoria DyeMay 26, 2022
  6. Ævar Arnfjörð BjarmasonMay 26, 2022
  7. Junio C HamanoMay 26, 2022
  8. tb/cruft-packs (was Re: What's cooking in git.git (May 2022, #07; Wed, 25))Taylor Blau, May 26, 2022
  9. Taylor BlauMay 26, 2022
  10. Junio C HamanoMay 26, 2022
  11. tb/midx-race-in-pack-objects (was Re: What's cooking in git.git (May 2022, #07; Wed, 25))Taylor Blau, May 26, 2022
  12. sg/build-gitweb (was: What's cooking in git.git (May 2022, #07; Wed, 25))Ævar Arnfjörð Bjarmason, May 26, 2022
  13. Junio C HamanoMay 26, 2022
  14. jc/http-clear-finished-pointer (was: What's cooking in git.git (May 2022, #07; Wed, 25))Ævar Arnfjörð Bjarmason, May 26, 2022
  15. Re* jc/http-clear-finished-pointerJunio C Hamano, May 26, 2022
  16. Johannes SchindelinMay 27, 2022
  17. Junio C HamanoMay 27, 2022
  18. Ævar Arnfjörð BjarmasonJun 1, 2022
  19. Junio C HamanoJun 1, 2022
  20. js/bisect-in-c (was: What's cooking in git.git (May 2022, #07; Wed, 25))Ævar Arnfjörð Bjarmason, May 26, 2022
  21. Junio C HamanoMay 26, 2022
  22. Junio C HamanoMay 26, 2022
  23. Ævar Arnfjörð BjarmasonMay 27, 2022
  24. jx/l10n-workflow-change (was: What's cooking in git.git (May 2022, #07; Wed, 25))Ævar Arnfjörð Bjarmason, May 26, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.