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

cmi/cmo consistency checks in toplevel (again) #3289

Closed
vicuna opened this issue Apr 8, 2002 · 1 comment
Closed

cmi/cmo consistency checks in toplevel (again) #3289

vicuna opened this issue Apr 8, 2002 · 1 comment
Labels

Comments

@vicuna
Copy link

vicuna commented Apr 8, 2002

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

Bug description

Full_Name: Jacek Chrzaszcz
Version: 3.04
OS: Linux
Submission from: fw-gw-atm.mimuw.edu.pl (193.0.96.15)

Hello,

One of my first-year student found this bug during a "TP" session:

If you have your own qinterface file map.cmi in your current directory and then
start ocaml and (forgetting about #load "map.cmo") try to use your module, like

    Objective Caml version 3.04

let a=Map.empty_map in Map.update a 7 "a";;

  • you get a Segmentation fault

I would guess the toplevel finds the interface in the current directory and the
implementation in memory (stdlib) and ....they do not match...

I do not suppose Set or List modules would behave any better, but I include
map.mli below just in case.

Jacek Chrzaszcz

PS. I remember I found a similar bug a while ago. It is fixed/43
PS2. I hope you don't mind the comments in Polish below. The guy who wrote it is
a good student. He writes a lot of comments :)

---------cut----------
type ('a, 'b) map;;
(* mapa ma dwa typy abstrakcyjne:
'a - typ wspolrzednej
'b - typ przechowywanych danych *)

val empty_map: ('a, 'b) map;;
(* [empty_map] daje pusta mape *)

val dom: ('a, 'b) map -> 'a -> bool;;
(* [dom m x] odpowiada na pytanie "czy do mapy [m] byl wkladany element o
wspolrzednych [x] ?" *)

val apply: ('a, 'b) map -> 'a -> 'b;;
(* [apply m x] zwraca dane przechowywane w mapie [m] na wspolrzednych [x].
Jesli element o tych wspolrzednych nie istnieje, podnosi wyjatek
Not_found *)

val update: ('a, 'b) map -> 'a -> 'b -> ('a, 'b) map;;
(* [update m x d] wstawia do mapy [m] dane [d] w miejscu o wspolrzednych
[x]. Jesli w miejscu [x] jest juz przechowywany jakis element, to
zostanie
on zamieniony na [d]. Zwraca tak zmodyfikowana mape. *)

@vicuna
Copy link
Author

vicuna commented Nov 17, 2002

Comment author: administrator

Fixed 2002-11-17 by XL

@vicuna vicuna closed this as completed Nov 17, 2002
@vicuna vicuna added the bug label Mar 19, 2019
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