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

[Linux] IDE crashes one time a day #592

Open
Kiiv opened this issue Mar 17, 2023 · 23 comments
Open

[Linux] IDE crashes one time a day #592

Kiiv opened this issue Mar 17, 2023 · 23 comments
Labels
Linux/GTK Happens on Linux Wayland

Comments

@Kiiv
Copy link

Kiiv commented Mar 17, 2023

Hi,

At least since 2022-12 update, Eclipse crashes few minutes after the first launch of the day.
I know it's kinda weird but after I relaunch it, I have no more problem for the rest of the day :s

I'm just launching my IDE, start to work, and after some random time but not more than an hour, the IDE is closing itself.
hs_err_pid228593.log
metadata.log

Tell me if you need more log.

Regards,
Clément.

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007fd8a28604a3, pid=228593, tid=228594
#
# JRE version: OpenJDK Runtime Environment Temurin-17.0.6+10 (17.0.6+10) (build 17.0.6+10)
# Java VM: OpenJDK 64-Bit Server VM Temurin-17.0.6+10 (17.0.6+10, mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# C  [libglib-2.0.so.0+0x6f4a3]
C  [libglib-2.0.so.0+0x6f4a3]

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
J 10423  org.eclipse.swt.internal.gtk.OS.pango_attr_list_unref(J)V (0 bytes) @ 0x00007fd8dd0314e1 [0x00007fd8dd0314a0+0x0000000000000041]
J 8666 c1 org.eclipse.swt.graphics.TextLayout.freeRuns()V (57 bytes) @ 0x00007fd8d506d2d4 [0x00007fd8d506d160+0x0000000000000174]
j  org.eclipse.swt.graphics.TextLayout.setStyle(Lorg/eclipse/swt/graphics/TextStyle;II)V+263
J 18672 c2 org.eclipse.swt.custom.StyledTextRenderer.getTextLayout(IIII)Lorg/eclipse/swt/graphics/TextLayout; (2903 bytes) @ 0x00007fd8dd4a6af0 [0x00007fd8dd4a4000+0x0000000000002af0]
J 20955 c2 org.eclipse.swt.custom.StyledTextRenderer.getTextLayout(I)Lorg/eclipse/swt/graphics/TextLayout; (201 bytes) @ 0x00007fd8dd6fc064 [0x00007fd8dd6fbfa0+0x00000000000000c4]
J 10418 c1 org.eclipse.swt.custom.StyledTextRenderer.calculate(II)V (181 bytes) @ 0x00007fd8d61f6de4 [0x00007fd8d61f6360+0x0000000000000a84]
j  org.eclipse.swt.custom.StyledTextRenderer.calculateClientArea()V+42
j  org.eclipse.swt.custom.StyledText.resetCache(II)V+21
j  org.eclipse.swt.custom.StyledText.redraw(IIIIZ)V+43
j  org.eclipse.jface.text.CursorLinePainter.drawHighlightLine(Lorg/eclipse/jface/text/Position;)V+197
j  org.eclipse.jface.text.CursorLinePainter.paint(I)V+84
j  org.eclipse.jface.text.PaintManager.paint(I)V+25
j  org.eclipse.jface.text.PaintManager.mouseDown(Lorg/eclipse/swt/events/MouseEvent;)V+2
@iloveeclipse iloveeclipse transferred this issue from eclipse-platform/eclipse.platform Mar 17, 2023
@iloveeclipse iloveeclipse added Linux/GTK Happens on Linux Wayland labels Mar 17, 2023
@mickaelistria mickaelistria changed the title IDE crashes one time a day [Linux] IDE crashes one time a day Mar 17, 2023
@mickaelistria
Copy link
Contributor

Can you please share information about the Linux distribution you're using and version of gtk and family?

@iloveeclipse
Copy link
Member

This could be either Ubuntu specific GTK problem, or Wayland you are using.
Try to use X11 please.

@akurtakov
Copy link
Member

The issue is in Pango integration (pango_attr_list_unref) and SWT hasn't been updated to latest Pango changes so I highly doubt this is WM related issue.

@akurtakov
Copy link
Member

One known pango integration issue is #411 . @Kiiv would you please share your libpango version?

@Kiiv
Copy link
Author

Kiiv commented Mar 17, 2023

OS :

NAME="Ubuntu"
VERSION="20.04.5 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.5 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

libgtk :

ii  libgtk-3-0:amd64                              3.24.20-0ubuntu1.1                          amd64        GTK graphical user interface library
ii  libgtk-3-bin                                  3.24.20-0ubuntu1.1                          amd64        programs for the GTK graphical user interface library
ii  libgtk-3-common                               3.24.20-0ubuntu1.1                          all          common files for the GTK graphical user interface library
ii  libgtk-vnc-2.0-0:amd64                        1.0.0-1build1                               amd64        VNC viewer widget for GTK+3 (runtime libraries)
ii  libgtk2.0-0:amd64                             2.24.32-4ubuntu4                            amd64        GTK graphical user interface library - old version
ii  libgtk2.0-bin                                 2.24.32-4ubuntu4                            amd64        programs for the GTK graphical user interface library
ii  libgtk2.0-common                              2.24.32-4ubuntu4                            all          common files for the GTK graphical user interface library
ii  libgtk3-perl                                  0.037-1                                     all          Perl bindings for the GTK+ graphical user interface library
ii  libgtkmm-2.4-1v5:amd64                        1:2.24.5-4ubuntu2                           amd64        C++ wrappers for GTK+ 2 (shared libraries)
ii  libgtkmm-3.0-1v5:amd64                        3.24.2-1build1                              amd64        C++ wrappers for GTK+ (shared libraries)
ii  libgtksourceview-3.0-1:amd64                  3.24.11-2                                   amd64        shared libraries for the GTK+ syntax highlighting widget
ii  libgtksourceview-3.0-common                   3.24.11-2                                   all          common files for the GTK+ syntax highlighting widget
ii  libgtksourceview-4-0:amd64                    4.6.0-1                                     amd64        shared libraries for the GTK+ syntax highlighting widget
ii  libgtksourceview-4-common                     4.6.0-1                                     all          common files for the GTK+ syntax highlighting widget
ii  libgtkspell0:amd64                            2.0.16-1.3                                  amd64        spell-checking addon for GTK's TextView widget

libpango :

ii  libpango-1.0-0:amd64                          1.44.7-2ubuntu4                             amd64        Layout and rendering of internationalized text
ii  libpangocairo-1.0-0:amd64                     1.44.7-2ubuntu4                             amd64        Layout and rendering of internationalized text
ii  libpangoft2-1.0-0:amd64                       1.44.7-2ubuntu4                             amd64        Layout and rendering of internationalized text
ii  libpangomm-1.4-1v5:amd64                      2.42.0-2build1                              amd64        C++ Wrapper for pango (shared libraries)
ii  libpangoxft-1.0-0:amd64                       1.44.7-2ubuntu4                             amd64        Layout and rendering of internationalized text

@akurtakov
Copy link
Member

Interesting, this is far older pango than I expected (although 1.44 is where our issues started) . This makes me think in another direction - Do you by any chance changed the Gtk theme used? Can you try whether switching to Adwaita keeps the issue present?

@Kiiv
Copy link
Author

Kiiv commented Mar 17, 2023

Sorry if my response is not the expected one, I'm really not a Linux expert.

As graphic environnement I'm running xfce or KDE Plasma Desktop and I encounter the problem with both.
Can't check with KDE Plasma for now, but I don't think I have any theme applied on xfce. I don't even have anything else than adwaita-icon installed :

$ sudo dpkg -l | grep adwaita
ii  adwaita-icon-theme                            3.36.1-2ubuntu0.20.04.2                     all          default icon theme of GNOME (small subset)
ii  adwaita-icon-theme-full                       3.36.1-2ubuntu0.20.04.2                     all          default icon theme of GNOME

@akurtakov
Copy link
Member

Verify you actually use adwaita gtk theme for an experiment as described at https://www.omgubuntu.co.uk/2019/04/how-to-try-the-new-adwaita-theme-on-ubuntu-19-04

@Kiiv
Copy link
Author

Kiiv commented Mar 17, 2023

Ok, I'm on Breeze theme ! I'm switching to Adwaita and I'll keep you up to date.

@Kiiv
Copy link
Author

Kiiv commented Mar 17, 2023

Ok, that was fast :')

hs_err_pid253251.log
metadata.log

@akurtakov
Copy link
Member

Unfortunately, I can't find anything helpful in the log.

@SyntevoAlex
Copy link
Member

The code mentioned in callstack is executed whenever editing caret moves to a new line is source code editor.
I tried it under memory debugger, but it didn't catch any problems.

@Kiiv
Copy link
Author

Kiiv commented Mar 20, 2023

Can I do something on my side to investigate further ? Enable some debug trace, or run a tool to get more information when it happens ?

@SyntevoAlex
Copy link
Member

SyntevoAlex commented Mar 20, 2023

Let's capture a core dump to investigate further.

Note that this core dump will contain everything Eclipse knew at the moment of crash, including parts of source files, passwords, etc. If you're working on something private, you might want to create an empty workspace and reproduce the crash on some opensource code.

If you don't know how to reproduce crash quickly, you might want to install OBS-Studio and record your screen during your working days. When it crashes, check what exactly you did just before the crash and try to repeat it with exactly same source file / line.

  1. Enable core dumps on your system:
    $ ulimit -c unlimited
  2. Enable core dumps in Eclipse:
    Add -XX:+CreateCoredumpOnCrash in eclipse.ini
  3. Start Eclipse from terminal
  4. When it crashes, you'll see lines like this on terminal:
    # Core dump will be written. Default location: Core dumps may be processed with
      "/usr/share/apport/apport -p%p -s%s -c%c -d%d -P%P -u%u -g%g -- %E"
      (or dumping to /home/user/core.4448)
    #
    # An error report file with more information is saved as:
    # /home/user/hs_err_pid4448.log
    
    
  5. Find core dump (check or dumping to in message above)
  6. Compress it, preferably with 7-zip (works much better than zip on core dumps).
  7. Share the file with me.

@Kiiv
Copy link
Author

Kiiv commented Mar 21, 2023

Hi,

don't know if this is the same problem as usual but got this when it happend today :

t0062984@dune-pc-dev-92:~/Apps/eclipse-java$ ./eclipse 
com.google.gwt.eclipse.wtp.maven.GwtMavenComponentContributor.contribute(IMavenComponentBinder)
INFO: WtpMavenProjectConfigurator.getBuildParticipant invoked
INFO: WtpMavenProjectConfigurator.getBuildParticipant invoked
INFO: WtpMavenProjectConfigurator.getBuildParticipant invoked
mars 21, 2023 1:20:43 PM org.eclipse.tm4e.core.registry.Registry _doLoadSingleGrammar
AVERTISSEMENT: No grammar source for scope [source.java]
mars 21, 2023 1:20:43 PM org.eclipse.tm4e.core.internal.rule.RuleFactory _compilePatterns
AVERTISSEMENT: CANNOT find grammar for scopeName [source.java]. I am [source.xml]
mars 21, 2023 1:20:43 PM org.eclipse.tm4e.core.internal.rule.RuleFactory _compilePatterns
AVERTISSEMENT: REMOVING RULE ENTIRELY DUE TO EMPTY PATTERNS THAT ARE MISSING

(Eclipse:3633): Gtk-CRITICAL **: 13:21:45.240: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkScrollbar

***MEMORY-ERROR***: Eclipse[3633]: GSlice: assertion failed: sinfo->n_allocated > 0

No core dump written. But it's strange I don't have any hs_err_pid file either.

@Kiiv
Copy link
Author

Kiiv commented Mar 21, 2023

This one is referenced here :
https://bugs.eclipse.org/bugs/show_bug.cgi?id=538000
https://gitlab.gnome.org/GNOME/gtk/-/issues/210

But no one tell about a total crash of Eclipse.

@iloveeclipse
Copy link
Member

assertion 'size >= 0' failed in GtkScrollbar is irrelevant here, it spams Eclipse logs since ever without any crashes.

What crashes JVM is GSlice: assertion failed: sinfo->n_allocated > 0.

Similar crash was reported in other applications too, like

The last link gives some hints, feel free to try them out, I'm not familiar with this code & haven't seen such crashes yet.

@SyntevoAlex
Copy link
Member

Did you have any crashes (with hs_err_pid files) since you enabled -XX:+CreateCoredumpOnCrash ?

@Kiiv
Copy link
Author

Kiiv commented Apr 12, 2023

Hi !

got this one today :)
hs_err_pid127091_core_dump_enabled.log

Unfortunately I don't find any core dump at the specified location :s

@Kiiv
Copy link
Author

Kiiv commented Apr 14, 2023

Most of the time, it crashes whith only this message :
"MEMORY-ERROR: Eclipse[204252]: GSlice: assertion failed: sinfo->n_allocated > 0"

No pid log file or core dump...

@SyntevoAlex
Copy link
Member

It seems that something is corrupting memory in Eclipse, which manifests as various random crashes.

I guess we'll have to resort to memory verifier, now that attempts to catch a core dump didn't succeed.

Please do the following to build it:

  1. sudo apt install build-essential scons
  2. git clone https://github.com/SyntevoAlex/ElectricFence ~/Downloads/ElectricFence
  3. cd ~/Downloads/ElectricFence
  4. scons

Then, run Eclipse this way:

  1. sudo sysctl -w vm.max_map_count=1000000000
  2. G_SLICE=always-malloc EF_ALIGNMENT=16 EF_ALLOW_MALLOC_0=1 LD_PRELOAD=~/Downloads/ElectricFence/src/libefence.so ~/Downloads/eclipse/eclipse

If you do it correctly, you should see additional headers printed to console when running Eclipse.
Eclipse will be significantly slower (expect some 30 secs just to start it), but all memory access will be tested thoroughly.
Try using it for a couple minutes; I expect that it will crash and finally produce better crash logs pointing to the guilty code.

@Kiiv
Copy link
Author

Kiiv commented Apr 26, 2023

Ok I'll try that. Does this can expose sensitive data I'm working on or it will only record technical information ?

@SyntevoAlex
Copy link
Member

The core dump will contain everything that Eclipse had in memory, which could contain various sensitive information. The hs_err_pid.log file is much less likely to contain anything sensitive. I hope that the new hs_err_pid.log will be more useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Linux/GTK Happens on Linux Wayland
Projects
None yet
Development

No branches or pull requests

5 participants