[squid-dev] [PATCH] Deletors for std::unique_ptr WAS: Re: Broken trunk after r14735

Amos Jeffries squid3 at treenet.co.nz
Sun Jul 31 09:57:00 UTC 2016


[ This is getign kidn fo personal, so I've taken it off-list, but if you
want to stay public feel free to revert that ]

On 31/07/2016 5:26 a.m., Alex Rousskov wrote:
> On 07/30/2016 07:03 AM, Amos Jeffries wrote:
>> On 30/07/2016 6:29 a.m., Alex Rousskov wrote:
>>> On 07/29/2016 09:27 AM, Amos Jeffries wrote:
>>>>>> typedef std::unique_ptr<BIO, std::function<decltype(BIO_free)>> BIO_Pointer;
>>>
>>>> I got this config parsing crash replicated here and tried a dozen or so
>>>> combinations. It does seem to keep coming back to my earlier approach of
>>>> using per-type Functors as the most reliable solution.
> 
> 
>>> AFAICT, this is not a question of reliability, and we should not be
>>> fixing this by trying various combination of typedef characters until we
>>> find one that does not immediately crash Squid. We should figure out
>>> _why_ trunk code does not work (and then fix it accordingly).
> 
> 
>> Please clear your head of the notion that I'm tying things bindly or
>> randomly.
> 
> You control those notions -- I am going by what you tell me. I can
> rarely guess your state of mind unless you document it. The lack of the
> problem cause description combined with phrases like "trying dozen or so
> combinations", "seem to", "the most reliable solution" and other things
> you have said, tell me that you do not know what the root of the problem
> is and assume that this is a reliability problem (i.e., sometimes a
> certain solution works and sometimes it does not).
> 
> 
>> The difficulty as I mentioned already has been in finding a working
>> solution that is easily used without risking future bugs from people
>> misunderstanding the use of these Pointers. That is what I meant by
>> "reliable".
> 
> AFAICT, you have not documented what the cause of the bug is and you
> have used a vague "reliable" adjective without enough context to guess
> one of its meanings, so blaming others for not knowing your state of
> mind is rather unfair.
> 

NO blame intended. I became clear yesterday that we are badly out of
sync with all these parallel threads. That last mail was intended as a
basic clarification of where we are at and whats going on at my end of
things in the whole situation. I'm sorry if it could be taken otherwise,
or did not do the clarification I'd though it was.

> 
>> You have previously assured me[1] that using std::function<declype(X)>
>> was the way to go and would allow removal of the macros. That usage has
>> turned out to cause the null derefernce.
> 
> I fully admit that my std::function suggestion was wrong. While my
> suggestion and decltype discovery were a big step in the right
> direction, I missed the fact that the default functor constructor needs
> to create the right target which, AFAIK, std::function cannot do. If you
> think that makes me responsible for the bugs in your patch (otherwise
> why would you even mention that mistake?), I am not going to waste time
> convincing you otherwise.

I do not think that. I am _hopeful_ that you can fix the bugs in my
patch. Because this and some others have turned out to be cases of a
quote what my teachers once passed on: if you code to the best of your
ability - you wont be capable enough to fix the bugs.

I see you as being somewhat smarter than me. So yeah, when I get stuck
I'm hopeful that you can find the right way forward. If none of us can
find it, then things are really screwed.

> 
> For the record, my suggestions did remove macros, and I gave no
> assurances that they are the final/correct solution (only that they
> compile in my tests).
> 
> A bigger problem here is that your attitude continues to present a
> difficult dilemma for me: When you post bad code, do I simply downvote
> it (and get blamed for being harsh and uncooperative while increasing
> the risks that we all will have to suffer from the consequences of that
> code being committed), or do I spend insane amounts of time trying to
> improve it despite the resistance and frequent personal attacks (and
> then get blamed for the bugs)? It is difficult to find the lesser evil
> among these options!

Thank you for having the courage to voice that.

Please do whatever you need to at any time without guilt or any other
form of doubt or worry. Even though I'm not aware of the precise
pressures you are dealing with constantly, I do understand you have
many. Whatever non-technical things I write in response is not targeted
at anyone else (and IIRC always has been). Simply expression of my
frustration, or in my mind at least an open/honest argument about
technical direction. Any two people with different focus like we have,
will always have those differences.
 There are some people that really piss me off. But you are not one of
them. I value your skills and feedback *a lot*.

On the topic of personal attacks, if I do any please do point it out. I
have a bad case of 'social cue recognition'. Which is both a boon and a
curse. It helps me waive off subtle personal attacks by jumping to a
friendly interpretation of everything (yay!) - but also prevents me
noticing if I'm emitting any signals that could be interpreted by others
as being ambiguous or unfriendly (doh!).

In writing like this that can be particularly hard to get right. I'm
trying to be casual but professional in all I do regarding Squid. So if
any is happening it is more a bad statement about myself than anyone
else. I need to fix that, so pointing out when I get it wrong is helpful
and appreciated.



In other related things, there have been a number of occasions that I've
found myself wishing you and I had a more informal kind of relationship
to offset the dry nature of the pure work/Squid stuff. At least being
able to talk a few lines about non-Squid things every now and again on
IRC makes for a friendlier exchange more like real office colleagues can
build up. Around a watercooler as the steriotype goes.

With each of the others I can chat (at least for a few words) about
family, hobbies or job problems; with Alex ... practically all I have is
"hi". I find it difficult to imagine that you would like it that way
100% of the time, even if we only sync up in chat every other year due
to geography.
 So if we were working in the same building and happened to sit down for
a beverage after work one day, what could we talk about?

Amos



More information about the squid-dev mailing list