openalea-incubator / caribu

Eco-physiological model of light interception by plants
Other
6 stars 11 forks source link

BUG - x64 linux - buffer overflow - #38

Open artzet-s opened 6 years ago

artzet-s commented 6 years ago

Only on linux x64 (x86 not tested).

Win and OSX works.

Tested on 2 linux server machine (where 1 build from scratch from a cloud platform, so completely clean).

Tested with several installation :

from alinea.caribu.CaribuScene import CaribuScene

scene={'t1': [[(-199., 12945., 1061.), (-213., 12958., 1076.), (-226., 12930.5, 1058.2)]]}
cscene = CaribuScene(scene)
cscene.run(direct=True, simplify=True)

result of =>

caribu

It's not this only triangle, bug appears with several other triangle.

artzet-s commented 6 years ago

Also tested with several version :

Commits on Mar 23, 2018 : 4a6656bf98face51c3bafa91417af9943aaa98ec Commits on Mar 7, 2018 : 491578cc9a86446e5a7bc10ef0de0abf254959a0 Commits on Dec 20, 2017 : 31eb32fa7248ee03dbfad2d67ed290d7536bbc8b

And different fork :

https://github.com/christian34/caribu

with branch : master and fix_cpp_warnings

artzet-s commented 6 years ago

Solved by div 10 the position values. @pradal @christian34

>>> scene={'t1': [[(-19.9, 1294.5, 106.1), (-21.3, 1295.8, 107.6), (-22.6, 1293.05, 105.82)]]}
>>> cscene = CaribuScene(scene)
>>> cscene.run(direct=True, simplify=True)
({'area': {'t1': [3.664119]}, 'Ei': {'t1': [0.754983908045977]}, 'Eabs': {'t1': [0.656836]}}, {'area': {'t1': 3.664119}, 'Ei': {'t1': 0.754983908045977}, 'Eabs': {'t1': 0.6568360000000001}})
artzet-s commented 6 years ago

So in CaribuScene(scene, scene_unit='cm'), scene_unit not work and caribu have buffer problem with several "big" triangle. Still need to be fix.

christian34 commented 6 years ago

Okay thanks for your investigations ! I think the bug is then probably related to #2, and the odd string format with %f and 130 characters max triangle coordinate reading/writing used for piping the scene along tha caribu pipeline. I will test that !