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

segmentation fault on Num.power_num #6164

Closed
vicuna opened this issue Sep 6, 2013 · 4 comments
Closed

segmentation fault on Num.power_num #6164

vicuna opened this issue Sep 6, 2013 · 4 comments
Assignees

Comments

@vicuna
Copy link

@vicuna vicuna commented Sep 6, 2013

Original bug ID: 6164
Reporter: kanig
Assigned to: @lefessan
Status: closed (set by @xavierleroy on 2015-07-24T08:38:59Z)
Resolution: fixed
Priority: normal
Severity: minor
Platform: x86_64
OS: linux
OS Version: Debian 3.2.35-2
Version: 4.01.0+beta/+rc
Fixed in version: 4.00.1
Category: otherlibs
Monitored by: @gasche

Bug description

The attached file produces a segfault both in bytecode and native format. Note that the platform is important: it happens on x86_64, and I have only seen it on linux.

I have reproduced this in 3.12.1, 4.00.1 and 4.01.0rc.

Steps to reproduce

ocamlbuild -lib nums numbug.ml
./numbug.native

Additional information

gdb locates the crash in "bng_amd64_mult_add_digit".

File attachments

@vicuna
Copy link
Author

@vicuna vicuna commented Sep 7, 2013

Comment author: @lefessan

Fixed in commit r14074.

There is a buffer overflow in Nat.make_power_base when base=0 or 1. This case can only be triggered in Nat.power_base_int, so I added a test there for base=0 or 1.

@vicuna
Copy link
Author

@vicuna vicuna commented Sep 9, 2013

Comment author: kanig

Thank you, that was quick! I have a couple of questions though ... :-)

Can you tell me if the fix will be in 4.01?

Is it possible to workaround this problem, e.g. by avoiding calls with certain arguments to Num.power_num?

Thanks in advance.

@vicuna
Copy link
Author

@vicuna vicuna commented Sep 11, 2013

Comment author: @damiendoligez

This fix will be in 4.01.0.

@vicuna
Copy link
Author

@vicuna vicuna commented Sep 11, 2013

Comment author: kanig

That's great, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants