Patch for meshing2.cpp (access violation)

Help
Anonymous
2012-08-03
2013-05-27

  • Anonymous
    2012-08-03

    Hi,

    I got crashes for certain meshing parameters, when meshing in the GUI or via nglib.

    After debugging for a bit I found a bug in the code (meshing2.cpp), which leads to an access violation (access index 0 of empty array).

    Would be great if this could find its way into the repository. Here is the patch:

    -- C:/Users/Bryn/AppData/Local/Temp/meshing2.cpp-rev3028.svn000.tmp.cpp Thu Aug  2 17:24:56 2012
    +++ C:/Users/Bryn/AppData/Local/Temp/meshing2.cpp-rev3029.svn000.tmp.cpp Thu Aug  2 22:50:17 2012
    @@ -1087,6 +1087,9 @@
    for (jj = 1; jj <= intersecttrias.Size(); jj++)
      {
        int j = intersecttrias.Get(jj);
    +
    + if (j < 1 || j >= mesh.GetNSE())
    + continue;
        const Element2d & el = mesh.SurfaceElement(j);
     
        int ntrig = (el.GetNP() == 3) ? 1 : 2;

     
  • Hi,

    thank you for the bug report.

    Indeed, this is not a fix of the problem, but a circumvention of the crash.

    Can you send me a crashing example ? (input + options file).

    thanks,
    Joachim