Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re: [Caml-list] Question on -g #6251

Closed
vicuna opened this issue Oct 15, 2002 · 3 comments
Closed

Re: [Caml-list] Question on -g #6251

vicuna opened this issue Oct 15, 2002 · 3 comments
Labels

Comments

@vicuna
Copy link

vicuna commented Oct 15, 2002

Original bug ID: 1440
Reporter: administrator
Status: closed
Resolution: not a bug
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug description

Xavier Leroy wrote:

Does [ocamlc.opt] handle the -g flag?

Yes, just like ocamlc. Both ocamlc and ocamlc.opt share exactly the
same Caml sources.

Apparently it does not.

I ask because I am unable to
debug my software, and I am using ocamlc.opt as my compiler.

Does switching to ocamlc make any difference?

  • Xavier Leroy

This terminal session pinpoints the problem. NB: the default
value provided by the Makefiles to OCAMLFIND_COMMANDS is
"ocamlc=ocamlc ocamlopt=ocamlopt". Previously, when I posted
my question on the -g flag I was using by default the native
compilers.

[alex@athlon dmd]$ make clean > /dev/null 2>&1
[alex@athlon dmd]$ make DEBUG=yes all > /dev/null 2>&1
[alex@athlon dmd]$ md5sum ocaml/afo/afo.cgi
ocaml/afo/frontends/bolle_auto/autoddt
e08682c7390e85714416d5657390dc7d ocaml/afo/afo.cgi
3693f4f81e9754c79c4d11f5baa0b4bc
ocaml/afo/frontends/bolle_auto/autoddt
[alex@athlon dmd]$ md5sum ocaml/afo/afo.cgi
ocaml/afo/frontends/bolle_auto/autoddt > result.sum
[alex@athlon dmd]$ make clean > /dev/null 2>&1
[alex@athlon dmd]$ make DEBUG=yes
OCAMLFIND_COMMANDS="ocamlc=ocamlc.opt ocamlopt=ocamlopt.opt"
all > /dev/null 2>&1
[alex@athlon dmd]$ md5sum ocaml/afo/afo.cgi
ocaml/afo/frontends/bolle_auto/autoddt
4d4342ad646e78b1d9e5ad95a5f8af92 ocaml/afo/afo.cgi
83401d02add39d20d94c90ef95b90785
ocaml/afo/frontends/bolle_auto/autoddt
[alex@athlon dmd]$ md5sum -c result.sum
ocaml/afo/afo.cgi: FAILED
ocaml/afo/frontends/bolle_auto/autoddt: FAILED
md5sum: WARNING: 2 of 2 computed checksums did NOT match

Good luck!

Alex

@vicuna
Copy link
Author

vicuna commented Oct 16, 2002

Comment author: administrator

What do you mean exactly here, telling us this :

[alex@athlon dmd]$ make clean > /dev/null 2>&1
[alex@athlon dmd]$ make DEBUG=yes all > /dev/null 2>&1
[alex@athlon dmd]$ md5sum ocaml/afo/afo.cgi
ocaml/afo/frontends/bolle_auto/autoddt
e08682c7390e85714416d5657390dc7d ocaml/afo/afo.cgi
3693f4f81e9754c79c4d11f5baa0b4bc
ocaml/afo/frontends/bolle_auto/autoddt
[alex@athlon dmd]$ md5sum ocaml/afo/afo.cgi
ocaml/afo/frontends/bolle_auto/autoddt > result.sum
[alex@athlon dmd]$ make clean > /dev/null 2>&1
[alex@athlon dmd]$ make DEBUG=yes
OCAMLFIND_COMMANDS="ocamlc=ocamlc.opt ocamlopt=ocamlopt.opt"
all > /dev/null 2>&1
[alex@athlon dmd]$ md5sum ocaml/afo/afo.cgi
ocaml/afo/frontends/bolle_auto/autoddt
4d4342ad646e78b1d9e5ad95a5f8af92 ocaml/afo/afo.cgi
83401d02add39d20d94c90ef95b90785
ocaml/afo/frontends/bolle_auto/autoddt
[alex@athlon dmd]$ md5sum -c result.sum
ocaml/afo/afo.cgi: FAILED
ocaml/afo/frontends/bolle_auto/autoddt: FAILED
md5sum: WARNING: 2 of 2 computed checksums did NOT match

An easy check on my computer (linux RedHat 7.2) on a very simple program shows
that both << ocamlc >> and << ocamlc.opt >> (version 3.06), when given
the -g flag produce some code that I can run under ocamldebug.
This answers you first question, if I am not wrong.

So, what is your point exactly ?

As told by Xavier ocamlc and ocamlc.opt are compiled from the same
sources, but by different compilers.
Xavier suggested that you attempt to compile your program
with ocamlc, to see whether your problem is still here or not. You
answer with some md5 checksums. Come on, we are human beings ! We
understand the so called « natural » language much better.

In fact, if you think you have found a bug, please fill a bug report.
A bug report includes, the version of caml you use, the machine you
are working on, a clear description of the bug and some code that
triggers the bug (the shorter the better). Ah I know, this takes
some of your precious time...

Otherwise « c'est une bouteille à la mer... ».

Please condider that I am by no way aggressive. Any suggestion/remark
is welcome. For instance, your remarks on matching strings with
regular expressions made me work on ocamllex.
Please help us !

--Luc

@vicuna
Copy link
Author

vicuna commented Oct 17, 2002

Comment author: administrator

Luc Maranget wrote:

