Leonidas changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 4.13.0 released: https://ocaml.org/releases/4.13.0.html | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
SoniEx2 has quit [Ping timeout: 245 seconds]
rgrinberg has joined #ocaml
bgs has quit [Remote host closed the connection]
Soni has joined #ocaml
troydm has quit [Ping timeout: 250 seconds]
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
oriba has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
mbuf has joined #ocaml
shebang has joined #ocaml
tizoc has quit [Quit: Coyote finally caught me]
tizoc has joined #ocaml
kaph has quit [Read error: Connection reset by peer]
kaph has joined #ocaml
waleee has quit [Ping timeout: 252 seconds]
bobo has joined #ocaml
spip has quit [Ping timeout: 260 seconds]
gravicappa has joined #ocaml
zebrag has quit [Quit: Konversation terminated!]
Haudegen has joined #ocaml
azimut has quit [Remote host closed the connection]
azimut has joined #ocaml
Everything has quit [Quit: leaving]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
troydm has joined #ocaml
andreypopp has joined #ocaml
andreypopp has quit [Ping timeout: 252 seconds]
Anarchos has joined #ocaml
andreypopp has joined #ocaml
andreypopp_ has joined #ocaml
andreypopp has quit [Ping timeout: 256 seconds]
szkl has joined #ocaml
dextaa_ has quit [Remote host closed the connection]
Anarchos has quit [Ping timeout: 245 seconds]
mro has quit [Remote host closed the connection]
dextaa_ has joined #ocaml
xgqt has quit [Ping timeout: 256 seconds]
xgqt has joined #ocaml
dextaa_ has quit [Remote host closed the connection]
olle has joined #ocaml
sparogy has quit [Ping timeout: 260 seconds]
sparogy has joined #ocaml
perrierjouet has quit [Quit: WeeChat 3.4.1]
perrierjouet has joined #ocaml
kakadu has joined #ocaml
perrierjouet has quit [Quit: WeeChat 3.4.1]
perrierjouet has joined #ocaml
bgs has joined #ocaml
perrierjouet has quit [Quit: WeeChat 3.4.1]
perrierjouet has joined #ocaml
perrierjouet has quit [Quit: WeeChat 3.4.1]
perrierjouet has joined #ocaml
mro has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
bartholin has joined #ocaml
mro has quit [Read error: Connection reset by peer]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Ping timeout: 256 seconds]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
emp has joined #ocaml
mro has joined #ocaml
<d_bot> <reynir> Seems the question was deleted on discord (but you can't delete messages on irc)
bartholin has quit [Ping timeout: 256 seconds]
gahr has quit [Quit: leaving]
gahr has joined #ocaml
bartholin has joined #ocaml
szkl has quit [Quit: Connection closed for inactivity]
gravicappa has quit [Ping timeout: 252 seconds]
troydm1 has joined #ocaml
troydm has quit [Ping timeout: 250 seconds]
gahr has quit [Quit: Reconnecting]
gahr has joined #ocaml
troydm1 has quit [Quit: What is Hope? That all of your wishes and all of your dreams come true? To turn back time because things were not supposed to happen like that (C) Rau Le Creuset]
troydm has joined #ocaml
mro has quit [Remote host closed the connection]
neilthereildeil has joined #ocaml
<neilthereildeil> hey all
<neilthereildeil> im looking at ocaml documentation for Unix.select and the linux man page for select, and they appear different
<neilthereildeil> Unix.select (https://ocaml.org/api/Unix.html) says "a negative fourth argument means no timeout (unbounded wait)"
<neilthereildeil> but man select says "If timeout is specified as NULL, select() blocks indefinitely waiting for a file descriptor to become ready."
<neilthereildeil> how can i use ocaml's Unix.select to wait indefinately?
<octachron> By giving it a negative value as specified in the documentation?
<d_bot> <orbitz> neilthereildeil: what is unclear?
<neilthereildeil> ocaml says to pass a negative number, but Unix.select says to pass null
<d_bot> <orbitz> You cannot pass null to `Unix.select`
<octachron> The C documentation for the C version od select says to send null to the C version of `select`.
<octachron> The behavior (and even the existence) of this C version of select is mostly irrelevant for using OCaml's Unix.select.
<neilthereildeil> ok, then ill pass a negative number
<neilthereildeil> also what does the "!left" in this line do?
<neilthereildeil> let r, _, _ = Unix.select [ fd ] [] [] (min max_blocking_time !left) in
<neilthereildeil> and what is that min?
<d_bot> <orbitz> `min` is a function, and you should look up the documentation on references
<neilthereildeil> min function on max_blocking_time and 0 (if left is nonzero)?
<d_bot> <orbitz> Nope
<octachron> `!` is the unary operator for reference access
<octachron> https://ocaml.org/manual/coreexamples.html#s%3Aimperative-features
SquidDev has quit [Quit: Ping timeout (120 seconds)]
SquidDev has joined #ocaml
gravicappa has joined #ocaml
mro has joined #ocaml
<neilthereildeil> oik, so it looks like !left is dereferencing the left variable
<neilthereildeil> so whats are the semantics of "min max_blocking_time !left"?
<neilthereildeil> is it finding the min of max_blocking_time and left?
mro has quit [Remote host closed the connection]
<d_bot> <NULL> It's basically OCaml for `min(max_blocking_time, *left)` in C
<d_bot> <NULL> left is a reference, not an ine
<d_bot> <NULL> int*
Techcable has quit [Remote host closed the connection]
kaph has quit [Ping timeout: 252 seconds]
Techcable has joined #ocaml
waleee has joined #ocaml
chrisz has quit [Ping timeout: 252 seconds]
mro has joined #ocaml
chrisz has joined #ocaml
neilthereildeil has quit [Ping timeout: 256 seconds]
mro has quit [Remote host closed the connection]
Anarchos has joined #ocaml
spip has joined #ocaml
bobo has quit [Read error: Connection reset by peer]
mro has joined #ocaml
zebrag has joined #ocaml
neilthereildeil has joined #ocaml
mro has quit [Quit: Leaving...]
vicfred has joined #ocaml
bartholin has quit [Quit: Leaving]
mbuf has quit [Quit: Leaving]
<neilthereildeil> is ther a way to attach to an existing ocaml program and dump the callstack?
<companion_cube> maybe ptrace? not sure
<qwr> i don't think that ptrace gives call stack - maybe gdb gives something
<companion_cube> ugh, yeah, sorry. I think gdb uses ptrace though :D
<neilthereildeil> isnt that only for syscalls?
<neilthereildeil> i need t oattach to an ocaml process to understand where it is executing during this error condition
<neilthereildeil> will ocamldebug help me?
olle has quit [Ping timeout: 250 seconds]
<octachron> Possibly, before that did you also run with "OCAMLRUNPARAM=b" to enable the backtrace?
<neilthereildeil> since this is a nondeterministically reproducable bug, is there any way to avoid perturbing any of the process timings or code or execution paths?
<neilthereildeil> i dont wanna introduce another variable where other parameters can change how the process executes
<neilthereildeil> i didnt run with that parameter
<neilthereildeil> i just wanna see the process exactly as it is in the current state
<neilthereildeil> and get the stacktrace
<sleepydog> are you on linux? do you get something useful from /proc/$pid/stack ?
<neilthereildeil> sleepydog: its empty
dextaa_ has joined #ocaml
<neilthereildeil> does ocaml have some kind of runtime that causes ends up in an unreadable callstack for native tools like the kernel's proc/pid/stack or gdb's bt?
<sleepydog> unsure. i know perf at least can understand the stack for native binaries
<neilthereildeil> ocamlc compiles to a native binary, right?
<octachron> No ocamlc is the bytecode compiler. The native compiler is ocamlopt
<neilthereildeil> but if its compiled to an ELF like in this case, i wouldnt see the stack structure corresponding to the ocaml code, would I?
<neilthereildeil> because theres a bytecode layer between the ocaml code and the machine code?
<octachron> There is no bytecode layer with ocamlopt.
<neilthereildeil> but i woldnt see ocaml functions in the proc/pid/stack or gdb callstacks, would I?
<sleepydog> it works for me; `gdb path/to/binary -p $(pgrep my-process.exe)` then running `bt` shows the ocaml functions
<neilthereildeil> did u build with -g?
<sleepydog> i built with dune, which I think includes -g by default
<neilthereildeil> also, i need help with ocaml code please
<neilthereildeil> i see a function that doesnt appear to be called anywhere
<neilthereildeil> is this function exported in a special way such that i wouldnt see it in the code?
<neilthereildeil> the only other reference i see of it is in an mli file
<sleepydog> neilthereildeil: i'm not familiar with this library, but that function is in the .mli file, so it's part of the library's public API. any codebase importing this library can call it.
<neilthereildeil> sleepydog: thanks so much
<neilthereildeil> so does this mean this ocaml code would be compiled to a linux .so or something and this function would be part of the exported functions in that .so?
<sleepydog> I don't think you usually work with .so files, though i think you might be able to generate them with the right tools. you might want to read https://ocaml.org/manual/native.html
neilthereildeil has quit [Quit: Client closed]
neilthereildeil has joined #ocaml
<neilthereildeil> sleepydog: if read_watchevent_timeout is exposed as a library, i should see this text where other programs call into this library, right?
Anarchos has quit [Ping timeout: 245 seconds]
<sleepydog> yes. although it could be assigned to a local variable or passed as an argument, too
<neilthereildeil> but it would have to be referenced by name, right? or can they reference by ordinal or something else?
<neilthereildeil> a grep -R didnt show any other text that matched it...
<sleepydog> it would have to be named, AFAIK. you cant get a function by address, AFAIK
oriba has joined #ocaml
cedric has joined #ocaml
dextaa_ has quit [Read error: Connection reset by peer]
kaph has joined #ocaml
dextaa_ has joined #ocaml
<octachron> neilthereildeil, since it is a public library, any client code can use the function. "grep -R" is not meaningful since you don't have all access to all OCaml that has been written or will ever be written
<neilthereildeil> no, im just looking for the library consumers in this repo
<neilthereildeil> this is the xen hypervisor source tree
<octachron> And why would it be in this repo?
<neilthereildeil> this oxenstored if a program written in ocaml that implements a part of the hypervisor's database to track VMs
<neilthereildeil> how can i dump disassembly from a compiles ocaml file?
<neilthereildeil> i think its a cmx file
<octachron> cmx files contain information for the OCaml compiler. You want to disassembly the object (.o) files.
gravicappa has quit [Ping timeout: 240 seconds]
neilthereildeil has quit [Quit: Client closed]
wyrd has quit [Ping timeout: 240 seconds]
oriba has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
rgrinberg has joined #ocaml
wyrd has joined #ocaml
<d_bot> <undu> this is a client for the xenstore library: https://github.com/xapi-project/ezxenstore
<d_bot> <undu> looking at github, I don't think there a re any users for that particular function
<d_bot> <undu> not anymore
Tuplanolla has joined #ocaml
bgs has quit [Remote host closed the connection]
bgs has joined #ocaml
hannes has joined #ocaml
<d_bot> <mseri> Isn’t it used in the xenstore watch?
<d_bot> <mseri> Or those are no longer used by xapi
<d_bot> <mseri> ?
<d_bot> <undu> The last commit there Is front 2014, it's archived
<d_bot> <mseri> 👍
<d_bot> <undu> *from
<d_bot> <mseri> Nice 😊
cedric has quit [Quit: Konversation terminated!]
Haudegen has quit [Ping timeout: 256 seconds]
quernd has quit [Quit: Ping timeout (120 seconds)]
quernd has joined #ocaml