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

compilation fails with Env.Error(_) #6565

Closed
vicuna opened this issue Sep 17, 2014 · 11 comments
Closed

compilation fails with Env.Error(_) #6565

vicuna opened this issue Sep 17, 2014 · 11 comments
Assignees
Milestone

Comments

@vicuna
Copy link

vicuna commented Sep 17, 2014

Original bug ID: 6565
Reporter: @mshinwell
Assigned to: @garrigue
Status: closed (set by @xavierleroy on 2017-02-16T14:16:37Z)
Resolution: fixed
Priority: normal
Severity: major
Version: 4.02.1+dev
Target version: 4.02.1+dev
Fixed in version: 4.02.1+dev
Category: typing

Bug description

I am sorry, here is another one. (Jacques, I'm not sure if this is in your neck of the woods or not.)

The compiler fails with "Env.Error(_)" and as far as I could tell in gdb, the actual exception was [Inconsistent_import] (env.ml:58) where both the module name and one of the other remaining two arguments to the exception constructor were the unit name of the source file. I presume what was happening is that the compiler was trying to report an error and failed. I'm not sure we know what the actual error was at this stage.

Any ideas?

#0 camlCamlinternalLazy__force_lazy_block_1010 () at camlinternalLazy.ml:32
#1 0x0000000000534270 in camlPrinttyp__best_type_path_1562 ()
#2 0x0000000000534c8c in camlPrinttyp__mark_loops_rec_1617 ()
#3 0x00000000005361b1 in camlPrinttyp__tree_of_type_decl_1803 ()
#4 0x0000000000536591 in camlPrinttyp__tree_of_type_declaration_1868 ()
#5 0x00000000005365e7 in camlPrinttyp__type_declaration_1872 ()
#6 0x0000000000619fe7 in camlFormat__output_acc_1497 () at format.ml:1109
#7 0x000000000061a2ac in camlFormat__output_acc_1497 () at format.ml:1119
#8 0x0000000000619fe7 in camlFormat__output_acc_1497 () at format.ml:1109
#9 0x000000000061a1cf in camlFormat__output_acc_1497 () at format.ml:1122
#10 0x0000000000619fe7 in camlFormat__output_acc_1497 () at format.ml:1109
#11 0x000000000061a1cf in camlFormat__output_acc_1497 () at format.ml:1122
#12 0x000000000061a1cf in camlFormat__output_acc_1497 () at format.ml:1122
#13 0x0000000000619fe7 in camlFormat__output_acc_1497 () at format.ml:1109
#14 0x0000000000617010 in camlFormat__fun_2365 () at format.ml:1169
#15 0x000000000054daa8 in camlIncludemod__include_err_1451 ()
#16 0x0000000000619fe7 in camlFormat__output_acc_1497 () at format.ml:1109
#17 0x0000000000617010 in camlFormat__fun_2365 () at format.ml:1169
#18 0x00000000004a28d4 in camlMisc__try_finally_1011 ()
#19 0x0000000000619fe7 in camlFormat__output_acc_1497 () at format.ml:1109
#20 0x0000000000617010 in camlFormat__fun_2365 () at format.ml:1169
#21 0x00000000004aaa8c in camlLocation__error_of_printer_1172 ()
#22 0x000000000054e559 in camlIncludemod__fun_1981 ()
#23 0x00000000004a94e2 in camlLocation__loop_1153 ()
#24 0x00000000004aac65 in camlLocation__report_exception_1184 ()
#25 0x000000000044a67e in camlOptmain__main_1437 ()
#26 0x000000000044bbef in camlOptmain__entry ()
#27 0x0000000000446249 in caml_program ()
#28 0x0000000000634246 in caml_start_program ()
#29 0x0000000000635b35 in __libc_csu_init ()
#30 0x00000037cf81ed1d in __libc_start_main (main=0x623a24

, argc=47, ubp_av=0x7fffffffd2b8,
init=, fini=, rtld_fini=,
stack_end=0x7fffffffd2a8) at libc-start.c:226
#31 0x0000000000445929 in _start ()

@vicuna
Copy link
Author

vicuna commented Sep 17, 2014

Comment author: @mshinwell

I forgot to say: there's probably some build system dependency error involved here, but the compiler still shouldn't bomb out like this :)

