RE: [PATCH] Fix possible underflow in expression (maxoff - 1)

Поиск
Список
Период
Сортировка
От Ranier Vilela
Тема RE: [PATCH] Fix possible underflow in expression (maxoff - 1)
Дата
Msg-id CO2PR05MB2629E54E4EA6358958F5EF23E3530@CO2PR05MB2629.namprd05.prod.outlook.com
обсуждение исходный текст
Ответ на Re: [PATCH] Fix possible underflow in expression (maxoff - 1)  (Thomas Munro <thomas.munro@gmail.com>)
Список pgsql-hackers
De: Thomas Munro <thomas.munro@gmail.com>
Enviado: quarta-feira, 18 de dezembro de 2019 00:18

>If you're working on/with static code analysis tools, I have some
>requests :-)  How could we automate the discovery of latch wait
>programming mistakes?
I doubt that static analysis can help with this problem.
This seems to me more like a high logic problem. Static tools are good at discovering flaws as uninitialized variable.
In a quick research I did on the subject, I found that sql queries specifically made can reveal latch wait.
So my suggestion for automating would be, if don't already have it, include a test class in regression testing:
make latch
Starting from a baseline (v12.1), which would generate an expected amount of latchs, as soon as the reviewer applied a
patchthat might touch buffer pages, it could run the test suite. 
Once the result showed a significant increase in the number of latches, it would be a warning that something is not
goodin the patch. 
Unfortunately, that would not show where in the code the problem would be.

regards,
Ranier Vilela


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Optimizing TransactionIdIsCurrentTransactionId()
Следующее
От: Ranier Vilela
Дата:
Сообщение: RE: [Proposal] Level4 Warnings show many shadow vars