What do you mean exactly here, telling us this :

...

Ok, I overshot the mark. I was just trying to show
concisely--maybe too concisely--that the executables made by
my build system differ depending on the value of the
OCAMLFIND_COMMANDS variable. This variable is set to
"ocamlc=ocamlc ocamlopt=ocamlopt" by default in my
makefiles. If I try to use the optimized compilers by
passing "ocamlc=ocamlc.opt ocamlopt=ocamlopt.opt" to the
makefile, while at the same time setting DEBUG=yes, which
toggles the use of the -g flag, I get executables which are
not accepted by ocamldebug. I had already mentioned
something to this effect, but a couple of days ago I was
able to prove my point--to myself, at least--by adding a
sensible build system based on the recursive use of GNU make
in my source tree. The use of the md5 checksums is just any
way to show that the output of the two builds is different.
It's not really definitive evidence that there is a bug in
ocamlc.opt, but it is fairly convincing to me. Just consider
that all I had to do to be able to debug my software was to
change the default value of OCAMLFIND_COMMANDS in my
Makefile--previously set for the use of the .opt compilers.

An easy check on my computer (linux RedHat 7.2) on a very simple program shows
that both << ocamlc >> and << ocamlc.opt >> (version 3.06), when given
the -g flag produce some code that I can run under ocamldebug.
This answers you first question, if I am not wrong.

Well, not really. We both know very well that if two
programs, given the same input, generate the same output, be
no means may we conclude that the compute the same function.
Besides, it is also known that in particular situations code
compiled with ocamlopt behaves differently than code
compiled with ocamlc. This implies that a bigger test case
(my program is about 500KB of code)

So, what is your point exactly ?

I think I explained it as best as I can, now.

As told by Xavier ocamlc and ocamlc.opt are compiled from the same
sources, but by different compilers.
Xavier suggested that you attempt to compile your program
with ocamlc, to see whether your problem is still here or not. You
answer with some md5 checksums. Come on, we are human beings ! We
understand the so called « natural » language much better.

Sorry. I was in such a rush to complete my program that I
did not realize that that snippet of terminal session was
probably meaningful only to me. All work and no play ...

In fact, if you think you have found a bug, please fill a bug report.
A bug report includes, the version of caml you use, the machine you
are working on, a clear description of the bug and some code that
triggers the bug (the shorter the better). Ah I know, this takes
some of your precious time...

Otherwise « c'est une bouteille à la mer... ».

I don't think my time is any more precious than yours. It's
just that I had gotten so much involved in my code that I
was almost expecting you guys to simply have to know what I
was talking about.

Anyway, here are the details:
ocaml-3.06-1.i686.mk81.rpm
(The following is the output of ocamlfind list)
bigarray (version: [distributed with Ocaml])
camlp4 (version: Camlp4 version 3.06)
cgi (version: 0.93)
dbm (version: [distributed with Ocaml])
dynlink (version: [distributed with Ocaml])
findlib (version: 0.7.2)
graphics (version: [distributed with Ocaml])
lablgtk (version: 1.2.5)
labltk (version: [distributed with Ocaml])
netstring (version: 0.93)
num (version: [distributed with Ocaml])
pcre (version: 4.28.2)
postgres (version: 20010808)
pxp (version: 1.1.5)
pxp-engine (version: 1.1.5)
pxp-lex-iso88591 (version: 1.1.5)
pxp-lex-utf8 (version: 1.1.5)
report (version: 0.4)
stdlib (version: [distributed with Ocaml])
str (version: [distributed with Ocaml])
text-to-xml (version: 20020915)
threads (version: [distributed with Ocaml])
unix (version: [distributed with Ocaml])

I work on a Mandrake Linux box, Athlon processor.
gcc --version -> 2.96
glibc-2.2.4
Linux 2.4.18
GNU make 3.79.1
OCamlMakefile 4.24.0 + a recent patch for the use of
ocamlfind with the -pack option.

I don't think I omitted anything relevant, but if there's
anything else you need to know I'll be glad to answer.

As far as a code sample goes, it'll take me time to prepare
one. And this is for at least two reasons. I use ocaml to
earn myself a living, which makes it a very important thing
for me, but it also means that I can only devote a
relatively small fraction of my time on investigating the
language itself, as opposed to using it to make stuff I can
sell to my clients. Of course, I am very much interested the
progress of Ocaml, so I will take the time to investigate
this bug, but it won't be tonight--I need to get some sleep
or I'll fall to pieces in a matter of days--or tomorrow. But
next week I might put together a minimal example. The second
reason is that my code is rather intricate, mainly due to
lack of programming ability on my part, partly due to the
non banal nature of the task. This means that extracting
something sensible to show you will take quite some effort
on my part. You'll have to bear with me.

Please condider that I am by no way aggressive. Any suggestion/remark
is welcome. For instance, your remarks on matching strings with
regular expressions made me work on ocamllex.
Please help us !

I really enjoy participating in the life and works of the
Ocaml community. I am striving to learn as much as possible,
in order to be able to be an active member of the community.
Notwithstanding my good will, you will see me write nonsense
every so often: this is what happens when you work as a
freelance consultant during the day, and as a freelance
programmer--the consultant's partner--during the night ;)

Thank you very much for your time and interest.

Alex Baretta

@vicuna
Copy link
Author

vicuna commented Oct 29, 2002

Comment author: administrator

Can't reproduce

@vicuna vicuna closed this as completed Oct 29, 2002
@vicuna vicuna added the bug label Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant