Re: Bug#242575: regexp-pp dies while compiling on ia64, debian BTS : #242575 (PR#2446)
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
Reply to: