Skip to content
This repository has been archived by the owner on Jun 21, 2024. It is now read-only.

lablgtk's example segfaults #609

Open
kit-ty-kate opened this issue Jul 2, 2021 · 5 comments
Open

lablgtk's example segfaults #609

kit-ty-kate opened this issue Jul 2, 2021 · 5 comments
Labels
ecosystem/broken bugs witnessed running software compiled with Multicore OCaml

Comments

@kit-ty-kate
Copy link
Contributor

kit-ty-kate commented Jul 2, 2021

Using the following patch to make lablgtk compile: garrigue/lablgtk#129
Trying to run examples/about.exe results in the following gdb backtrace:

$ dune build --only-packages lablgtk3 examples/about.exe
$ gdb ./_build/default/examples/about.exe
[...]
Program received signal SIGSEGV, Segmentation fault.
caml_darken (v=0, ignored=<optimized out>, state=<optimized out>) at major_gc.c:729
729	major_gc.c: No such file or directory.
(gdb) bt
#0  caml_darken (v=0, ignored=<optimized out>, state=<optimized out>) at major_gc.c:729
#1  0x0000555555728df3 in scan_native_globals (fdata=0x0, f=0x555555711ac0 <caml_darken>) at globroots.c:214
#2  caml_scan_global_roots (f=f@entry=0x555555711ac0 <caml_darken>, fdata=fdata@entry=0x0) at globroots.c:238
#3  0x0000555555712418 in cycle_all_domains_callback (domain=0x7ffff5a00000, unused=unused@entry=0x0, participating_count=participating_count@entry=1, participating=participating@entry=0x55555581e1e0 <stw_request+4160>) at major_gc.c:1055
#4  0x0000555555731112 in caml_try_run_on_all_domains_with_spin_work (handler=handler@entry=
    0x555555712350 <cycle_all_domains_callback>, data=data@entry=0x0, leader_setup=leader_setup@entry=0x0, enter_spin_callback=enter_spin_callback@entry=0x0, enter_spin_data=enter_spin_data@entry=0x0) at domain.c:873
#5  0x0000555555731330 in caml_try_run_on_all_domains_with_spin_work (enter_spin_data=0x0, enter_spin_callback=0x0, leader_setup=0x0, data=0x0, handler=0x555555712350 <cycle_all_domains_callback>) at domain.c:888
#6  0x0000555555713057 in major_collection_slice (howmuch=<optimized out>, participant_count=participant_count@entry=0, barrier_participants=barrier_participants@entry=0x0, mode=mode@entry=Slice_interruptible) at major_gc.c:1330
#7  0x00005555557131c8 in caml_major_collection_slice (howmuch=howmuch@entry=-1) at major_gc.c:1349
#8  0x000055555572f5f5 in caml_poll_gc_work () at domain.c:937
#9  0x0000555555710925 in caml_garbage_collection () at signals_nat.c:110
#10 0x0000555555732543 in caml_call_gc ()
@abbysmal abbysmal added the ecosystem/broken bugs witnessed running software compiled with Multicore OCaml label Jul 2, 2021
@talex5
Copy link

talex5 commented Jul 14, 2021

How do you compile this? I get:

In file included from ml_gpointer.c:31:
ml_gpointer.c: In function ‘ml_stable_copy’:
wrappers.h:38:33: error: ‘caml_young_end’ undeclared (first use in this function)
   38 |   (Is_block(v) && (value*)(v) < caml_young_end && (value*)(v) > caml_young_start)
      |                                 ^~~~~~~~~~~~~~

It looks like caml_young_end was removed in merge a141bc6 (GitHub's UI doesn't show it, but gitk does).

@abbysmal
Copy link
Collaborator

abbysmal commented Jul 14, 2021 via email

@kit-ty-kate
Copy link
Contributor Author

Sorry indeed i was using +domains + #600, i forgot to mention

@talex5
Copy link

talex5 commented Jul 28, 2021

I guess this bit won't work too well with multicore, right?

(* naked pointers *)
type optstring

let raw_null = snd (Obj.magic Nativeint.zero)

let optstring : string option -> optstring =
  function
      None -> raw_null
    | Some x -> Obj.magic x

https://github.com/garrigue/lablgtk/blob/lablgtk3/src/gpointer.ml#L35

@kit-ty-kate
Copy link
Contributor Author

This is most likely one of culprit, yes ^^"

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
ecosystem/broken bugs witnessed running software compiled with Multicore OCaml
Projects
None yet
Development

No branches or pull requests

3 participants