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
SEGV when using Gc.finalise #2893
Comments
Comment author: administrator
Thanks for finding this bug. It is now fixed in the release308 branch. -- Damien |
Comment author: administrator On Sat, 3 Jul 2004, Damien Doligez wrote:
-mike open Printf type elt = { let uniq = ref 0;; module H = module Cache = Weak.Make (H) let keeparound = Hashtbl.create 127;; let cache = Cache.create 2047;; let mk num = let alarm () = Hashtbl.clear keeparound let rec final elt = let _ =
|
Comment author: administrator fixed for 3.08+alpha --DD 2004-07-03 |
Original bug ID: 2893
Reporter: administrator
Status: closed (set by @damiendoligez on 2007-12-06T14:34:06Z)
Resolution: fixed
Priority: normal
Severity: minor
Fixed in version: 3.08.0
Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name: Mike Furr
Version: 3.07 & cvs-3.08
OS: OS X & linux
Submission from: pcp01781388pcs.howard01.md.comcast.net (68.32.48.24)
The program below segfaults on my mac and my linux box when compiled with
either the native code or byte code compilers. I have observed this behavior in
both 3.07 and the branch tagged release308 in CVS(7/2/04). This particular
version of the program segv's on 3.08, but not 3.07, but I can supply a larger
version which kills 3.07 if it would help(I tried to create the smallest test
case
to trigger it).
I'm running Debian/unstable on my i386 linux box and OS X 10.2 on my mac.
Note, while trying to slim down the program to submit, I got different
backtraces from gdb along the way...so it seems that the stack is being smashed
somewhere and thus I don't know how useful a bt would be, but here is one
just in case:
furrm@Kamino:~/devel/cache$ gdb ./test
[...]
This GDB was configured as "powerpc-apple-macos10".
Reading symbols for shared libraries .. done
(gdb) run
Starting program: /Users/furrm/devel/cache/test
[Switching to process 19826 thread 0xb03]
Reading symbols for shared libraries .. done
Program received signal EXC_BAD_ACCESS, Could not access memory.
0x00022608 in caml_fl_allocate ()
(gdb) bt
#0 0x00022608 in caml_fl_allocate ()
#1 0x00015f70 in caml_alloc_shr ()
#2 0x0001f150 in caml_weak_create ()
#3 0x00013234 in caml_c_call ()
Cannot access memory at address 0x181
Here is the program:
module H =
struct
type t = string
let equal t1 t2 = (String.compare t1 t2 = 0)
let hash = Hashtbl.hash
end
module Cache = Weak.Make (H)
let final elt = ()
let cache = Cache.create 2047;;
let _ =
for i = 0 to 100000 do
let v = String.create ((i mod 10)+1) in
Gc.finalise final v;
Cache.add cache v
done
Let me know if I can provide any other information.
The text was updated successfully, but these errors were encountered: