Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007603OCamlplatform support (windows, cross-compilation, etc)public2017-08-08 19:352017-08-09 17:54
Assigned Tofrisch 
PlatformWindows CygwinOSOS Version
Product Version4.04.2 
Target VersionFixed in Version 
Summary0007603: segfault on windows in dynlink'd module's entry routine
DescriptionI have an OCAML program that I am trying to port to Windows (using the cygwin version of OCAML), and when it executes, it segfaults. I haven't been able to completely track down the cause of the error, but below is the stack trace in gdb, and I have been able to determine that adjusting the inlining settings seems to be capable of suppressing the bug, so I suspect that the issue is in the middle-end somewhere. I tried reducing the program further but it seems like the bug seems to only arise when the program reaches a certain point of complexity, so unfortunately the steps to reproduce the issue are a little involved.

#0 0x62c7e1c8 in camlRealdef__entry () from /home/dwightguth/rv-match/c-semantics/semantics/x86-gcc-limited-libc/cpp14-translation-kompiled/cpp14-translation-kompiled/program/realdef.cmxs
#1 0x0051d8e9 in caml_start_program ()
#2 0x00519617 in caml_callback ()
0000003 0x0051d520 in caml_natdynlink_run ()
0000004 0x0049ad25 in camlDynlink__fun_3854 () at dynlink.mlopt:176
0000005 0x004a3739 in camlList__iter_1258 () at
0000006 0x0049b285 in camlDynlink__loadunits_3569 () at dynlink.mlopt:179
0000007 0x0049b315 in camlDynlink__load_3582 () at dynlink.mlopt:185
0000008 0x00404f19 in camlPlugin__load_2861 ()
0000009 0x00404e5b in camlInterpreter__entry ()
0000010 0x00401fd0 in caml_startup.code_begin ()
0000011 0x0051d8e9 in caml_start_program ()
0000012 0x00506ef5 in caml_main ()
0000013 0x0051e599 in main ()
Steps To Reproduce1. install ocaml on Cygwin with ocamlfind and zarith and mlgmp packages


$ tar xvf program.tar.gz
$ cd program
$ make
$ ./interpreter.exe ./realdef.cma

This should complete successfully, but instead it triggers a segmentation fault.
TagsNo tags attached.
Attached Filesgz file icon program.tar.gz [^] (586,762 bytes) 2017-08-08 19:35

- Relationships

-  Notes
dra (developer)
2017-08-08 19:50
edited on: 2017-08-08 19:51

Which version of Cygwin are you using? (
cygcheck -dc cygwin

dwight.guth (reporter)
2017-08-08 19:54

Cygwin Package Information
Package Version
cygwin 2.8.2-1
dra (developer)
2017-08-09 12:22

I'm able to reproduce this. The program doesn't segfault if everything is compiled with -g and bytecode appears to work (regardless of -g)
dwight.guth (reporter)
2017-08-09 17:54

for what it's worth, I think the fact that it doesn't reproduce with -g might be a red herring. I made the file a bit larger by uncommenting some of the code I commented out (lines 23656-24377 of, and I was able to reproduce it both with and without -g. It seems to have some relation to the size of the code generated...

- Issue History
Date Modified Username Field Change
2017-08-08 19:35 dwight.guth New Issue
2017-08-08 19:35 dwight.guth File Added: program.tar.gz
2017-08-08 19:50 dra Note Added: 0018165
2017-08-08 19:51 dra Note Edited: 0018165 View Revisions
2017-08-08 19:54 dwight.guth Note Added: 0018166
2017-08-09 12:22 dra Note Added: 0018168
2017-08-09 12:22 dra Assigned To => frisch
2017-08-09 12:22 dra Status new => confirmed
2017-08-09 17:54 dwight.guth Note Added: 0018169

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker