Segmentation fault during Ruler coordinates changing

edited January 2016 in KLayout Support
Hi Matthias,

Long time ago I have already asked you about problem with particular coordinated showing in GDS.
My proposal was to draw some crosshair in requested position when "Goto Position" menu is used.
It would help to see requested position immediately in zoomed layout part.
You promised to review this availability and recommended me another roundabout way:
to create ruler and to edit one of its coordinate with required coordinates.
And I became use this method.


But often I get "Segmentation fault" during Ruler coordinates changing.
Always it happens when I change x,y coordinates of one of the ruler end to coordinates that request ruler to turn in opposite side.

After new klayout version installation (0.24.4) I got bug report during such Segmentation fault.
I'm sending it to you in the end of my comment.

Hope you will fix it. And even better wold be you add crosshair in "Goto Position" to have this feature useful.
I used this feature VERY often to search devices coordinates from LVS report during LVS debugging.

Thank you in advance,
Eugene.

***** BEGIN OF BUG REPORT:

Signal number: 11
Address: 0x0
Program Version: KLayout 0.24.4 (2015-12-16 r3109)
Backtrace:
/proj/memcom/releases/tools/KLayout/klayout-0.24.4/klayout(_ZN2tl4Eval11interpolateERKSs+0x1b8) [0x1ca07d8]
/proj/memcom/releases/tools/KLayout/klayout-0.24.4/klayout(_ZNK3ant6Object9formattedERKSsRKN2db14fixpoint_transIdEE+0x3b9) [0xb22bf9]
/proj/memcom/releases/tools/KLayout/klayout-0.24.4/klayout(_ZN3ant10draw_rulerERKNS_6ObjectERKN2db13complex_transIdddEEbPN3lay11CanvasPlaneERNS8_8RendererE+0xd55) [0xb33415]
/proj/memcom/releases/tools/KLayout/klayout-0.24.4/klayout(_ZN3ant4View6renderERKN3lay8ViewportERNS1_16ViewObjectCanvasE+0x31b) [0xb33ebb]
/proj/memcom/releases/tools/KLayout/klayout-0.24.4/klayout(_ZN3lay16ViewObjectWidget9do_renderERKNS_8ViewportERNS_16ViewObjectCanvasEb+0xb9) [0x1c2b559]
/proj/memcom/releases/tools/KLayout/klayout-0.24.4/klayout(_ZN3lay12LayoutCanvas10paintEventEP11QPaintEvent+0x258) [0x1f40d18]
/tools/Qt-4.8.6/lib/libQtGui.so.4(_ZN7QWidget5eventEP6QEvent+0xae6) [0x2b16691ee5d6]
/proj/memcom/releases/tools/KLayout/klayout-0.24.4/klayout(_ZN3lay12LayoutCanvas5eventEP6QEvent+0x2f) [0x1f3da2f]
/tools/Qt-4.8.6/lib/libQtGui.so.4(_ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent+0xaf) [0x2b166918f94f]
/tools/Qt-4.8.6/lib/libQtGui.so.4(_ZN12QApplication6notifyEP7QObjectP6QEvent+0x183) [0x2b16691966c3]
/proj/memcom/releases/tools/KLayout/klayout-0.24.4/klayout(_ZN3lay11Application6notifyEP7QObjectP6QEvent+0x6) [0x1b20076]
/tools/Qt-4.8.6/lib/libQtCore.so.4(_ZN16QCoreApplication14notifyInternalEP7QObjectP6QEvent+0x84) [0x2b1669ebb8d4]
/tools/Qt-4.8.6/lib/libQtGui.so.4(_ZN14QWidgetPrivate10drawWidgetEP12QPaintDeviceRK7QRegionRK6QPointiP8QPainterP19QWidgetBackingStore+0x575) [0x2b16691e7fe5]
/tools/Qt-4.8.6/lib/libQtGui.so.4(_ZN14QWidgetPrivate22paintSiblingsRecursiveEP12QPaintDeviceRK5QListIP7QObjectEiRK7QRegionRK6QPointiP8QPainterP19QWidgetBackingStore+0x536) [0x2b16691e8a96]
/tools/Qt-4.8.6/lib/libQtGui.so.4(_ZN14QWidgetPrivate10drawWidgetEP12QPaintDeviceRK7QRegionRK6QPointiP8QPainterP19QWidgetBackingStore+0x16a) [0x2b16691e7bda]
/tools/Qt-4.8.6/lib/libQtGui.so.4(_ZN14QWidgetPrivate22paintSiblingsRecursiveEP12QPaintDeviceRK5QListIP7QObjectEiRK7QRegionRK6QPointiP8QPainterP19QWidgetBackingStore+0x536) [0x2b16691e8a96]
/tools/Qt-4.8.6/lib/libQtGui.so.4(_ZN14QWidgetPrivate10drawWidgetEP12QPaintDeviceRK7QRegionRK6QPointiP8QPainterP19QWidgetBackingStore+0x16a) [0x2b16691e7bda]
/tools/Qt-4.8.6/lib/libQtGui.so.4(_ZN14QWidgetPrivate22paintSiblingsRecursiveEP12QPaintDeviceRK5QListIP7QObjectEiRK7QRegionRK6QPointiP8QPainterP19QWidgetBackingStore+0x536) [0x2b16691e8a96]
/tools/Qt-4.8.6/lib/libQtGui.so.4(_ZN14QWidgetPrivate10drawWidgetEP12QPaintDeviceRK7QRegionRK6QPointiP8QPainterP19QWidgetBackingStore+0x16a) [0x2b16691e7bda]
/tools/Qt-4.8.6/lib/libQtGui.so.4(_ZN14QWidgetPrivate22paintSiblingsRecursiveEP12QPaintDeviceRK5QListIP7QObjectEiRK7QRegionRK6QPointiP8QPainterP19QWidgetBackingStore+0x536) [0x2b16691e8a96]
/tools/Qt-4.8.6/lib/libQtGui.so.4(_ZN14QWidgetPrivate10drawWidgetEP12QPaintDeviceRK7QRegionRK6QPointiP8QPainterP19QWidgetBackingStore+0x16a) [0x2b16691e7bda]
/tools/Qt-4.8.6/lib/libQtGui.so.4(_ZN14QWidgetPrivate22paintSiblingsRecursiveEP12QPaintDeviceRK5QListIP7QObjectEiRK7QRegionRK6QPointiP8QPainterP19QWidgetBackingStore+0x536) [0x2b16691e8a96]
/tools/Qt-4.8.6/lib/libQtGui.so.4(_ZN14QWidgetPrivate10drawWidgetEP12QPaintDeviceRK7QRegionRK6QPointiP8QPainterP19QWidgetBackingStore+0x16a) [0x2b16691e7bda]
/tools/Qt-4.8.6/lib/libQtGui.so.4 [0x2b16693cec0c]
/tools/Qt-4.8.6/lib/libQtGui.so.4(_ZN14QWidgetPrivate16syncBackingStoreEv+0x86) [0x2b16691de106]
/tools/Qt-4.8.6/lib/libQtGui.so.4(_ZN7QWidget5eventEP6QEvent+0x28d) [0x2b16691edd7d]
/tools/Qt-4.8.6/lib/libQtGui.so.4(_ZN11QMainWindow5eventEP6QEvent+0x13c) [0x2b166960381c]
/tools/Qt-4.8.6/lib/libQtGui.so.4(_ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent+0xaf) [0x2b166918f94f]
/tools/Qt-4.8.6/lib/libQtGui.so.4(_ZN12QApplication6notifyEP7QObjectP6QEvent+0x183) [0x2b16691966c3]
/proj/memcom/releases/tools/KLayout/klayout-0.24.4/klayout(_ZN3lay11Application6notifyEP7QObjectP6QEvent+0x6) [0x1b20076]
/tools/Qt-4.8.6/lib/libQtCore.so.4(_ZN16QCoreApplication14notifyInternalEP7QObjectP6QEvent+0x84) [0x2b1669ebb8d4]
/tools/Qt-4.8.6/lib/libQtCore.so.4(_ZN23QCoreApplicationPrivate16sendPostedEventsEP7QObjectiP11QThreadData+0x26e) [0x2b1669ebf57e]
/tools/Qt-4.8.6/lib/libQtCore.so.4 [0x2b1669eee633]
/lib64/libglib-2.0.so.0(g_main_context_dispatch+0x1b4) [0x3f41c2cdb4]
/lib64/libglib-2.0.so.0 [0x3f41c2fc0d]
/lib64/libglib-2.0.so.0(g_main_context_iteration+0x6e) [0x3f41c3011e]
/tools/Qt-4.8.6/lib/libQtCore.so.4(_ZN20QEventDispatcherGlib13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE+0x65) [0x2b1669eee825]
/tools/Qt-4.8.6/lib/libQtGui.so.4 [0x2b166924064f]
/tools/Qt-4.8.6/lib/libQtCore.so.4(_ZN10QEventLoop13processEventsE6QFlagsINS_17ProcessEventsFlagEE+0x35) [0x2b1669eba8e5]
/tools/Qt-4.8.6/lib/libQtCore.so.4(_ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE+0x128) [0x2b1669ebacb8]
/tools/Qt-4.8.6/lib/libQtCore.so.4(_ZN16QCoreApplication4execEv+0xb4) [0x2b1669ebfae4]
/proj/memcom/releases/tools/KLayout/klayout-0.24.4/klayout(_ZN3lay11Application4execEv+0x1b2) [0x1b251e2]
/proj/memcom/releases/tools/KLayout/klayout-0.24.4/klayout(_ZN3lay11Application3runEv+0x137c) [0x1b26c4c]
/proj/memcom/releases/tools/KLayout/klayout-0.24.4/klayout(_Z12klayout_mainiPPc+0x20f) [0xb1d38f]
/proj/memcom/releases/tools/KLayout/klayout-0.24.4/klayout(main+0x101) [0xb1daa1]
/lib64/libc.so.6(__libc_start_main+0xf4) [0x3f3c01d994]
/proj/memcom/releases/tools/KLayout/klayout-0.24.4/klayout(_ZN9QTextEdit14dragEnterEventEP15QDragEnterEvent+0x69) [0xb1cfe9]

***** END OF BUG REPORT

Comments

  • edited November -1

    Hi Eugene,

    thanks for sending this report. As far as I can tell this happens when the coordinate texts are built.

    I guess the reason is something in the formatting string. Could you grep for the line "..." in ~/.klayout/klayoutrc and send this line (either here or to the contacts mail address)? That would give some hint about the format strings you are using and will help me to debug the problem.

    And the crosshair request have been noted.

    Thanks,

    Matthias

  • edited November -1
    Matthias,

    here is my ruler settings in klayoutrc file:

    <ruler-color>auto</ruler-color>
    <ruler-grid-snap>true</ruler-grid-snap>
    <ruler-halo>true</ruler-halo>
    <ruler-obj-snap>true</ruler-obj-snap>
    <ruler-snap-mode>diagonal</ruler-snap-mode>
    <ruler-snap-range>8</ruler-snap-range>
    <ruler-templates>title=Ruler,fmt=$D,fmt_x=$X,fmt_y=$Y,style=ruler,outline=diag,snap=true,angle_constraint=global</ruler-templates>
    <rulers>-1</rulers>

    Hope, this will help you.

    Best regards,
    Eugene.
  • edited November -1

    Hi Eugene,

    I'm sorry, but I can't find an issue. I tried my best to reproduce it or understand what may go wrong, but I have not found anything wrong.

    From the message I see that it seems to be related to STL strings. Maybe there is something wrong with the gcc installation on your system? What is version are you using?

    Are you able to reproduce the issue on Windows?

    You can try to rule out some more reasons by disabling "snap to grid" and "snap to objects" and setting the "angle snap mode" to "any angle".

    Thanks,

    Matthias

  • edited November -1
    Hi Matthias,

    I checked that my GCC is: g++ (GCC) 4.1.2 20080704 (Red Hat 4.1.2-50)

    I was going to prepare a testcase for you (small gds and particular ruler coordinates), but found that "segmentation fault" occurs not every time I change ruler coordinates and doesn't depend on coordinates: in two attempts with the same coordinates, one failed and one passed successfully. Sometimes klayout fails with the following notes in shell window:

    Warning: QWidget::repaint: Recursive repaint detected
    terminate called after throwing an instance of 'tl::CancelException'
    terminate called recursively

    I'll give you to know if I find any reasons of the issue.

    Best regards,
    Eugene.
  • edited November -1

    Hi Eugene,

    I am using Qt 4.8.6 myself, but a much more recent gcc (4.6.3 and 4.8.4). I don't see the recursive paint event warning and I am a bit worried about the termination upon exceptions. Qt 4.8.6 is fairly safe against exceptions and I am catching them globally, so the message indicates some problem with exception handling.

    gcc 4.1.2 may require more build options, both for Qt and KLayout. Specifically "-fexceptions" may be such a candidate. gcc is supposed to enable exceptions automatically for C++, but I don't know whether that was the case with gcc 4.1.2 already. If this option is required, it's important to build Qt in the same way since KLayout sometimes relies on exceptions being relayed across Qt library boundaries.

    Matthias

  • edited November -1
    Hi Matthias,

    I use Qt 4.8.6 too. I installed gcc 4.8.4 (the same as you use) and compiled klayout with it.
    Klayout behavior didn't change. Corruptions with "Segmentation fault" occurs randomly during ruler coordinates edition.

    Best regards,
    Eugene.
  • edited January 2016

    Hi Eugene,

    that's strange. Some stack trace (top one being "_ZN2tl4Eval11interpolateERKSs+0x1b8")?

    Do you have a chance to build KLayout in debug mode and run it within gdb? If you could send the gdb backtrace from that segmentation fault that gave me some more information than the one from the optimized release build. I don't need a full build - a quick one without Ruby and Python ("-noruby -nopython") will do.

    Thanks,

    Matthias

  • edited November -1
    Hi Matthias,

    Of course, I can do that, but I'm not very familiar with compilation process.
    Please, explain me how should I "build KLayout in debug mode" and how to "run it within gdb"?
    Is "gdb backtrace" you need just a STDOUTPUT?

    Best regards,
    Eugene.
  • edited November -1

    Hi Eugene,

    when you build KLayout, the build script will tell you the "platform" it uses. I assume it is "Makefile.conf.linux-64-gcc-release" for example. To perform a debug build, you have to tell the build script to use the corresponding "debug" setup. For example

    build.sh -platform Makefile.conf.linux-64-gcc-debug ...
    

    Once you have compiled KLayout, you can run that binary within gdb:

    gdb path_to_your_binary/klayout
    # On the GDB prompt you say:
    $ run
    

    Once the segmentation fault is triggered, execution will stop inside GDB and you can use the "bt" command to print a stack trace:

    $ bt
    

    This output is the interesting part for me.

    Matthias

Sign In or Register to comment.