Re: [gentoo-user] memset_s

2017-11-14 Thread Jorge Almeida
On Tue, Nov 14, 2017 at 8:42 PM, R0b0t1  wrote:
> On Tue, Nov 14, 2017 at 11:36 AM, Jorge Almeida  wrote:
>> On Fri, Nov 10, 2017 at 12:09 PM, Jorge Almeida  wrote:
>>
>>> http://www.daemonology.net/blog/2014-09-04-how-to-zero-a-buffer.html
>>>
>>>
> Of course, what would really solve the optimize-into-oblivion problem
> is a pragma that when invoked on a particular block of code (maybe
> only a function definition) would tell the compiler to do what the
> programmer says rather than viewing a function as a kind of black box.
>

>>
>> It seems a solution exists with gcc:
>>
>> https://stackoverflow.com/questions/2219829/how-to-prevent-gcc-optimizing-some-statements-in-c
>>
>> The last reply:
>>
>> void __attribute__((optimize("O0"))) foo(unsigned char data) {
>> // unmodifiable compiler code
>> }
>>
>> Any comments, anyone? Yes, it's gcc, but IMO this should be in the
>> language itself. Am I right to assume this is a poorly known feature
>> of gcc?
>> It allows, for example,  to replace sensitive data by random bytes,
>> existing system callls like memset() or getrandom() can be used as
>> they are, no reimplementation needed.
>>
>
> Very interesting. I imagine the opinion of the standards committee
> would be that the variability in code generation precludes a standard
> interface to optimization controls. This might seem unusual, but
> languages with a very controlling standard (like Java or C#) are a new
> concept.

Well, we'll have to stick to gcc (or other compilers with the same
feature). OTOH, boldness doesn't seem to be the comittee's most
salient feature.

>
> What I am wondering about is if C code which uses
> __attribute__((optimize(...))) is against Gentoo package standards and
> would have to be removed from the Portage tree.
>


You can set your optimization preferences in make.conf, and still an
ebuild will override them if deemed unsafe. What would be the
difference?

Cheers

Jorge



Re: [gentoo-user] memset_s

2017-11-14 Thread R0b0t1
On Tue, Nov 14, 2017 at 11:36 AM, Jorge Almeida  wrote:
> On Fri, Nov 10, 2017 at 12:09 PM, Jorge Almeida  wrote:
>
>> http://www.daemonology.net/blog/2014-09-04-how-to-zero-a-buffer.html
>>
>>
 Of course, what would really solve the optimize-into-oblivion problem
 is a pragma that when invoked on a particular block of code (maybe
 only a function definition) would tell the compiler to do what the
 programmer says rather than viewing a function as a kind of black box.

>>>
>
> It seems a solution exists with gcc:
>
> https://stackoverflow.com/questions/2219829/how-to-prevent-gcc-optimizing-some-statements-in-c
>
> The last reply:
>
> void __attribute__((optimize("O0"))) foo(unsigned char data) {
> // unmodifiable compiler code
> }
>
> Any comments, anyone? Yes, it's gcc, but IMO this should be in the
> language itself. Am I right to assume this is a poorly known feature
> of gcc?
> It allows, for example,  to replace sensitive data by random bytes,
> existing system callls like memset() or getrandom() can be used as
> they are, no reimplementation needed.
>

Very interesting. I imagine the opinion of the standards committee
would be that the variability in code generation precludes a standard
interface to optimization controls. This might seem unusual, but
languages with a very controlling standard (like Java or C#) are a new
concept.

What I am wondering about is if C code which uses
__attribute__((optimize(...))) is against Gentoo package standards and
would have to be removed from the Portage tree.

Cheers,
 R0b0t1



Re: [gentoo-user] One package needs two other packages, which cannot be installed simultanously?

2017-11-14 Thread Alan McKinnon
On 14/11/2017 03:00, tu...@posteo.de wrote:
> Hi,
> 
> I got this:
> 
> * Error: The above package list contains packages which cannot be
>  * installed at the same time on the same system.
> 
>   (net-libs/rpcsvc-proto-1.2-r1:0/0::gentoo, ebuild scheduled for merge) 
> pulled in by
> net-libs/rpcsvc-proto required by 
> (net-analyzer/dsniff-2.4_beta1-r9:0/0::gentoo, installed)
> ^^^
> 
> 
>   (net-libs/libnsl-1.1.0-r1:0/2::gentoo, ebuild scheduled for merge) pulled 
> in by
> net-libs/libnsl:0 required by @__auto_slot_operator_replace_installed__
> net-libs/libnsl:0= required by (app-emulation/hercules-3.12:0/0::gentoo, 
> installed)
> net-libs/libnsl:0= required by (app-text/opensp-1.5.2-r6:0/0::gentoo, 
> ebuild scheduled for merge)
> net-libs/libnsl:0= required by 
> (net-analyzer/dsniff-2.4_beta1-r9:0/0::gentoo, installed)
>  ^^^
> 
> 
> It looks like deoends on packages, which could not be installed at the
> same time on the same system.
> 
> Or am I wrong?

Yeah, you're wrong. David already explained the correct way out of this.

You need to learn to read portage output. The bits you quoted, and it's
quite common to see that section quoted here asking the kind of question
you asked, do NOT explain what the problem is.

That section is mere info, portage is giving you the long version of why
it wants to pull in any and all packages referenced in the problem area.
The real error is elsewhere in the output, you now have to go and read
it and understand it.

Portage's output sucks, this is very well known. It is either way too
verbose in junk you don't care about, or very terse in things you do.
But it's what we've got until someone submits a good patch and if you
want to run gentoo using portage, then you need to learn to decipher
it's output. Them's the breaks I'm afraid.

I recommend you take the entire output of which you quoted a part and go
through it line by line, figuring out why it's there and what it is
telling you. You only have to do this once to get a good handle on it,
and you will be very glad you did in the future :-)


-- 
Alan McKinnon
alan.mckin...@gmail.com




Re: [gentoo-user] Instrumenting the GPU

2017-11-14 Thread Marc Joliet
Am Montag, 13. November 2017, 11:59:06 CET schrieb Peter Humphrey:
> Hello list,
> 
> I'm hunting a problem with cooling in this box, and I've got as far as
> suspecting my new AMD WX 5100 GPU.
> 
> One of my BOINC projects causes the GPU temperature, as shown by gkrellm, to
> shoot up to 75C or more and cause intolerable system cooling noise. If I
> suspend that project but leave the other seven running, the temperature
> returns to what I hope is a normal 55C. Those seven projects are supposed
> to use the GPU, but I'm not sure whether they do in fact.
> 
> Is there any way I can monitor what is using the GPU, to find out?

There's also https://github.com/clbr/radeontop, which happens to have an 
ebuild.

-- 
Marc Joliet
--
"People who think they know everything really annoy those of us who know we
don't" - Bjarne Stroustrup


signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-user] memset_s

2017-11-14 Thread Jorge Almeida
On Fri, Nov 10, 2017 at 12:09 PM, Jorge Almeida  wrote:

> http://www.daemonology.net/blog/2014-09-04-how-to-zero-a-buffer.html
>
>
>>> Of course, what would really solve the optimize-into-oblivion problem
>>> is a pragma that when invoked on a particular block of code (maybe
>>> only a function definition) would tell the compiler to do what the
>>> programmer says rather than viewing a function as a kind of black box.
>>>
>>

It seems a solution exists with gcc:

https://stackoverflow.com/questions/2219829/how-to-prevent-gcc-optimizing-some-statements-in-c

The last reply:

void __attribute__((optimize("O0"))) foo(unsigned char data) {
// unmodifiable compiler code
}

Any comments, anyone? Yes, it's gcc, but IMO this should be in the
language itself. Am I right to assume this is a poorly known feature
of gcc?
It allows, for example,  to replace sensitive data by random bytes,
existing system callls like memset() or getrandom() can be used as
they are, no reimplementation needed.

Jorge Almeida



Re: [gentoo-user] One package needs two other packages, which cannot be installed simultanously?

2017-11-14 Thread David Haller
Hello,

On Tue, 14 Nov 2017, tu...@posteo.de wrote:
>I got this:
>
>* Error: The above package list contains packages which cannot be
> * installed at the same time on the same system.
>
>  (net-libs/rpcsvc-proto-1.2-r1:0/0::gentoo, ebuild scheduled for merge) 
> pulled in by
>net-libs/rpcsvc-proto required by 
> (net-analyzer/dsniff-2.4_beta1-r9:0/0::gentoo, installed)
>^^^
[..]
>net-libs/libnsl:0= required by 
> (net-analyzer/dsniff-2.4_beta1-r9:0/0::gentoo, installed)

You need _EITHER_ sys-libs/glibc-2.26[rpc], i.e. <= glibc-2.25 _with_
the "rpc" useflag _OR_ sys-libs/glibc-2.26 (no "rpc" useflag) and
net-libs/rpcsvc-proto and net-libs/libtirpc.

In ebuild-speak:


|| (=sys-libs/glibc-2.26
net-libs/rpcsvc-proto
net-libs/libtirpc
)
)


HTH,
-dnh


-- 
"Wouldn't the sentence 'I want to put a hyphen between the words Fish
and And and And and Chips in my Fish-And-Chips sign' have been clearer
if quotation marks had been placed before Fish, and between Fish and
and, and and and And, and And and and, and and and And, and And and
and, and and and Chips, as well as after Chips?"   -- BSD fortune file



Re: [gentoo-user] Instrumenting the GPU

2017-11-14 Thread Peter Humphrey
On Tuesday, 14 November 2017 06:37:35 GMT R0b0t1 wrote:

> On Mon, Nov 13, 2017 at 9:46 AM, Peter Humphrey  
wrote:
> > On Monday, 13 November 2017 15:12:56 GMT Daniel Frey wrote:
> >> On 11/13/17 02:59, Peter Humphrey wrote:
> >> > I'm hunting a problem with cooling in this box, and I've got as far
> >> > as suspecting my new AMD WX 5100 GPU.
> >> > 
> >> > One of my BOINC projects causes the GPU temperature, as shown by
> >> > gkrellm, to shoot up to 75C or more and cause intolerable system
> >> > cooling noise. If I suspend that project but leave the other seven
> >> > running, the temperature returns to what I hope is a normal 55C.
> >> > Those seven projects are supposed to use the GPU, but I'm not sure
> >> > whether they do in fact.
> >> > 
> >> > Is there any way I can monitor what is using the GPU, to find out?
> >> 
> >> I don't know if there's a utility for consumer level cards that can do
> >> this. I do remember for Nvidia there's nvidia-smi but I don't think it
> >> will list processes for desktop cards.
> > 
> > This isn't consumer grade (look it up in your local shops ;-) ):
> > 
> > # lspci -v -s 01:00.0
> > 01:00.0 VGA compatible controller: Advanced Micro Devices, Inc.
> > [AMD/ATI]
> > Ellesmere [Radeon Pro WX 5100] (prog-if 00 [VGA controller])
[...]
> >> The only other generic ones I can think of are cuda-z and gputop. Have
> >> you tried one of those? Although I don't think it'll give you the
> >> information you need either.
> > 
> > As it's AMD, not nVidia, nvidia-smi and cuda aren't suitable. I hadn't
> > heard of GPU Top - thanks. I'll have a look at it.
> > 
> > I forgot to add that I'm using the proprietary
> > dev-libs/amdgpu-pro-opencl
> > because mesa hasn't caught up yet.
> 
> The level of detail you want will likely necessitate the use of a GPU
> debugger. AMD provides CodeXL, located at
> https://gpuopen.com/compute-product/codexl/. I suggest looking at the
> profiling features.

That does look interesting - many thanks.

> You may want to communicate your findings to the relevant BOINC projects.

Of course.

-- 
Regards,
Peter.