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

Str.global_replace can fail for very large strings #7983

Closed
vicuna opened this issue Jan 3, 2003 · 2 comments
Closed

Str.global_replace can fail for very large strings #7983

vicuna opened this issue Jan 3, 2003 · 2 comments
Labels

Comments

@vicuna
Copy link

vicuna commented Jan 3, 2003

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

Bug description

Full_Name: mattias waldau
Version: 3.06
OS: cygwin and linux
Submission from: h13n2fls34o849.telia.com (217.208.235.13)

Str.global_replace empty_rows_pattern "\n" str ;; fails for the sample file
crash.ml,

[mattias@pfour excel2ocaml]$ ocamlc str.cma crash.ml
[mattias@pfour excel2ocaml]$ a.out
Fatal error: exception Failure("Str.search_forward")
(Program not linked with -g, cannot print stack backtrace)
[mattias@pfour excel2ocaml]$

The file crash.ml.gz can be found at

www.xleverywhere.com/tmp/crash.ml.gz

@vicuna
Copy link
Author

vicuna commented Jan 3, 2003

Comment author: administrator

Works OK with new implementation of Str (as of 2003-01-03)

@vicuna vicuna closed this as completed Jan 3, 2003
@vicuna
Copy link
Author

vicuna commented Jan 3, 2003

Comment author: administrator

Str.global_replace empty_rows_pattern "\n" str ;; fails for the sample file
crash.ml,

The Str implementation in OCaml 3.06 and earlier is known to fail on
certain large input strings. We are working on a reimplementation of
this library that behaves better. In particular, it runs your example
without any problems.

If you can't wait for the 3.07 release, your best bet is to use PCRE
instead of Str.

Best regards,

  • Xavier Leroy

@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