Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005920OCamlOCaml generalpublic2013-02-13 07:592013-08-30 23:18
Reporterfuruse 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionduplicate 
PlatformLinux 32bitOSOS Version
Product Version4.00.1 
Target VersionFixed in Version 
Summary0005920: ocamlc linking failed due to Invalid_argument of String.create when with -g
DescriptionHi, 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 0001615.
TagsNo tags attached.
Attached Files

- Relationships
related to 0005925resolvedgasche Stack overflow in compiler 
related to 0001615closed ocamlc 3.06 crashes with -g, ok without 
has duplicate 0005957resolvedgasche linking -big- files causes failure in ocamlc 

-  Notes
(0008963)
sebmondet (reporter)
2013-03-12 19:53

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")
(0008977)
gasche (developer)
2013-03-17 17:29

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.)
(0008996)
gasche (developer)
2013-03-21 22:06

Chetsky in PR#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.

- Issue History
Date Modified Username Field Change
2013-02-13 07:59 furuse New Issue
2013-03-12 19:53 sebmondet Note Added: 0008963
2013-03-17 17:26 gasche Relationship added related to 0005925
2013-03-17 17:29 gasche Note Added: 0008977
2013-03-17 17:30 gasche Status new => feedback
2013-03-17 17:44 gasche Severity major => minor
2013-03-21 22:04 gasche Relationship added has duplicate 0005957
2013-03-21 22:06 gasche Note Added: 0008996
2013-03-21 22:06 gasche Status feedback => closed
2013-03-21 22:06 gasche Resolution open => duplicate
2013-08-30 23:18 doligez Relationship added related to 0001615


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker