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

regexp-pp dies while compiling on ia64, debian BTS : #242575 #2446

Closed
vicuna opened this issue Apr 13, 2004 · 4 comments
Closed

regexp-pp dies while compiling on ia64, debian BTS : #242575 #2446

vicuna opened this issue Apr 13, 2004 · 4 comments
Labels

Comments

@vicuna
Copy link

vicuna commented Apr 13, 2004

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

Bug description

tags 242575 + upstream
thanks

Hello,

I have gotten bug report :

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=242575

About regexp-pp failing to compile on ia64, while it seems fine on x86
and other arches. I investigated a bit, and it seems that indeed, doing
the exact execution line by hand cause the problem to appear.

The full build log is at :

http://buildd.debian.org/build.php?arch=ia64&pkg=regexp-pp&ver=0.9.3-2

But i will copy the relevant part here :

make[2]: Entering directory /build/buildd/regexp-pp-0.9.3/common' /usr/bin/make -f ../OCamlMakefile \ RESULT=version_filter \ SOURCES=version_filter.ml \ LIBS="str unix" \ bc make[3]: Entering directory /build/buildd/regexp-pp-0.9.3/common'
make[4]: Entering directory /build/buildd/regexp-pp-0.9.3/common' making ._d/version_filter.d from version_filter.ml make[4]: Leaving directory /build/buildd/regexp-pp-0.9.3/common'
make[4]: Entering directory /build/buildd/regexp-pp-0.9.3/common' ocamlfind ocamlc -c -I /usr/lib/ocaml/3.07/camlp4 version_filter.ml ocamlfind ocamlc \ \ -I /usr/lib/ocaml/3.07/camlp4 str.cma unix.cma -o version_filter \ version_filter.cmo make[4]: Leaving directory /build/buildd/regexp-pp-0.9.3/common'
make[3]: Leaving directory /build/buildd/regexp-pp-0.9.3/common' make[3]: Entering directory /build/buildd/regexp-pp-0.9.3/common'
making ._bcdi/declare_once.di from declare_once.mli
making ._d/declare_once.d from declare_once.ml
Fatal error: exception Invalid_argument("Random.int")
Preprocessing error
make[3]: *** [._d/declare_once.d] Error 2
make[3]: *** Deleting file `._d/declare_once.d'

I was not able to really track the problem down, nor am i sure if this
is ocaml, camlp4 or even regexp-pp related. Furthermore, i don't really
have the time to look this over in the next time, but this is a rather
serious bug for debian, so any help in investigating this would be
welcome, especially so near the debian/sarge release. If you need access
to a ia64 box, i can try to arrange that.

Please, keep the debian bug report CCed also.

Friendly,

Sven Luther

@vicuna
Copy link
Author

vicuna commented Apr 13, 2004

Comment author: administrator

About regexp-pp failing to compile on ia64, while it seems fine on x86
and other arches. I investigated a bit, and it seems that indeed, doing
the exact execution line by hand cause the problem to appear.
[...]
making ._d/declare_once.d from declare_once.ml
Fatal error: exception Invalid_argument("Random.int")

From the Random.int documentation:

val int : int -> int
(** [Random.int bound] returns a random integer between 0 (inclusive)
and [bound] (exclusive). [bound] must be more than 0 and less
than 2{^30}. *)

Indeed, a quick look at the regexp-pp sources shows this code:

File common/version_filter.ml

let rec open_out_temp () =
let fname = "camlpp" ^ (string_of_int (Random.int max_int)) in
...

The call "Random.int max_int" is incorrect and it's just by chance
that it happens to work on a 32-bit platform.

I was not able to really track the problem down, nor am i sure if this
is ocaml, camlp4 or even regexp-pp related.

It's an obvious bug in regexp-pp. I put the author in Cc:.
"Random.int max_int" should be replaced by e.g. "Random.bits()"
or "Random.int 1000000".

  • Xavier Leroy

@vicuna
Copy link
Author

vicuna commented Apr 13, 2004

Comment author: administrator

reassign 242575 regexp-pp
thanks
On Tue, Apr 13, 2004 at 10:47:11AM +0200, Xavier Leroy wrote:

About regexp-pp failing to compile on ia64, while it seems fine on x86
and other arches. I investigated a bit, and it seems that indeed, doing
the exact execution line by hand cause the problem to appear.
[...]
making ._d/declare_once.d from declare_once.ml
Fatal error: exception Invalid_argument("Random.int")

From the Random.int documentation:

val int : int -> int
(** [Random.int bound] returns a random integer between 0 (inclusive)
and [bound] (exclusive). [bound] must be more than 0 and less
than 2{^30}. *)

Indeed, a quick look at the regexp-pp sources shows this code:

File common/version_filter.ml

let rec open_out_temp () =
let fname = "camlpp" ^ (string_of_int (Random.int max_int)) in
...

The call "Random.int max_int" is incorrect and it's just by chance
that it happens to work on a 32-bit platform.

I was not able to really track the problem down, nor am i sure if this
is ocaml, camlp4 or even regexp-pp related.

It's an obvious bug in regexp-pp. I put the author in Cc:.
"Random.int max_int" should be replaced by e.g. "Random.bits()"
or "Random.int 1000000".

Thanks, i will reassign this debian bug report to regexp-pp.

Friendly,

Sven Luther

@vicuna
Copy link
Author

vicuna commented Apr 13, 2004

Comment author: administrator

not an ocaml bug DD 2004-04-13

@vicuna vicuna closed this as completed Apr 13, 2004
@vicuna
Copy link
Author

vicuna commented Jun 10, 2004

Comment author: administrator

On Tue, 13 Apr 2004 10:47:11 +0200, Xavier Leroy xavier.leroy@inria.fr said:

Xavier> It's an obvious bug in regexp-pp. I put the author in Cc:.
Xavier> "Random.int max_int" should be replaced by e.g. "Random.bits()"
Xavier> or "Random.int 1000000".

Xavier> - Xavier Leroy

Xavier and Sven, Thank you very much for the bug report.

I have updated regexp-pp to support the latest CVS snapshot of OCaml.
The fix for 64-bit platform bug is included gratefully.

--
Yutaka Oiwa Yonezawa Lab., Dept. of Computer Science,
Graduate School of Information Sci. & Tech., Univ. of Tokyo.
Mail addresses: oiwa@yl.is.s.u-tokyo.ac.jp, yutaka@oiwa.jp
PGP fingerprint = C9 8D 5C B8 86 ED D8 07 EA 59 34 D8 F4 65 53 61

@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