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

petite imprecision du backtrace #3054

Closed
vicuna opened this issue Nov 26, 2001 · 3 comments
Closed

petite imprecision du backtrace #3054

vicuna opened this issue Nov 26, 2001 · 3 comments
Labels

Comments

@vicuna
Copy link

vicuna commented Nov 26, 2001

Original bug ID: 654
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug description

Objective Caml version 3.03 ALPHA+4 (2001-11-16)

J'ai cette trace:
Fatal error: uncaught exception Invalid_argument("String.get")
Raised from a C functionCalled from module Cash-tramp, character 1152
Called from module Cash-tramp, character 1561
Called from module Cash-tramp, character 3656

Le source correspondant est (en syntaxe révisée, mais ça se comprend):
value rindex_blank str from =
loop from where rec loop i = if i < 0 || ' ' = str.[i] then i else loop (pred i)
;

value split_additional_args line =
loop (String.length line) [] where rec loop upper splitted =
if upper < 0 then splitted
else
let lower = if upper = 0 then -1 else rindex_blank line upper in
Char 1152 ___________________________________________________________^
loop lower [String.sub line (succ lower) (upper - lower - 1) :: splitted]
;

Il n'y a visiblement pas de String.get dans split_additional_args, donc:

  • on s'attend à avoir une ligne Raised from ... character xxx dans
    rindex_blank, près de str.[i]. Il y a sans doute des cas plus
    troublants que celui-ci, e.g. quand la fonction manquante a des
    centaines de String.get.
  • (cosmétique) il manque sans doute un \n après "Raised from a C function"

Bruno.

@vicuna
Copy link
Author

vicuna commented Nov 26, 2001

Comment author: administrator

Il n'y a visiblement pas de String.get dans split_additional_args, donc:

  • on s'attend à avoir une ligne Raised from ... character xxx dans
    rindex_blank, près de str.[i]. Il y a sans doute des cas plus
    troublants que celui-ci, e.g. quand la fonction manquante a des
    centaines de String.get.
  • (cosmétique) il manque sans doute un \n après "Raised from a C function"

Le bug cosmétique est corrigé. Pour ce qui est des backtrace
"absurdes", un problème du même genre m'a été signalé il y a quelques
jours (bug report numéro 629). Je viens de réviser et de "commettre"
le code de backtrace. Si tu veux essayer...

  • Xavier

@vicuna
Copy link
Author

vicuna commented Dec 4, 2001

Comment author: administrator

Date: Mon, 26 Nov 2001 17:11:12 +0100
From: Xavier Leroy xavier.leroy@inria.fr

Il n'y a pas de String.get dans split_additional_args, donc:

  • on s'attend à avoir une ligne Raised from ... character xxx
    dans rindex_blank, près de str.[i].
    Pour ce qui est des backtrace "absurdes", un problème du même genre
    m'a été signalé il y a quelques jours (bug report numéro 629). Je
    viens de réviser et de "commettre" le code de backtrace. Si tu
    veux essayer...
    J'ai essayé, c'est pareil. Des fois que ce serait facile à corriger
    avant la 3.04, je soumets un exemple plus petit:
    -- bug-bt.ml
    let bogue s i = s.[i];;

let call_bogue () = bogue "abc" 5;;

let main () = call_bogue ();;

main ();;

$ ocamlc -g -custom bug-bt.ml -o bug-bt
$ OCAMLRUNPARAM=b ./bug-bt
Fatal error: uncaught exception Invalid_argument("String.get")
Raised from a C function
Called from module Bug-bt, character 100
100, c'est entre les () de l'appel à main en dernière ligne. Ok, ce
sont des tail-calls. Mais Invalid_argument arrive avant le retour de
bogue. Il manque donc une ligne de backtrace, avec un numéro de
caractère < 25 (environ).

Bruno.

@vicuna
Copy link
Author

vicuna commented Nov 26, 2002

Comment author: administrator

Problem with s.[i] raising an exception but not recorded in the backtrace. Fixed
2002-11-26 by XL.

@vicuna vicuna closed this as completed Nov 26, 2002
@vicuna vicuna added the bug label Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant