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

Buffer.contents causes Segmentation fault #7003

vicuna opened this issue Sep 30, 2015 · 2 comments


None yet
2 participants
Copy link

commented Sep 30, 2015

Original bug ID: 7003
Reporter: radekm
Assigned to: @damiendoligez
Status: closed (set by @damiendoligez on 2015-10-19T15:48:39Z)
Resolution: fixed
Priority: normal
Severity: major
Platform: 64-bit
OS: openSUSE
OS Version: 13.1
Version: 4.02.3
Target version: 4.03.0+dev / +beta1
Fixed in version: 4.03.0+dev / +beta1
Category: standard library
Monitored by: @gasche

Bug description

Following program

let _ =
let b = Buffer.create 7000_000_000 in
for i = 1 to 2500_000_000 do
Buffer.add_string b "a"
print_endline "before";
let _ = Buffer.contents b in
print_endline "after"


Segmentation fault

on my machine (I have 13.5 GB of free memory, 16 GB total, 18 GB total with swap).

Steps to reproduce

Constants 7000_000_000 and 2500_000_000 depend on the size of memory and they must be sufficiently large otherwise the program doesn't crash.


This comment has been minimized.

Copy link

commented Oct 19, 2015

Comment author: @damiendoligez

Reproduced on Mac OS X.


This comment has been minimized.

Copy link

commented Oct 19, 2015

Comment author: @damiendoligez

Fixed in rev 16525.

@vicuna vicuna closed this Oct 19, 2015

@vicuna vicuna added the stdlib label Mar 14, 2019

@vicuna vicuna added this to the 4.03.0 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
You can’t perform that action at this time.