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

O'Caml 3.05 segfaults #3472

Closed
vicuna opened this issue Jul 29, 2002 · 2 comments
Closed

O'Caml 3.05 segfaults #3472

vicuna opened this issue Jul 29, 2002 · 2 comments
Labels

Comments

@vicuna
Copy link

vicuna commented Jul 29, 2002

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

Bug description

Hi,

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:

Pxp_document is in

Sorry for the bad news,

Gerd


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

@vicuna
Copy link
Author

vicuna commented Jul 30, 2002

Comment author: administrator

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);
    


@vicuna
Copy link
Author

vicuna commented Jul 30, 2002

Comment author: administrator

Fixed 2002-07-30 by DD & XL.

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