@vicuna
Copy link
Author

vicuna commented Sep 17, 2014

Comment author: @garrigue

I'm not sure exactly what is happening.
Are you using -short-paths ?
If yes, try without it.
I have included a patch that hopefully ensures that you get at least some report (i.e., report nested errors).

@vicuna
Copy link
Author

vicuna commented Sep 17, 2014

Comment author: @garrigue

Applied patch in 4.02 at revision 15244.

@vicuna
Copy link
Author

vicuna commented Sep 17, 2014

Comment author: @mshinwell

Thanks (sorry, we were going to try without -short-paths, but haven't had time yet). We are using -short-paths.

@vicuna
Copy link
Author

vicuna commented Sep 18, 2014

Comment author: @mshinwell

For the record, removing -short-paths was a workaround to this bug.

@vicuna
Copy link
Author

vicuna commented Sep 29, 2014

Comment author: @mshinwell

This isn't completely fixed. Today I have a compilation that fails with the same error; the backtrace is:

Breakpoint 3, 0x000000000063449c in caml_reraise_exn ()
#0 0x000000000063449c in caml_reraise_exn ()
#1 0x00000000005fca18 in camlCamlinternalLazy__force_lazy_block_1010 () at camlinternalLazy.ml:32
#2 0x00007fffffffcf00 in ?? ()
#3 0x00000000005342d0 in camlPrinttyp__best_type_path_1562 ()
#4 0x0000000000539b83 in camlPrinttyp__type_same_name_2273 ()
#5 0x0000000000539bf3 in camlPrinttyp__trace_same_names_2278 ()
#6 0x0000000000539c51 in camlPrinttyp__unification_error_2284 ()
#7 0x00000000004a2924 in camlMisc__try_finally_1011 ()
#8 0x00000000004a2924 in camlMisc__try_finally_1011 ()
#9 0x00000000004aaadc in camlLocation__error_of_printer_1172 ()
#10 0x000000000058039f in camlTypecore__fun_7579 ()
#11 0x00000000004a9532 in camlLocation__loop_1153 ()
#12 0x00000000004aacba in camlLocation__report_exception_rec_1184 ()
#13 0x000000000044a6d5 in camlOptmain__main_1437 ()
#14 0x000000000044bc3f in camlOptmain__entry ()
#15 0x0000000000446299 in caml_program ()
#16 0x0000000000634426 in caml_start_program ()
#17 0x0000000000635d15 in __libc_csu_init ()
#18 0x0000003bdf81ed1d in __libc_start_main (main=0x623c04

, argc=62, ubp_av=0x7fffffffd3c8, init=, fini=,
rtld_fini=, stack_end=0x7fffffffd3b8) at libc-start.c:226
#19 0x0000000000445979 in _start ()

I confirmed that removing -short-paths makes the error go away. The type error it was trying to report was of the form:

Error: This pattern matches values of type X.t = X.T.t
but a pattern was expected which matches values of type
Y.t

@vicuna
Copy link
Author

vicuna commented Sep 29, 2014

Comment author: @mshinwell

(For avoidance of doubt: the previous patch for this issue did fix the problem on our first example. This is a different example.)

@vicuna
Copy link
Author

vicuna commented Sep 29, 2014

Comment author: @garrigue

I'm not sure I understand the error handling code in location.ml (Alain could help here).

My first fix did not wrap the call to error_of_exn, so I've tried putting inside the try ... with too.
Could you check that revision 15364 solves your problem, and also the previous one?

@vicuna
Copy link
Author

vicuna commented Oct 13, 2014

Comment author: @gasche

What is the status of this, should this bug be reopened?

@vicuna
Copy link
Author

vicuna commented Nov 23, 2015

Comment author: @xavierleroy

In the absence of new information, I'm marking this PR as resolved.

@vicuna
Copy link
Author

vicuna commented Nov 23, 2015

Comment author: @mshinwell

I'm pretty sure this one has been fixed.

@vicuna vicuna closed this as completed Feb 16, 2017
@vicuna vicuna added the typing label Mar 14, 2019
@vicuna vicuna added this to the 4.02.1 milestone Mar 14, 2019
@vicuna vicuna added the bug label Mar 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants