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

Invalid memory in C thread bindings #6838

Closed
vicuna opened this issue Apr 13, 2015 · 3 comments
Closed

Invalid memory in C thread bindings #6838

vicuna opened this issue Apr 13, 2015 · 3 comments
Assignees
Milestone

Comments

@vicuna
Copy link

vicuna commented Apr 13, 2015

Original bug ID: 6838
Reporter: @yakobowski
Assigned to: @damiendoligez
Status: closed (set by @damiendoligez on 2015-04-21T15:25:20Z)
Resolution: fixed
Priority: normal
Severity: crash
Version: 4.03.0+dev / +beta1
Target version: 4.03.0+dev / +beta1
Fixed in version: 4.03.0+dev / +beta1
Category: otherlibs
Monitored by: "Julien Signoles"

Bug description

Frama-C's testing infrastructure randomly segfaults after the following commit

commit 46f6fe6
Author: Damien Doligez <damien.doligez-inria.fr>
Date: Fri Feb 6 21:58:00 2015 +0000

fix bug where some unclosed channels could be discarded without flushing

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15817 f963ae5c-01c2-4b8c-9f

e0-0dff7051ff02

The segfault is random, but always occur before the end of our tests. This is a typical message.

*** Error in `./bin/ptests.opt': free(): invalid pointer: 0x0000000001964a00 ***

Here are some GDB backtrace I managed to get in the thread that sefgfaults.

#0 __lll_lock_wait ()
at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:135
#1 0x00007ffff7bd06b8 in _L_cond_lock_886 ()
from /lib/x86_64-linux-gnu/libpthread.so.0
#2 0x00007ffff7bd0424 in __pthread_mutex_cond_lock (mutex=0x7448f0)
at ../nptl/pthread_mutex_lock.c:79
#3 0x00007ffff7bcb11f in pthread_cond_wait@@GLIBC_2.3.2 ()
at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:259
#4 0x000000000047d370 in caml_condition_wait ()
#5 0x0000000000435bbc in camlPtests__dispatcher_2517 ()
#6 0x0000000000437bd4 in camlPtests__entry ()
#7 0x000000000042d229 in caml_program ()
#8 0x000000000049393e in caml_start_program ()
#9 0x0000000000000000 in ?? ()

#0 0x00007ffff7bce4c9 in __libc_waitpid (pid=31358, stat_loc=0x7ffff3d45d1c,
options=0) at ../sysdeps/unix/sysv/linux/waitpid.c:40
#1 0x0000000000482079 in unix_waitpid ()
#2 0x0000000000440037 in camlUnix__waitpid_non_intr_1840 () at unix.ml:858
#3 0x0000000000440080 in camlUnix__system_1842 () at unix.ml:868
#4 0x0000000000432789 in camlPtests__launch_2041 ()
#5 0x00000000004345ca in camlPtests__do_command_2423 ()
#6 0x0000000000434f5c in camlPtests__worker_thread_2467 ()
#7 0x000000000043c829 in camlThread__fun_1550 () at thread.ml:37
#8 0x000000000049393e in caml_start_program ()
#9 0x00000000007e5a00 in ?? ()
#10 0x0000000000000000 in ?? ()

Steps to reproduce

Compile Frama-C, then start ./bin/ptests.opt -j 10 in the source directory

@vicuna
Copy link
Author

vicuna commented Apr 14, 2015

Comment author: bobot

It can be easily reproduced with the current stable version (frama-c.20150201):

opam switch 4.03.0+trunk

opam install --build-test frama-c

@vicuna
Copy link
Author

vicuna commented Apr 20, 2015

Comment author: @damiendoligez

I made a very stupid mistake. I'll fix this very soon.

@vicuna
Copy link
Author

vicuna commented Apr 21, 2015

Comment author: @damiendoligez

Fixed in trunk (rev 16025).

@vicuna vicuna closed this as completed Apr 21, 2015
@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
Projects
None yet
Development

No branches or pull requests

2 participants