public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Strange strings in GCC compiled code
@ 1999-09-07 15:52 Nimar Arora
  1999-09-07 16:21 ` Russ Allbery
                   ` (3 more replies)
  0 siblings, 4 replies; 16+ messages in thread
From: Nimar Arora @ 1999-09-07 15:52 UTC (permalink / raw)
  To: gcc; +Cc: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1234 bytes --]

Hello GCC Gurus,

I recently downloaded and installed GCC-2.95 on Win95 and compiled the
standard Hello World program. The program runs fine but after running
'strings' on the executable, a.exe, I found the following HTML tags
which include private information like login name on Web mail servers.
What is going on? How do I turn off generation of this information?

Thanks,

Nimar.

03366;text-decoration:none"><b>Inbox</b></font></a> </td>
<td bgcolor="#336699"> <a
href="/cgi-bin/compose?disk=207.82.250.148_d500&l
ogin=dk_aristotle&f=33792&curmbox=ACTIVE&_lang=&beta="><font
face="arial, sans-s
erif" size=2 color="#ffffff" style="colo
se</b></font></a> </td>
<td bgcolor="#336699"> <a
href="/cgi-bin/addresses?disk=207.82.250.148_d500
&login=dk_aristotle&f=33792&curmbox=ACTIVE&_lang=&beta="><font
face="arial, sans
-serif" size=2 color="#ffffff"
style="color:#ffffff;text-decoration:none"><b>Add
resses</b></font></a> </td>
<td bgcolor="#336699"> <a
href="/cgi-bin/folders?disk=207.82.250.148_d500&l
ogin=dk_aristotle&f=33792&curmbox=ACTIVE&_lang=&beta="><font
face="arial, sans-s
erif" si



__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Strange strings in GCC compiled code
  1999-09-07 15:52 Strange strings in GCC compiled code Nimar Arora
@ 1999-09-07 16:21 ` Russ Allbery
  1999-09-30 18:02   ` Russ Allbery
  1999-09-08  1:46 ` Eli Zaretskii
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 16+ messages in thread
From: Russ Allbery @ 1999-09-07 16:21 UTC (permalink / raw)
  To: Nimar Arora; +Cc: gcc, gcc-bugs

Nimar Arora <nimar_arora@yahoo.com> writes:

> I recently downloaded and installed GCC-2.95 on Win95 and compiled the
> standard Hello World program. The program runs fine but after running
> 'strings' on the executable, a.exe, I found the following HTML tags
> which include private information like login name on Web mail servers.

I've not personally verified the following, but I've heard it a sufficient
number of times from sources I trust that I'm pretty confident it's the
explanation:

Windows doesn't clear out blocks used by old files; it happily reuses them
with their data intact, just puts an end of file marker before the old
junk.  So it's quite common to see all sorts of random old data off your
disk end up at the end of various files.

If the above guess is right, it's a file system property, and there isn't
much gcc can do about it.  gcc isn't doing this intentionally.

-- 
Russ Allbery (rra@stanford.edu)         <URL: http://www.eyrie.org/~eagle/ >

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Strange strings in GCC compiled code
  1999-09-07 15:52 Strange strings in GCC compiled code Nimar Arora
  1999-09-07 16:21 ` Russ Allbery
@ 1999-09-08  1:46 ` Eli Zaretskii
  1999-09-30 18:02   ` Eli Zaretskii
  1999-09-08  1:50 ` Eli Zaretskii
  1999-09-30 18:02 ` Nimar Arora
  3 siblings, 1 reply; 16+ messages in thread
From: Eli Zaretskii @ 1999-09-08  1:46 UTC (permalink / raw)
  To: gcc; +Cc: gcc-bugs, Nimar Arora

> I recently downloaded and installed GCC-2.95 on Win95 and compiled the
> standard Hello World program. The program runs fine but after running
> 'strings' on the executable, a.exe, I found the following HTML tags
> which include private information like login name on Web mail servers.
> What is going on?

Please always make a point of telling which port of GCC are you
using.  If it is the DJGPP port, I might have a solution for this
problem.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Strange strings in GCC compiled code
  1999-09-07 15:52 Strange strings in GCC compiled code Nimar Arora
  1999-09-07 16:21 ` Russ Allbery
  1999-09-08  1:46 ` Eli Zaretskii
@ 1999-09-08  1:50 ` Eli Zaretskii
  1999-09-08  2:10   ` Nick Ing-Simmons
                     ` (2 more replies)
  1999-09-30 18:02 ` Nimar Arora
  3 siblings, 3 replies; 16+ messages in thread
From: Eli Zaretskii @ 1999-09-08  1:50 UTC (permalink / raw)
  To: Russ Allbery; +Cc: gcc, gcc-bugs

> Windows doesn't clear out blocks used by old files; it happily reuses them
> with their data intact, just puts an end of file marker before the old
> junk.  So it's quite common to see all sorts of random old data off your
> disk end up at the end of various files.

The above is true AFAIK.  However, it doesn't have anything to do with
the problem described by the original poster.  The problem was that
this junk was reported by the `strings' utility.  Since `strings' uses
normal file I/O (as opposed to direct disk reads), it cannot see
anything beyond the last byte of the actual file data.  The junk you
describe begins *after* the file's data.

In other words, the junk reported by the original poster was part of
the file's data, not something beyond the (logical) EOF marker.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Strange strings in GCC compiled code
  1999-09-08  1:50 ` Eli Zaretskii
@ 1999-09-08  2:10   ` Nick Ing-Simmons
  1999-09-30 18:02     ` Nick Ing-Simmons
  1999-09-08  4:25   ` Eli Zaretskii
  1999-09-30 18:02   ` Eli Zaretskii
  2 siblings, 1 reply; 16+ messages in thread
From: Nick Ing-Simmons @ 1999-09-08  2:10 UTC (permalink / raw)
  To: eliz; +Cc: gcc, gcc-bugs, Russ Allbery

Eli Zaretskii <eliz@gnu.org> writes:
>> Windows doesn't clear out blocks used by old files; it happily reuses them
>> with their data intact, just puts an end of file marker before the old
>> junk.  So it's quite common to see all sorts of random old data off your
>> disk end up at the end of various files.
>
>The above is true AFAIK.  However, it doesn't have anything to do with
>the problem described by the original poster.  The problem was that
>this junk was reported by the `strings' utility.  Since `strings' uses
>normal file I/O (as opposed to direct disk reads), it cannot see
>anything beyond the last byte of the actual file data.  The junk you
>describe begins *after* the file's data.
>
>In other words, the junk reported by the original poster was part of
>the file's data, not something beyond the (logical) EOF marker.

But if (as is likely) binutils seeks down the file and does a write
then junk is exposed if not overwritten.

-- 
Nick Ing-Simmons <nik@tiuk.ti.com>
Via, but not speaking for: Texas Instruments Ltd.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Strange strings in GCC compiled code
  1999-09-08  1:50 ` Eli Zaretskii
  1999-09-08  2:10   ` Nick Ing-Simmons
@ 1999-09-08  4:25   ` Eli Zaretskii
  1999-09-30 18:02     ` Eli Zaretskii
  1999-09-30 18:02   ` Eli Zaretskii
  2 siblings, 1 reply; 16+ messages in thread
From: Eli Zaretskii @ 1999-09-08  4:25 UTC (permalink / raw)
  To: Nick Ing-Simmons; +Cc: gcc, gcc-bugs, Russ Allbery

> But if (as is likely) binutils seeks down the file and does a write
> then junk is exposed if not overwritten.

I don't think Binutils work this way, at least not on all platforms.
Also, if this *does* happen, the junk usually comes from memory, not
from the disk.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Strange strings in GCC compiled code
  1999-09-08  2:10   ` Nick Ing-Simmons
@ 1999-09-30 18:02     ` Nick Ing-Simmons
  0 siblings, 0 replies; 16+ messages in thread
From: Nick Ing-Simmons @ 1999-09-30 18:02 UTC (permalink / raw)
  To: eliz; +Cc: gcc, gcc-bugs, Russ Allbery

Eli Zaretskii <eliz@gnu.org> writes:
>> Windows doesn't clear out blocks used by old files; it happily reuses them
>> with their data intact, just puts an end of file marker before the old
>> junk.  So it's quite common to see all sorts of random old data off your
>> disk end up at the end of various files.
>
>The above is true AFAIK.  However, it doesn't have anything to do with
>the problem described by the original poster.  The problem was that
>this junk was reported by the `strings' utility.  Since `strings' uses
>normal file I/O (as opposed to direct disk reads), it cannot see
>anything beyond the last byte of the actual file data.  The junk you
>describe begins *after* the file's data.
>
>In other words, the junk reported by the original poster was part of
>the file's data, not something beyond the (logical) EOF marker.

But if (as is likely) binutils seeks down the file and does a write
then junk is exposed if not overwritten.

-- 
Nick Ing-Simmons <nik@tiuk.ti.com>
Via, but not speaking for: Texas Instruments Ltd.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Strange strings in GCC compiled code
  1999-09-08  1:50 ` Eli Zaretskii
  1999-09-08  2:10   ` Nick Ing-Simmons
  1999-09-08  4:25   ` Eli Zaretskii
@ 1999-09-30 18:02   ` Eli Zaretskii
  2 siblings, 0 replies; 16+ messages in thread
From: Eli Zaretskii @ 1999-09-30 18:02 UTC (permalink / raw)
  To: Russ Allbery; +Cc: gcc, gcc-bugs

> Windows doesn't clear out blocks used by old files; it happily reuses them
> with their data intact, just puts an end of file marker before the old
> junk.  So it's quite common to see all sorts of random old data off your
> disk end up at the end of various files.

The above is true AFAIK.  However, it doesn't have anything to do with
the problem described by the original poster.  The problem was that
this junk was reported by the `strings' utility.  Since `strings' uses
normal file I/O (as opposed to direct disk reads), it cannot see
anything beyond the last byte of the actual file data.  The junk you
describe begins *after* the file's data.

In other words, the junk reported by the original poster was part of
the file's data, not something beyond the (logical) EOF marker.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Strange strings in GCC compiled code
  1999-09-08  1:46 ` Eli Zaretskii
@ 1999-09-30 18:02   ` Eli Zaretskii
  0 siblings, 0 replies; 16+ messages in thread
From: Eli Zaretskii @ 1999-09-30 18:02 UTC (permalink / raw)
  To: gcc; +Cc: gcc-bugs, Nimar Arora

> I recently downloaded and installed GCC-2.95 on Win95 and compiled the
> standard Hello World program. The program runs fine but after running
> 'strings' on the executable, a.exe, I found the following HTML tags
> which include private information like login name on Web mail servers.
> What is going on?

Please always make a point of telling which port of GCC are you
using.  If it is the DJGPP port, I might have a solution for this
problem.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Strange strings in GCC compiled code
  1999-09-08  4:25   ` Eli Zaretskii
@ 1999-09-30 18:02     ` Eli Zaretskii
  0 siblings, 0 replies; 16+ messages in thread
From: Eli Zaretskii @ 1999-09-30 18:02 UTC (permalink / raw)
  To: Nick Ing-Simmons; +Cc: gcc, gcc-bugs, Russ Allbery

> But if (as is likely) binutils seeks down the file and does a write
> then junk is exposed if not overwritten.

I don't think Binutils work this way, at least not on all platforms.
Also, if this *does* happen, the junk usually comes from memory, not
from the disk.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Strange strings in GCC compiled code
  1999-09-07 15:52 Strange strings in GCC compiled code Nimar Arora
                   ` (2 preceding siblings ...)
  1999-09-08  1:50 ` Eli Zaretskii
@ 1999-09-30 18:02 ` Nimar Arora
  3 siblings, 0 replies; 16+ messages in thread
From: Nimar Arora @ 1999-09-30 18:02 UTC (permalink / raw)
  To: gcc; +Cc: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1234 bytes --]

Hello GCC Gurus,

I recently downloaded and installed GCC-2.95 on Win95 and compiled the
standard Hello World program. The program runs fine but after running
'strings' on the executable, a.exe, I found the following HTML tags
which include private information like login name on Web mail servers.
What is going on? How do I turn off generation of this information?

Thanks,

Nimar.

03366;text-decoration:none"><b>Inbox</b></font></a> </td>
<td bgcolor="#336699"> <a
href="/cgi-bin/compose?disk=207.82.250.148_d500&l
ogin=dk_aristotle&f=33792&curmbox=ACTIVE&_lang=&beta="><font
face="arial, sans-s
erif" size=2 color="#ffffff" style="colo
se</b></font></a> </td>
<td bgcolor="#336699"> <a
href="/cgi-bin/addresses?disk=207.82.250.148_d500
&login=dk_aristotle&f=33792&curmbox=ACTIVE&_lang=&beta="><font
face="arial, sans
-serif" size=2 color="#ffffff"
style="color:#ffffff;text-decoration:none"><b>Add
resses</b></font></a> </td>
<td bgcolor="#336699"> <a
href="/cgi-bin/folders?disk=207.82.250.148_d500&l
ogin=dk_aristotle&f=33792&curmbox=ACTIVE&_lang=&beta="><font
face="arial, sans-s
erif" si



__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Strange strings in GCC compiled code
  1999-09-07 16:21 ` Russ Allbery
@ 1999-09-30 18:02   ` Russ Allbery
  0 siblings, 0 replies; 16+ messages in thread
From: Russ Allbery @ 1999-09-30 18:02 UTC (permalink / raw)
  To: Nimar Arora; +Cc: gcc, gcc-bugs

Nimar Arora <nimar_arora@yahoo.com> writes:

> I recently downloaded and installed GCC-2.95 on Win95 and compiled the
> standard Hello World program. The program runs fine but after running
> 'strings' on the executable, a.exe, I found the following HTML tags
> which include private information like login name on Web mail servers.

I've not personally verified the following, but I've heard it a sufficient
number of times from sources I trust that I'm pretty confident it's the
explanation:

Windows doesn't clear out blocks used by old files; it happily reuses them
with their data intact, just puts an end of file marker before the old
junk.  So it's quite common to see all sorts of random old data off your
disk end up at the end of various files.

If the above guess is right, it's a file system property, and there isn't
much gcc can do about it.  gcc isn't doing this intentionally.

-- 
Russ Allbery (rra@stanford.edu)         <URL: http://www.eyrie.org/~eagle/ >

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Strange strings in GCC compiled code
  1999-09-08 13:32 Nimar Arora
  1999-09-08 14:39 ` Mumit Khan
@ 1999-09-30 18:02 ` Nimar Arora
  1 sibling, 0 replies; 16+ messages in thread
From: Nimar Arora @ 1999-09-30 18:02 UTC (permalink / raw)
  To: Eli Zaretskii, gcc; +Cc: gcc-bugs, Nimar Arora

I'm using MINGW. i.e. the version which relies only on CRTDLL.

-- Nimar

--- Eli Zaretskii <eliz@gnu.org> wrote:
> 
> > I recently downloaded and installed GCC-2.95 on
> Win95 and compiled the
> > standard Hello World program. The program runs
> fine but after running
> > 'strings' on the executable, a.exe, I found the
> following HTML tags
> > which include private information like login name
> on Web mail servers.
> > What is going on?
> 
> Please always make a point of telling which port of
> GCC are you
> using.  If it is the DJGPP port, I might have a
> solution for this
> problem.
> 

__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Strange strings in GCC compiled code
  1999-09-08 14:39 ` Mumit Khan
@ 1999-09-30 18:02   ` Mumit Khan
  0 siblings, 0 replies; 16+ messages in thread
From: Mumit Khan @ 1999-09-30 18:02 UTC (permalink / raw)
  To: Nimar Arora; +Cc: Eli Zaretskii, gcc, gcc-bugs

Nimar Arora <nimar_arora@yahoo.com> writes:
> I'm using MINGW. i.e. the version which relies only on CRTDLL.
> 
> -- Nimar
> 
> --- Eli Zaretskii <eliz@gnu.org> wrote:
> > 
> > > I recently downloaded and installed GCC-2.95 on
> > Win95 and compiled the
> > > standard Hello World program. The program runs
> > fine but after running
> > > 'strings' on the executable, a.exe, I found the
> > following HTML tags
> > > which include private information like login name
> > on Web mail servers.
> > > What is going on?
> > 
> > Please always make a point of telling which port of
> > GCC are you
> > using.  If it is the DJGPP port, I might have a
> > solution for this
> > problem.

This is an OS (if you can call Windows 9x an OS ;-) issue, which does
not zero out the file area if you seek past the end and then write.
NT does handle it correctly, and I believe Windows 2000 does as well.

You can always complain to the OS vendor as to why they allow such a
hole in the OS.

I suppose we'll have to deal with this in binutils sooner or later.
It's on my todo list (and I have contributed patches that I haven't
had time to look at yet). Binutils maintainer Ian Taylor knows about
this problem as well. Cygwin works around this issue, but since Mingw
uses Microsoft's own runtime, we can't do the same for Mingw without
some ugly hacks.

Regards,
Mumit


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Strange strings in GCC compiled code
  1999-09-08 13:32 Nimar Arora
@ 1999-09-08 14:39 ` Mumit Khan
  1999-09-30 18:02   ` Mumit Khan
  1999-09-30 18:02 ` Nimar Arora
  1 sibling, 1 reply; 16+ messages in thread
From: Mumit Khan @ 1999-09-08 14:39 UTC (permalink / raw)
  To: Nimar Arora; +Cc: Eli Zaretskii, gcc, gcc-bugs

Nimar Arora <nimar_arora@yahoo.com> writes:
> I'm using MINGW. i.e. the version which relies only on CRTDLL.
> 
> -- Nimar
> 
> --- Eli Zaretskii <eliz@gnu.org> wrote:
> > 
> > > I recently downloaded and installed GCC-2.95 on
> > Win95 and compiled the
> > > standard Hello World program. The program runs
> > fine but after running
> > > 'strings' on the executable, a.exe, I found the
> > following HTML tags
> > > which include private information like login name
> > on Web mail servers.
> > > What is going on?
> > 
> > Please always make a point of telling which port of
> > GCC are you
> > using.  If it is the DJGPP port, I might have a
> > solution for this
> > problem.

This is an OS (if you can call Windows 9x an OS ;-) issue, which does
not zero out the file area if you seek past the end and then write.
NT does handle it correctly, and I believe Windows 2000 does as well.

You can always complain to the OS vendor as to why they allow such a
hole in the OS.

I suppose we'll have to deal with this in binutils sooner or later.
It's on my todo list (and I have contributed patches that I haven't
had time to look at yet). Binutils maintainer Ian Taylor knows about
this problem as well. Cygwin works around this issue, but since Mingw
uses Microsoft's own runtime, we can't do the same for Mingw without
some ugly hacks.

Regards,
Mumit


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Strange strings in GCC compiled code
@ 1999-09-08 13:32 Nimar Arora
  1999-09-08 14:39 ` Mumit Khan
  1999-09-30 18:02 ` Nimar Arora
  0 siblings, 2 replies; 16+ messages in thread
From: Nimar Arora @ 1999-09-08 13:32 UTC (permalink / raw)
  To: Eli Zaretskii, gcc; +Cc: gcc-bugs, Nimar Arora

I'm using MINGW. i.e. the version which relies only on CRTDLL.

-- Nimar

--- Eli Zaretskii <eliz@gnu.org> wrote:
> 
> > I recently downloaded and installed GCC-2.95 on
> Win95 and compiled the
> > standard Hello World program. The program runs
> fine but after running
> > 'strings' on the executable, a.exe, I found the
> following HTML tags
> > which include private information like login name
> on Web mail servers.
> > What is going on?
> 
> Please always make a point of telling which port of
> GCC are you
> using.  If it is the DJGPP port, I might have a
> solution for this
> problem.
> 

__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~1999-09-30 18:02 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-09-07 15:52 Strange strings in GCC compiled code Nimar Arora
1999-09-07 16:21 ` Russ Allbery
1999-09-30 18:02   ` Russ Allbery
1999-09-08  1:46 ` Eli Zaretskii
1999-09-30 18:02   ` Eli Zaretskii
1999-09-08  1:50 ` Eli Zaretskii
1999-09-08  2:10   ` Nick Ing-Simmons
1999-09-30 18:02     ` Nick Ing-Simmons
1999-09-08  4:25   ` Eli Zaretskii
1999-09-30 18:02     ` Eli Zaretskii
1999-09-30 18:02   ` Eli Zaretskii
1999-09-30 18:02 ` Nimar Arora
1999-09-08 13:32 Nimar Arora
1999-09-08 14:39 ` Mumit Khan
1999-09-30 18:02   ` Mumit Khan
1999-09-30 18:02 ` Nimar Arora

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).