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

ocamlopt minor GC on i386 Darwin crashes with "illegal instruction" on big arrays #4114

Closed
vicuna opened this issue Sep 13, 2006 · 3 comments
Labels

Comments

@vicuna
Copy link

vicuna commented Sep 13, 2006

Original bug ID: 4114
Reporter: weimer
Status: closed (set by @xavierleroy on 2006-09-20T17:41:03Z)
Resolution: fixed
Priority: normal
Severity: crash
Version: 3.09.2
Category: ~DO NOT USE (was: OCaml general)
Related to: #4036

Bug description

The i386/OS X native code gc chokes on large arrays that are handled fine on win32 or linux.

The example code below compiles fine with ocamlopt.opt under i386 OS X (3.09.2 compiled from the source tarball today). It also compiles fine on i386/win32 (for example, the mingw 3.09.0 binaries) and i386/linux (fedora core, whatever).

It runs correctly on i386/win32 and i386/linux but it crashes with "illegal instruction" on i386/osx. GDB:

Starting program: /Users/weimer/src/a.out
Reading symbols for shared libraries . done
*** You'll see this message, but no others.

Program received signal EXC_BAD_INSTRUCTION, Illegal instruction/operand.
0x0000da26 in caml_empty_minor_heap ()
(gdb) bt
#0 0x0000da26 in caml_empty_minor_heap ()
#1 0x0000dac0 in caml_minor_collection ()
#2 0x0000c302 in caml_garbage_collection ()
#3 0x000198fc in caml_call_gc ()
#4 0x0000b647 in main ()
(gdb) quit

The problem is not with my ocaml setup in general -- other programs work fine, and even the first printf in this program works fine.

Yes, it's a big array. This particular one was generated by a GLR parser generator.

To reproduce:

$ ocamlopt.opt small-example.ml
$ ./a.out

Sadly, this "small example" can't actually be made much smaller (the big arrays seem to be the problem) but I have removed all of the unnecessary code -- it's just a data structure definition sandwiched between two printfs. I have searched for similar bug reports but did not find anything; my apologies if this is a duplicate.

File attachments

@vicuna
Copy link
Author

vicuna commented Sep 17, 2006

Comment author: jcompton

WFM in 3.09.3, so this might have been addressed. (Hi Wes!)

@vicuna
Copy link
Author

vicuna commented Sep 17, 2006

Comment author: weimer

This bug report is apparently a duplicate of 4036:

#4036

... and the problem is fixed in 3.09.3.

@vicuna
Copy link
Author

vicuna commented Sep 20, 2006

Comment author: @xavierleroy

Looks like the stack alignment problem that was fixed in 3.09.3.

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