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

ocamlc linking failed due to Invalid_argument of String.create when with -g #5920

Closed
vicuna opened this Issue Feb 13, 2013 · 3 comments

Comments

Projects
None yet
1 participant
@vicuna
Copy link
Collaborator

vicuna commented Feb 13, 2013

Original bug ID: 5920
Reporter: furuse
Status: closed (set by @gasche on 2013-03-21T21:06:55Z)
Resolution: duplicate
Priority: normal
Severity: minor
Platform: Linux 32bit
Version: 4.00.1
Category: ~DO NOT USE (was: OCaml general)
Has duplicate: #5957
Related to: #8081 #5925 #7335

Bug description

Hi, today I tried to install patdiff ( https://bitbucket.org/janestreet/patdiff ) using OPAM, and found it failed:


ocamlfind ocamlc -g -linkpkg -package threads -package sexplib.syntax -package pcre -package core_extended -thread lib/patdiff_lib.cma ansi_terminal/ansi_terminal.cma bin/text.cmo bin/make_config.cmo bin/readme.cmo ansi_terminal/ansi_terminal.cmo lib/patdiff_lib.cmo bin/compare.cmo bin/patdiff.cmo -o bin/patdiff.byte

  • ocamlfind ocamlc -g -linkpkg -package threads -package sexplib.syntax -package pcre -package core_extended -thread lib/patdiff_lib.cma ansi_terminal/ansi_terminal.cma bin/text.cmo bin/make_config.cmo bin/readme.cmo ansi_terminal/ansi_terminal.cmo lib/patdiff_lib.cmo bin/compare.cmo bin/patdiff.cmo -o bin/patdiff.byte
    Fatal error: exception Invalid_argument("String.create")
    Command exited with code 2.

The same command without -g switch succeeded to create the executable bytecode, so I think the debugging information might exceeded the Sys.max_string_length here. My environment is Linux 32bits with 1G memory.

I think I am looking the same issue as issue #1615.

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Mar 12, 2013

Comment author: sebmondet

Hi

I got the same error while compiling https://github.com/smondet/flow on MacOSX 32bit (Darwin Kernel Version 9.8.0) with OCaml 4.00.1.

Removing '-g' also fixed the issue.

ocamlfind ocamlc -syntax camlp4o -package core,lwt,lwt.unix,lwt.ssl,lwt.preemptive,sexplib,sexplib.syntax -thread -bin-annot -annot -absname -warn-error P -I ../lib -g flow.cma -I . -custom -o io_test.run io_test.cmo -linkpkg
Fatal error: exception Invalid_argument("String.create")

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Mar 17, 2013

Comment author: @gasche

In 0005925 , Benoît Vaugon proposed two patches to fix a compiler failure on large computer-generated source files, the first of which implements "long string" support for large results of bytecode linking.

I'm not familiar with this part of the compiler so I'm not sure whether the String.create error you have comes from the exact same place (a stack trace would help), and reproducing is a bit painful.

Would any of you two care to apply Benoît's first patch ( http://caml.inria.fr/mantis/file_download.php?file_id=874&type=bug ) and report on whether it also fixes your issue?

(Do not get great expectations, though. As one of the last members of the hopefully soon extinguished 32bits tribe, you will get little maintainer love.)

@vicuna

This comment has been minimized.

Copy link
Collaborator Author

vicuna commented Mar 21, 2013

Comment author: @gasche

Chetsky in #5957 reported the same bug but has a patch proposal, which by the way demonstrates that my LongString suggestion was actually not correct. I'm closing this bug report here so that we don't disperse discussion effort on the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.