drunK has quit [Remote host closed the connection]
hcube has quit [Ping timeout: 265 seconds]
zubeen has quit [Remote host closed the connection]
ftrvxmtrx has quit [Quit: Leaving]
deech has joined #ocaml
wuj has joined #ocaml
wuj has quit [Ping timeout: 245 seconds]
deech has quit [Ping timeout: 276 seconds]
__marius__ has quit [Quit: leaving]
joewilliams is now known as joewilliams_away
__marius__ has joined #ocaml
hcube has joined #ocaml
<__marius__>
ls
<rwmjones>
anyone using glade with lablgtk2? or want to suggest what tool I should be using with lablgtk2? (I think glade has been obsoleted)
<adrien>
hi __marius__
<adrien>
rwmjones: I'm not, I've tried it but in the end, you still have to install all the callbacks by hand and I find it harder to do when the code has been generated and isn't mine
<rwmjones>
ok
<adrien>
might be nice to sketch the interface in a stricter way than a paper and a pen however
<rwmjones>
yeah I might use it for prototyping
* rwmjones
hates doing gui interfaces ...
<adrien>
I'm starting to like it :-)
<adrien>
but I'm playing with react and several other things and _that_ is the fun part ;-)
<rwmjones>
anyhow, glade is not obsolete, it seems
<rwmjones>
nice, glade just segfaulted
<rwmjones>
in the first ~ 1 minute of use
<adrien>
heh
<adrien>
I'm under the impression libglade is obsolete (functionnality seems to have been merged in gtk as GtkBuilder) but the glade tool itself isn't
Yoric has joined #ocaml
DimitryKakadu has joined #ocaml
lpereira has joined #ocaml
init1 has joined #ocaml
<hcube>
hi! I'm trying to make an iphone app in ocaml. I've compiled every required lib to arm and i run a hello world fine on iphone compiled with ocamlopt.
<hcube>
but for a complex example (json parser: yojson-0.8.1) it does not worked. the program ended with an exception. it could not parse ints
<hcube>
after litle debug investigation i've found that max_int's value is -1
<hcube>
when i print it with Printf.printf "maxint %u\n" max_int it prints 2147483647
<hcube>
are int values only 30 bit wide in arm architectures?
<flux>
yes
<flux>
well, no actually
<flux>
31 bits
<flux>
on any 32-bit architecture
<flux>
but they are signed
<hcube>
ok, and is max_int a signed type?
<flux>
it's an integere, therefore it's signed :)
<hcube>
so max_int value should be 2 ^ 30
<hcube>
where is max_int defined? there are multiple definitions in stdlib: int32.ml int64.ml nativeint.ml pervasives.ml
<flux>
pervasives.ml
<flux>
Pervasives is the module that is automatically opened for all compliation units
<hcube>
let min_int = 1 lsl (if 1 lsl 31 = 0 then 30 else 62)
<hcube>
let max_int = min_int - 1
<hcube>
that's the definition in pervasives (then pervasives is same to Prelude in haskell)
BiDOrD has quit [Quit: BiDOrD]
BiDOrD has joined #ocaml
<hcube>
what do you think what's went wrong?
Tobu has quit [Quit: Leaving.]
rks has joined #ocaml
<mfp>
hcube: arch detection not working, and OCaml believing it's a 64-bit platform?
EliasAmaral has joined #ocaml
EliasAmaral has quit [Client Quit]
dark has joined #ocaml
<dark>
I have a long running program with a memory leak. I use some third-party libraries. I was suspecting of ocaml-imagemagick (it has some notes that warn against leaks) but, removing it from the program, the leak persists. How one could know _where_ in the code is the leak?
<kerneis>
dark: with a C program I would use valgrind, but I don't know if it will give you anything useful (because of the GC)
<dark>
i am suspecting that the leak is in some C code
<kerneis>
dark: note that you do not want to use cachegrind, but the default valgrind mode instead
<kerneis>
(to find memory leaks)
<adrien>
you are using other C libraries?
ikaros has joined #ocaml
<mfp>
hcube: is min_int 0?
<mfp>
hcube: what do you mean by "right output"? I noted that only one of them has got -m32
<mfp>
if you're getting the error because you're using the one without -m32, you set the CC compiler manually by giving the -cc option to configure (see INSTALL)
<mfp>
you can try with ./configure -cc="/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-gcc-4.2 -arch armv6 -arch armv7 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.1.sdk"
<mfp>
uh, is it normal to have -arch armv6 -arch armv7 ?
<hcube>
yes, it will produce an universal binary
<hcube>
armv6 is for iphone3G and armv7 for iphone3GS and iphone4 both armv and armv7 are 32 bit architectures
<hcube>
here is the result of this expression: Printf.printf "min_int %d %u max_int %d %u\n" min_int min_int max_int max_int;
<hcube>
the CC because compiled with the original command found in the tutorial it does not linked with my xcode iphone project
<mfp>
not having access to any of this, I can't really help you any further, but it seems you're quite close. There's definitely some 32/64-bit issue with the compiler/assembler.
<hcube>
ok, thank you anyway ;)
<dark>
adrien, me? not sure, but I'm using PG'OCaml, ExtUnix, Batteries, ocaml-magic (for finding the mime type of a file), ..
<dark>
two structure I keep the entire program is a ocaml-magic cookie (I think it is a file descr of the database) and a PG'OCaml db handler
<dark>
structures
<adrien>
sound like small objects
<dark>
they should have constant size
<adrien>
what's the rate of the leak?
<dark>
after a day, I had 1.5gb
<dark>
I was looking at top, in some minutes it had 3% of ram.. 3.1, 3.2.. I thought it was growing because the GC was delaying something
<adrien>
and the best way to start is probably to try to create a reproducer (and valgrind can be a good tool to find out where to look at too :-) )
<dark>
reproducer?
<adrien>
there's one thing with C bindings: finalizers are only called ater a compaction I think (or a major?) but for your objects it shouldn't be a problem
<adrien>
dark: reduced test-case
<mfp>
dark: you could maybe patch the GC to collect stats (block kinds and sizes), those could help you find the culprit
<dark>
can't Gc module of stdlib do this?
<mfp>
not the stats that would help you
<dark>
block kind? I thought type information was lost on runtime
<mfp>
the type info is erased, but some info is needed by the GC: there are different kinds of blocks: strings, tuples/non-constant constructors, floats, custom blocks...
<mfp>
see byterun/mlvalues.h
<mfp>
you could also inspect the identifier in the custom_operations struct associated to custom blocks
<adrien>
wasn't there an update of the memprof patch or 3.10 at least?
<SurfMaths>
Huh, and « let min_int = 1 lsl (if 1 lsl 31 = 0 then 30 else 62) » return 0 ?!
<hcube>
yes
<SurfMaths>
What is the value of « 1 lsl 31 » ?
<SurfMaths>
This is very strange…
<hcube>
1 lsl 31: 0 0
<hcube>
maybe i sould check the equality operator
<SurfMaths>
Yep.
<SurfMaths>
if 1 lsl 31 = 0 then print_endline "Ok" else print_endline "WTF?!"
<SurfMaths>
Do you compile with « ocamlopt » on the same architecture than the one you run the program ?
pikachuyann has joined #ocaml
<hcube>
WTF?!
<SurfMaths>
If you compile on a 64 bit architecture, ocamlopt optimize by calculating the value of 1 lsl 31, see that it's different of 0, and say to print 1 lsl 62.
<SurfMaths>
Which is equal to 0 on 32 bits architectures.
<adrien>
I saw something about different hardware, maybe try without a universal binary at first
<adrien>
other things seem to mention plain old bugs, maybe because of api changes in the sdk
Modius has joined #ocaml
<hcube>
this is the gdb message what i get after ocaml thread crash, other threads are still running:Program received signal: “EXC_BAD_INSTRUCTION”.
<hcube>
Previous frame inner to this frame (gdb could not unwind past this frame)
<hcube>
Previous frame inner to this frame (gdb could not unwind past this frame)
<hcube>
ok, i think i'll drop llvm-gcc. google said that that's the problem
Indian-2010 has left #ocaml []
pikachuyann is now known as pika|physique
wuj has joined #ocaml
schme has joined #ocaml
<adrien>
does sexplib allow defaults value for fields in a record: I want a default value when a field isn't provided (it can default to None but I couldn't find more)
lpereira has quit [Quit: Leaving.]
<flux>
I don't think so
pkl has joined #ocaml
mjonsson has joined #ocaml
<hcube>
i did a little debug and it camed up that the program crashes at caml_start_program call
<hcube>
but only in threaded mode
<hcube>
in non threaded (ocaml) mode i cant step into caml_start_program the debugger stepped through the function call
<hcube>
where can i find info about ocaml runtime and ocamlopt internals?
wuj has quit [Ping timeout: 265 seconds]
init1 has quit [Quit: Quitte]
Yoric has joined #ocaml
pkl has quit [Quit: rcirc on GNU Emacs 24.0.50.1]
joewilliams_away is now known as joewilliams
fraggle_ has quit [Ping timeout: 276 seconds]
fraggle_ has joined #ocaml
fraggle_ has quit [Ping timeout: 240 seconds]
fraggle_ has joined #ocaml
<hcube>
what's the difference between libthreadsnat.a and libthreads.a ?
<flux>
no real idea, but perhaps one of them is used for native code, other for byte code?
<flux>
s/idea/knowledge/
<hcube>
probably you are right, because in native and threaded mode the project links only with threadsnat, otherwise linking fails.