caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Segfault in a native code multi-threaded program
@ 2001-08-16  8:08 David Mentre
  2001-08-16 12:45 ` Vitaly Lugovsky
       [not found] ` <3B7C5A74.15141D95@maxtal.com.au>
  0 siblings, 2 replies; 12+ messages in thread
From: David Mentre @ 2001-08-16  8:08 UTC (permalink / raw)
  To: caml-list

Hello dear Camlers,

My multi-threaded program works well with the byte code compiler but
(sometimes) produces a segfault with the native code compiler. How can I
have more info to find the specific line of code that produces this
segfault? I've tried to run gdb but even when the program works until
its end, gdb is blocked.

My environment: x86 Linux.

Quoting the FAQ[1], they are several possible issues:

>   * when accessing out of range in a vector or string, when the compilers
>     does not generate bound checking (due to explicit user's request),

No. Standard compilation with all checks.

>   * when attempting to perform an illegal floating point operation
>     (division by 0), on some processors running under some OSes (e.g. alpha
>     processor under True64 Unix),

No. No floating point operations.

>   * when the program is looping and consumes the whole memory for the
>     execution stack, when the overflow check cannot detect this situation
>     (for instance, in case of a native code program running under
>     Unix),

I think no. My program is running well in byte code.

>   * when using ``magic coercion'' from the Obj module,

No. I don't use this feature.

>   * in case of erroneous usage (i.e. ill-typed usage) of marshalling
>     primitives output_value, input_value, etc,
>

Err, maybe. However, how to find where? And my program is working in
byte code!

>   * when calling user's defined external functions (for instance written in
>     C) and when the interface is wrong (since effective types of primitives
>     are not the types declared to the Caml compiler).
>

No. No external functions.

>Very often, you should use the Caml debugger to precisely find where in your
>code the error is occurring, and then correct the program.

I can't use the debugger as it does not work with multi-threaded programs.


Best regards,
david

[1] http://caml.inria.fr/FAQ/FAQ_EXPERT-eng.html#bus_error

-- 
 David.Mentre@inria.fr
 Opinions expressed here are only mine.
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 12+ messages in thread
* Re: [Caml-list] Segfault in a native code multi-threaded program
@ 2001-08-20 12:57 Krishnaswami, Neel
  0 siblings, 0 replies; 12+ messages in thread
From: Krishnaswami, Neel @ 2001-08-20 12:57 UTC (permalink / raw)
  To: caml-list

David Mentre [mailto:David.Mentre@inria.fr] wrote:
> Brian Rogoff <bpr@best.com> writes:
> > 
> > A more type safe marshaling framework is way up there on my list of
> > desired enhancements. I think this will be part of the extensional
> > polymorphism enhancements that you can see now in G'Caml. 
> 
> In my opinion, they are two different kinds of marshaling 
> that one could expect: the safe one and the correct one. [...]
> 
> I have probably missed something on the difficulty of marshaling. I
> tried to look at the mailing list archive, but did not find out the
> relevant messages. Any pointer?

Dumb observation. It seems to me that a lot of the simpler 
marshalling problems -- tree-like structures with no closures -- can 
be handled using a tool like the Zephyr project's ASDL (abstract 
syntax description language). 

  http://www.cs.princeton.edu/zephyr/ASDL

I believe it has a mode to emit Caml, in addition to SML, Haskell
and Java. This ought to be able to handle a lot of cases with no
risk of core dumps. Code generation is a pain, of course, but it 
seems to me to be preferable to core dumps. 

--
Neel Krishnaswami
neelk@cswcasa.com
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2001-08-23  8:54 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-16  8:08 [Caml-list] Segfault in a native code multi-threaded program David Mentre
2001-08-16 12:45 ` Vitaly Lugovsky
2001-08-17  8:09   ` David Mentre
2001-08-17 16:54     ` Brian Rogoff
2001-08-20  9:12       ` David Mentre
2001-08-20 16:54       ` Jun P. FURUSE
2001-08-18 23:15     ` John Max Skaller
2001-08-19  0:24       ` John Gerard Malecki
2001-08-19 18:18         ` [Caml-list] Ocaml ffi release 1.2.2 dsfox
     [not found] ` <3B7C5A74.15141D95@maxtal.com.au>
     [not found]   ` <qtlitfm6ajh.fsf@pochi.inria.fr>
     [not found]     ` <3B7F0C99.FEDEAA86@maxtal.com.au>
     [not found]       ` <qtl3d6m4vkt.fsf@pochi.inria.fr>
2001-08-21 19:20         ` [Caml-list] Segfault in a native code program using pm variants John Max Skaller
2001-08-23  8:54           ` Xavier Leroy
2001-08-20 12:57 [Caml-list] Segfault in a native code multi-threaded program Krishnaswami, Neel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).