Re: MIT discovered issue with gcc

2013-11-28 Thread Octavio Alvarez
On 11/28/2013 03:28 AM, Joel Rees wrote:
> And, according to the article that started this thread, isn't going to
> do the job, either, since many of our primary compilers now optimize
> more than they are able to warn about even at the lowest level of
> optimization.

This should be enough to throw away that compiler.


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/52977d81.8030...@alvarezp.ods.org



Re: MIT discovered issue with gcc

2013-11-27 Thread Octavio Alvarez

On 27/11/13 13:10, Wade Richards wrote:

Also, the deeper you get into the optimized code, the harder it is to
issue meaningful source-level warnings.  E.g. when the compiler optimizes:

static int decimate(x) { return x/10; }
int foo() {
   int a=INT_MAX;
   int b;
   for(i=0; i<100; ++i) { b=max(i, decimate(a*10));}
   return b;
}


into


int foo() { return INT_MAX; }


What warnings should appear for which lines?


Hi, thanks for the reply. I really hope I'm not missing your point here, 
but here it goes:


Speaking as a programmer, the following would be nice:

"Warning (or error): a*10 can cause signed integer overflow on line 5 
which is undefined behavior. Not optimizing anything beyond this point 
for the rest of the function."


If I'm sure this is what I intend, and not to pay the non-optimization 
penalty, I would (and should, anyway) rewrite it like this:


int foo() {
   int a=INT_MAX;
   int b;
   int i;
   for(i=0; i<100; ++i) { b=max(i, a);}
   return b;
}

... which, assuming a good max() function, would fall into the confines 
of defined behavior and thus, the compiler should feel free to optimize 
away whatever it wants without making crazy assumptions. The concept is: 
because it is defined behavior, the compiler knows what the code flow 
will be.


This would make both, my code and the compiler predictable.

In the following code, the compiler should feel free to optimize away 
without throwing any errors:


int foo() {
   int a=INT_MAX / 11;
   int b;
   int i;
   for(i=0; i<100; ++i) { b=max(i, decimate(a*10));}
   return b;
}

In the following case I should get a warning because 'a' is not confined:

int foo(int a) {
   int b;
   int i;
   for(i=0; i<100; ++i) { b=max(i, decimate(a*10));}
   return b;
}

The following code should be fully reduced to "return a":

int foo(int a) {
   if (a > 214748364)
return -1; /* or whatever */
   int b;
   int i;
   for(i=0; i<100; ++i) { b=max(i, decimate(a*10));}
   return b;
}

Not sure if I'm making my point: I don't think any programmer would ever 
want his program to go into UB intentionally. Consequently, the compiler 
should never ever assume or suppose or guess anything at all. It should 
"infer" always, but never "suppose" anything. Using UB implies supposing 
as opposed to inferring.


Best regards.


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Archive: http://lists.debian.org/5296946b.7080...@alvarezp.ods.org



Re: MIT discovered issue with gcc

2013-11-27 Thread Octavio Alvarez

On 26/11/13 11:37, Mark Haase wrote:

Compiler developers, for better or worse, reserve the right to do
whatever they want with undefined behavior, and it's up to the person
writing the C code to not include undefined behavior in their own program.


That's a fallacy. The fact that a compiler does not violate the standard 
does not imply it is behaving sane. Thus, not violating the standard 
does not imply not having a bug.


Considering a programmer would not ever *ever* want to fall into 
undefined behavior, the compiler should just issue warnings before 
making any kind of assumptions based after undefined behavior. Those 
warnings could be silenced with flags. This is a way of "yes, I'm sure 
of what I'm doing".



Therefore, a Linux distribution has 2 choices: (1) wait for upstream
patches for bugs/vulnerabilities as they are found, or (2) recompile all
packages with optimizations disabled. I don't think proposal #2 would
get very far...


What about adding cppcheck warnings and gcc -Wall -pedantic be added to 
Lintian?


Or what about changing debhelper to pass some -f flags by default?


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Archive: http://lists.debian.org/529653df.6010...@alvarezp.ods.org



Re: unix and email viruses

2008-03-02 Thread Octavio Alvarez
On Sun, 2008-03-02 at 15:59 -0500, Douglas A. Tutty wrote:
> Hello all,
> 
> I debian or other 'nix suceptible in any way to anything anybody can put
> in an email?  I'm guessing that if someone comes up with something that
> can break e.g. mutt that mutt will be fixed around the same time as a
> virus scanner would be updated.

Just thinking out loud: Maybe some image attack via a web beacon? Not
necesarily for mutt, though.

-- 
Octavio.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Ping my modem...

2007-08-27 Thread Octavio Alvarez
On Mon, 27 Aug 2007 21:42:41 -0700, Charlie <[EMAIL PROTECTED]>  
wrote:



--} > Is the following a normal reply from a satellite modem to ping:-
--} >
--} > ping: sendmsg: Operation not permitted
--} > ping: sendmsg: Operation not permitted
--} > ping: sendmsg: Operation not permitted
--} > ping: sendmsg: Operation not permitted
--} > ping: sendmsg: Operation not permitted


Your iptables firewall is blocking ICMP.

--
Octavio.


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Re: Recomendations - becoming a C soldier.

2007-08-10 Thread Octavio Alvarez
On Fri, 10 Aug 2007 11:27:18 -0700, Orestes leal  
<[EMAIL PROTECTED]> wrote:



QUESTION: Studying C 'every day' 4 hours with good understanding,
writing at least 10 programs to test this knowledge every day, the  
question
it: How Long Can I become a very 'very' good C  programmer to the point  
to hack in some

kernel of some system or writing good apps without some trouble?


It depends. If you study the kernel and at some point you are able to
hack it, you would still not be able to hack into a GTK program, as
you need to learn the GTK library. You will know *C* by then, but not
the libraries.

The other way around might also be true: besides learning the code
and the libraries, you must learn the coding style, techniques and
abstraction layers in the project.

Not impossible, but definitely not trivial.

--
Octavio.


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Re: Opera is faster, but...

2007-07-09 Thread Octavio Alvarez

On Mon, 09 Jul 2007 12:20:33 -0700, Celejar <[EMAIL PROTECTED]> wrote:

>> > On an unrelated matter I installed Opera on Sid.
>> >
>> > It *is* faster than iceweasel.
>> >
>> I have always thought that FireFox was faster than Opera.
>
> Seamonkey it's the fastest.

None faster than elinks. ;-)


Is elinks faster than links and links2 (serious question, I don't have
any idea) ?


I really don't know...

--
Octavio.


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Re: Opera is faster, but...

2007-07-09 Thread Octavio Alvarez
On Mon, 09 Jul 2007 10:17:45 -0700, Orestes leal  
<[EMAIL PROTECTED]> wrote:



On Mon, 9 Jul 2007 13:05:11 -0400
Matthew K Poer <[EMAIL PROTECTED]> wrote:


On Monday 09 July 2007 1:06 pm, Hugo Vanwoerkom wrote:
> Hi,
>
> On an unrelated matter I installed Opera on Sid.
>
> It *is* faster than iceweasel.
>
> But because it hasn't got the ease of the adblock extension, that  
turns

> out to be a wash.
>
> Hugo

Are you *begging* for a flame war?

I have always thought that FireFox was faster than Opera. Did you use  
"safe

mode" (no extensions)?


What?
Seamonkey it's the fastest.


None faster than elinks. ;-)

--
Octavio.


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Re: [OT] gob.mx = IE6 only!

2007-07-08 Thread Octavio Alvarez
On Sun, 08 Jul 2007 05:33:46 -0700, Hugo Vanwoerkom <[EMAIL PROTECTED]>  
wrote:



Tried to register at this site:
http://www.trabajaen.gob.mx/servlet/CheckSecurity/JSP/jobsite_g/alta_usuarios_nuevos.jsp?estado=0

Complete registration will only work for Mexican nationals because of  
the RFC and CURB entries.


That would be "CURP".

When you hit any of the buttons in iceweasel, seamonkey or konqueror  
nothing happens! Neither with user-agent switcher!


So this is an official Mexican government site *hardcoded* to M$ IE!


No news here. It is not the only site.


They 've got to receive a pretty penny for this!


I don't think so. I would say they are simply stupid and lazy to really
put any effort on it. Mose people inside the IT business don't know or
care about the other options out there. And the "90%" excuse is good
enough for them. It goes well with Pareto's principle.

BTW, did you try using Opera? (Yes, I know, non-free, but an option
nonetheless.)

--
Octavio.



Re: XP and Debian: dual boot?

2007-05-28 Thread Octavio Alvarez

On Mon, 28 May 2007 22:25:15 -0700, <[EMAIL PROTECTED]> wrote:


I am planning to install the Debian with my XP as a dual boot. Any
suggestions where to go to find some nice guidelines for this
process...?


Usually Debian will detect your Windows partition and add an entry
for you automatically.

If it doesn't, here's mine (added at the end of /boot/grub/menu.lst):

# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/hdd2
title   Microsoft Windows XP Professional
root(hd2,1)
savedefault
chainloader +1

Make sure you change (hd2,1) for your Windows partition. Numbers are
zero-based, so (hd0,0) is the same as your first hard disk, first  
partition.



--
Octavio.


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Re: why linux?

2007-05-23 Thread Octavio Alvarez

On Wed, 23 May 2007 10:45:32 -0700, S C <[EMAIL PROTECTED]> wrote:

Using Ubuntu is a good idea too, in fact I have a live cd of Kubuntu and  
I also have Suse Linux 10.1 and 10.2.  But, and this you could not  
possibly know, irreplaceable pictures digital pictures are on the hard  
drive


http://www.virtualbox.org/

--
Octavio.


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Re: DNS in Windows environment

2007-05-14 Thread Octavio Alvarez
On Mon, 14 May 2007 12:52:08 -0700, Loeghmon T. Nejad <[EMAIL PROTECTED]>  
wrote:



I like to set up a DHCP/DNS server (on Debian Etch) for Windows clients,


*Only* DHCP/DNS?

DHCP is OS independant, so your question boils down to the DNS server.

You might want to either try setting up a WINS server (you might try SAMBA
for that) or set dynamic DNS up, where the DHCP server tells the DNS server
whenever there is an IP update and the DNS server updates its records
accordingly.

--
Octavio.


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Re: Problem with iptables

2007-05-04 Thread Octavio Alvarez

On Fri, 04 May 2007 00:45:06 -0700, Pierguido <[EMAIL PROTECTED]> wrote:


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Karl E. Jorgensen wrote:

Strange: With this rule as the *first* rule in the OUTPUT chain,
*everything* outgoing should be accepted, regardless of source,
destination or protocol!?


out_lan0--  192.168.30.103   0.0.0.0/0
out_public_lan_124  0--  192.168.100.20.0.0.0/0
out_public_lan_125  0--  192.168.100.50.0.0.0/0
ACCEPT 0--  0.0.0.0/00.0.0.0/0   state  
RELATED
ULOG   0--  0.0.0.0/00.0.0.0/0   limit:  
avg 1/sec burst 5 ULOG copy_range 0 nlgroup 1 prefix `'OUT-unknown:''  
queue_threshold 1


And yet your log entry appears to be the result of this rule...


DROP   0--  0.0.0.0/00.0.0.0/0


Are you 100% sure that these were the rules in effect at the time of the
log entry? It's not making sense ...

Yes...100% sure...i was doing many test and the result was that i had to
disable firehol (and iptables as well).


Check an iptables-save output to see if these rules are matched
against a different interface than intented.

--
Octavio.


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Re: debian way to start firewall

2007-05-03 Thread Octavio Alvarez
On Thu, 03 May 2007 17:30:47 -0700, Tom Furie <[EMAIL PROTECTED]>  
wrote:



On Wed, May 02, 2007 at 08:04:53AM -0700, Octavio Alvarez wrote:


You might as well put some iptables-restore at the endo of the "up"
of each interface in /etc/network/interfaces. This lets you control
your firewall per interface and have only the needed rules alive.


Wouldn't you be better putting the iptables-restore stuff in the pre-up
line? That way the firewall rules are in place before the interface is
live.


I'm not sure, but I guess not. Consider a line like

-A INPUT -i eth0 -j ACCEPT

Will iptables accept the "-i eth0" before eth0 actually exists? I don't
remember.

Cheers.

--
Octavio.


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Re: debian way to start firewall

2007-05-02 Thread Octavio Alvarez
On Wed, 02 May 2007 04:06:13 -0700, Vladi Lemurov <[EMAIL PROTECTED]>  
wrote:



Distro etch, stable, i386.
I have a firewall script (based on iptables) and it works perfectly on  
debian and other distros but where am I to put it? I found nothing in  
debian-reference (at least grepping "iptables" gave no answers). I  
googled and found different solutions based on putting script in init.d  
and linking it to rc[0-6]. That's all right and will work but is there  
"debian way" to do that?


You might as well put some iptables-restore at the endo of the "up"
of each interface in /etc/network/interfaces. This lets you control
your firewall per interface and have only the needed rules alive.

--
Octavio.


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Re: serial-usb adapter on Etch?

2007-04-26 Thread Octavio Alvarez

On Thu, 26 Apr 2007 00:22:30 -0700, eva sjuve <[EMAIL PROTECTED]> wrote:


I'm looking for an serial-usb adapter (usb-db9) that has
drivers in Etch?


I'm currently using a Prolific PL-2303. (w/o brand)


--
Octavio.


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Re: Unix-ify File Names

2007-04-21 Thread Octavio Alvarez
On Sat, 21 Apr 2007 05:26:40 -0700, Thomas Jollans <[EMAIL PROTECTED]>  
wrote:

FS="
"


IFS, I suppose. But: Why do you set it?

ugh... good question. I wrote this ages ago ;-)


To make sure spaces in filenames don't break them apart?

--
Octavio.



Re: Unix-ify File Names

2007-04-17 Thread Octavio Alvarez
On Mon, 16 Apr 2007 20:24:57 -0700, Masatran, R. Deepak  
<[EMAIL PROTECTED]> wrote:


Since I frequently receive files from Microsoft Windows users, is there  
any

utility to unix-ify file names, that is, use lower case exclusively, use
hyphen as separator, etc.?


I use something like this:

#!/bin/bash

OLD_FILE_NAME=$1

# You might want to add a y/ rule to remove accents.
NEW_FILE_NAME=`echo "ABC DEF" | sed -e '\
s/ /-/g;
y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/;
'`

mv $OLD_FILE_NAME $NEW_FILE_NAME




--
Octavio.