Salut Bernard,
j'étais en train de jouer avec les exemples quand je suis tombé sur un plantage (on devrait m'engager comme bêta-testeur !) mais seulement sur windows32 double coeur et linux64 double coeur. Par contre ça ne plante pas sous win32 simple coeur.
Il s'agit de l'exemple analyse->newton.xws.
je passe en mode pointeur et je bouge N0.
Linux64 reste figé sur "calcul en cours" à T0:=tangent(F,M0,couleur=bleu);
Win32 se ferme tout seul.
Sous linux64 même si je ne touche pas à la figure et que je donne une autre valeur à x0 avec les flèches ça se fige de la même façon. Dans win32 ça marche.
Au sujet du déplacement de N0 à la souris, qui n'a pas de sens ici, telle qu'est écrite cette activité, je voulais te faire un petit commentaire mais j'ouvrirai un autre fil car il n'est pas question de bug.
A+
Plantage de xcas
Modérateur : xcasadmin
Re: Plantage de xcas
C'est un effet de bord des modifs faites pour ta bspline, iln'y a même pas besoin de bouger N0, ça bloque tout de suite à cause d'un déverouillage trop tardif d'un mutex. Si tu veux corriger, il faut modifier dans Xcas1.cc
Code : Tout sélectionner
void Xcas_eval_callback(const giac::gen & evaled_g,void * param){
Fl_Widget * wid=static_cast<Fl_Widget *>(param);
if (!wid)
return;
int hp_pos;
History_Pack * hp = get_history_pack(wid,hp_pos);
context * contextptr = hp?hp->contextptr:0;
Fl_Group * gr = wid->parent();
if (!hp || !gr)
return;
#ifdef HAVE_LIBPTHREAD
// cerr << "geo2d lock" << endl;
pthread_mutex_lock(&interactive_mutex);
bool b=io_graph(contextptr);
io_graph(contextptr)=false;
#endif
bool block=block_signal;
block_signal=true;
// int m=gr->children();
// reset output
logptr(&std::cerr,contextptr);
if (!giac::history_out(contextptr).empty() && giac::history_out(contextptr).size()==giac::history_in(contextptr).size())
giac::history_out(contextptr).back()=evaled_g;
else
giac::history_out(contextptr).push_back(evaled_g);
int pos=gr->find(wid);
Fl_Widget * res = in_Xcas_eval(wid,evaled_g,hp->pretty_output,contextptr);
if (Log_Output * lout=find_log_output(gr))
output_resize_parent(lout,false);
if (res){
// resize group/pack here
gr->Fl_Widget::resize(gr->x(),gr->y(),gr->w(),gr->h()+res->h()-wid->h());
res->resize(wid->x(),wid->y(),res->w(),res->h());
int dy=res->h()-wid->h();
gr->remove(wid);
Graph2d3d * widgraph = 0;
if (Fl_Group * widgr = dynamic_cast<Fl_Group *>(wid)){
if (widgr->children())
widgraph=dynamic_cast<Graph2d3d *>(widgr->child(0));
}
Graph2d3d * resgraph = 0;
if (Fl_Group * widgr = dynamic_cast<Fl_Group *>(res)){
if (widgr->children())
resgraph=dynamic_cast<Graph2d3d *>(widgr->child(0));
}
gr->insert(*res,pos);
change_group_fontsize(gr,gr->labelsize());
if (widgraph && resgraph){
resgraph->copy(*widgraph);
resgraph->resize(resgraph->x(),resgraph->y(),widgraph->w(),resgraph->h());
resgraph->resize_mouse_param_group(gr->w()-widgraph->w());
}
// gr->resizable(gr);
hp->resize();
if (Fl_Scroll * s = dynamic_cast<Fl_Scroll *>(hp->parent())){
int spos=s->yposition();
if (spos+s->h()>hp->h()){
#ifdef _HAVE_FL_UTF8_HDR_
s->scroll_to(0,max(min(hp->h()-s->h(),spos+dy),0));
#else
s->position(0,max(min(hp->h()-s->h(),spos+dy),0));
#endif
}
s->redraw();
}
Fl_Group * group = parent_skip_scroll(hp);
if (Logo * logo=dynamic_cast<Logo *>(group)){
logo->redraw();
}
// show DispG?
if (hp->pretty_output && !Xcas_DispG_Window->visible()){
int entries=Xcas_DispG->plot_instructions.size();
if (entries>xcas_dispg_entries){
if (resgraph){
vecteur dispgv=vecteur(Xcas_DispG->plot_instructions.begin()+xcas_dispg_entries,Xcas_DispG->plot_instructions.end()),v1,v2;
aplatir(dispgv,v1);
aplatir(resgraph->plot_instructions,v2);
if (v1!=v2){
if (Xcas_DispG_Cancel) Xcas_DispG_Cancel->hide();
show_xcas_dispg=2;
}
}
else {
if (Xcas_DispG_Cancel) Xcas_DispG_Cancel->hide();
show_xcas_dispg=2;
}
}
}
block_signal=block;
#ifdef HAVE_LIBPTHREAD
// cerr << "geo2d unlock" << endl;
pthread_mutex_unlock(&interactive_mutex);
io_graph(contextptr)=b;
#endif
// if hp has eval_below, call callback on next widget
if (hp->eval_below)
hp->next(hp_pos);
else {
Fl_Group * hpp = parent_skip_scroll(hp);
if (hpp){
int N=hpp->children();
for (int i=0;i<N;++i){
Graph2d3d * geo = dynamic_cast<Graph2d3d *>(hpp->child(i));
if (geo){
geo->add(evaled_g);
geo->no_handle=false;
}
}
}
hp->focus(hp_pos+1,false);
}
} // if (res)
else { // res==0 no output
if (Fl_Input_ * i=dynamic_cast<Fl_Input_ * >(wid))
i->value("No_output");
hp->resize();
block_signal=block;
#ifdef HAVE_LIBPTHREAD
// cerr << "geo2d unlock" << endl;
pthread_mutex_unlock(&interactive_mutex);
io_graph(contextptr)=b;
#endif
}
}