Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001273OCamlOCaml generalpublic2002-07-29 23:442002-07-30 15:38
Reporteradministrator 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0001273: O'Caml 3.05 segfaults
DescriptionHi,

there seems to be a serious bug in O'Caml 3.05 that causes segfaults:

ocamlc -g -I /opt/ocaml-3.05/site-lib/netstring/ -c pxp_document.ml
Segmentation fault

ocamlopt on the same file segfaults, too, but ocamlc.opt and ocamlopt.opt
work. Pxp_document.ml is a quite big file with many class definitions,
and it takes about a minute to compile.

I played with the GC settings, and OCAMLRUNPARAM=s=1M worked (causing
a different usage pattern of memory allocation?).

The segfault is within mark_slice, but I suppose this does not say
anything.

My platform is Linux on IA32, but I got today a message reporting the
same bug for Solaris 7.

Unfortunately, pxp_document.ml requires a lot of prerequisites, and I
cannot extract it from its environment. If this is an option for you,
I can send my bytecode installation to you, so you would not need
to fight with installing the prerequisites. You would need:

- findlib: http://ocaml-programming.de/packages/findlib-0.7.2.tar.gz [^]
- PCRE: http://www.ai.univie.ac.at/~markus/ocaml_sources/pcre-ocaml-4.26.4.tar.gz [^]
- ocamlnet: http://ocaml-programming.de/packages/ocamlnet-0.93.tar.gz [^]

Pxp_document is in

- PXP: http://www.ocaml-programming.de/packages/pxp-1.1.90.tar.gz [^]

Sorry for the bad news,

Gerd
--
----------------------------------------------------------------------------
Gerd Stolpmann Telefon: +49 6151 997705 (privat)
Viktoriastr. 45
64293 Darmstadt EMail: gerd@gerd-stolpmann.de
Germany
----------------------------------------------------------------------------

TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0000995)
administrator (administrator)
2002-07-30 15:36

Dear Gerd,

Thanks for the prompt bug report. I had no difficulties reproducing
it, and Damien Doligez and I managed to track the bug down to a GC
``optimization'' (ahem) for lazy blocks. The bug is fixed in the CVS
sources; alternatively, you can apply the attached patch to the 3.05
distribution.

All the best,

- Xavier Leroy

----------------
Index: byterun/major_gc.c
===================================================================
RCS file: /net/pauillac/caml/repository/csl/byterun/major_gc.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- major_gc.c 2002/06/05 12:11:15 1.37
+++ major_gc.c 2002/07/30 13:02:31 1.38
@@ -11,7 +11,7 @@
 /* */
 /***********************************************************************/
 
-/* $Id: major_gc.c,v 1.37 2002/06/05 12:11:15 doligez Exp $ */
+/* $Id: major_gc.c,v 1.38 2002/07/30 13:02:31 xleroy Exp $ */
 
 #include <limits.h>
 
@@ -126,15 +126,12 @@
       if (Tag_hd (hd) < No_scan_tag){
         for (i = 0; i < size; i++){
           child = Field (v, i);
- mark_again:
           if (Is_block (child) && Is_in_heap (child)) {
             hd = Hd_val(child);
             if (Tag_hd (hd) == Forward_tag){
- child = Forward_val (child);
- Field (v, i) = child;
- goto mark_again;
+ Field (v, i) = Forward_val (child);
             }
- if (Tag_hd(hd) == Infix_tag) {
+ else if (Tag_hd(hd) == Infix_tag) {
               child -= Infix_offset_val(child);
               hd = Hd_val(child);
             }
@@ -192,15 +189,13 @@
           sz = Wosize_hd (hd);
           for (i = 1; i < sz; i++){
             curfield = Field (cur, i);
- weak_again:
- if (curfield != 0 && Is_block (curfield) && Is_in_heap (curfield)
- && Is_white_val (curfield)){
+ if (curfield != 0 && Is_block (curfield) && Is_in_heap (curfield)){
               if (Tag_val (curfield) == Forward_tag){
- curfield = Forward_val (curfield);
- Field (cur, i) = curfield;
- goto weak_again;
+ Field (cur, i) = Forward_val (curfield);
               }
- Field (cur, i) = 0;
+ else if (Is_white_val (curfield){
+ Field (cur, i) = 0;
+ }
             }
           }
           weak_prev = &Field (cur, 0);

----------------
----------------
(0000996)
administrator (administrator)
2002-07-30 15:38

Fixed 2002-07-30 by DD & XL.

- Issue History
Date Modified Username Field Change
2005-11-18 10:13 administrator New Issue


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker