Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

Fix CEF 2171 build on Linux #499

Closed
wants to merge 15 commits into from
Closed

Conversation

jasonsanjose
Copy link
Member

Replaces #489.

Manually merge changes to cefclient sample app into our linux implementation.

@@ -16,7 +16,13 @@

#include <algorithm>


#if defined(OS_LINUX)
// The Linux client uses GTK instead of the underlying platform type (X11).
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change to define ClientWindowHandle to be GtkWidget* is pulled straight from the cefclient sample app from CEF https://code.google.com/p/chromiumembedded/source/browse/branches/2171/cef3/tests/cefclient/client_handler.h#19.

@ingorichter
Copy link
Contributor

I build this branch and it looks partly good, although better than before.

  • 👍 Terminating Brackets via the File->Quit works fine
  • 👎 closing the Brackets window results in a crash ([0128/225630:FATAL:cef_ref_counted.h(339)] Assert failed: ptr_ != __null.)

I have tested this on Ubuntu 14.10 32 Bit

@nethip
Copy link
Contributor

nethip commented Jan 29, 2015

@ingorichter yeah we ran into this too, while we were doing some unit testing. I am on it. I kind of figured out the problem. I will push more changes to this branch with my changes which should solve the problem.

@nethip
Copy link
Contributor

nethip commented Jan 29, 2015

@ingorichter @jasonsanjose I fixed this problem partially but this bug has lot of side effects(Especially when dealing with multiple Brackets windows). This does not seem to be an easy fix. Like @jasonsanjose said, the latest version of cefclient is a lot different than our appshell. I think the right fix is to pick the latest linux counter parts of cefclient and then integrate our appshell changes into it. This definently is a big task. However I will see if we can fix this so that the side effects are minimal. In whatever case, I will update this thread with my findings and hopefully some solution.

@nethip
Copy link
Contributor

nethip commented Jan 30, 2015

@ingorichter @jasonsanjose I have managed to fix this problem. My latest commit to this branch has the solution for crash on quit. Could you guys pull down the latest changes and do some testing around this.

@jasonsanjose
Copy link
Member Author

Closing via the window X button works great now, but I see a hang when quitting via File > Quit now where it was previously working fine. Almost there though!

@nethip
Copy link
Contributor

nethip commented Jan 30, 2015

@jasonsanjose That's strange. I am not able to reproduce this crash. In fact the new commit was to fix both the crashes. I don't know if I missed something in my commit.

If you are still able to crash Brackets with my new commit, I am going to have to power up my Linux system again to double check this. Bad thing I will have to wait until Monday as the Linux system is in the office. 😞

@nethip
Copy link
Contributor

nethip commented Feb 3, 2015

@jasonsanjose @ingorichter at last I managed to repro the issue. The crash is evident only on VM. I am using VMWare Fusion. Weird thing that I observed is that, this crash is reproducible when the VM image's no of processors setting is set to 1. If I change it to 2, I am not able to repro the crash. Also I found another defect while doing code review, the fix for which I have already pushed in, though this does not fix the bug with crash/hang, when VM image's no of processors setting is set to 1.

Since the the hang is happening with VM, should we go ahead and merge this branch into master?

@jasonsanjose
Copy link
Member Author

Ok with me.

Has anyone else tested these changes to make sure mac and windows still build without any new issues? It's worth sanity checking since we did change some cross-platform code here as well as the gyp files (though that's mostly isolated to the linux setup).

@jasonsanjose
Copy link
Member Author

I tried building this branch on mac and it fails. I must have broken something in the gyp build. I'll take a look.

$ grunt build
Running "build" task

Running "build-mac" task
>> ** BUILD FAILED **
>> 
>> 
>> The following build commands failed:
>>  CompileC xcodebuild/appshell.build/Release/appshell_helper_app.build/Objects-normal/i386/appshell_extensions.o appshell/appshell_extensions.cpp normal i386 c++ com.apple.compilers.llvm.clang.1_0.compiler
>> (1 failure)
Warning: Task "build-mac" failed. Use --force to continue.

Aborted due to warnings.

@nethip
Copy link
Contributor

nethip commented Feb 6, 2015

@jasonsanjose I figured this out too. This was because we have added an AfterClose() OVERRIDE in client_handler.h and this is only overridden for the Linux platform. We could take the OVERRIDE out and subsitute it with empty method/call the base class version, so the clients interested in can override this. Even better, take this off, as this method is not getting called on Linux platform(in which case we will have to remove the definition in client_handler_gtk.cpp).

@lrebrown
Copy link

I've just tried a new 1.2 preview (v1.2.0-15668 master 027de3046) in a Debian sid VM. Initially all was well, except it not remembering window size/position upon reopening. However now it's crashing on close, though only with the 'x' button it seems (which worked initially). File > quit continues to work fine.

In system manager I can see four brackets processes:

  • 'brackets'
  • 'brackets-node'
  • 'brackets --type=zygote --no-sandbox --lang=en-US --log-severity=disable'
  • 'brackets --type=renderer --no-sandbox --enable-deferred-image-decoding --lang=en-US --lang=en-US --log-severity=disable --enable-delegated-renderer --enable-impl-side-painting --num-raster-threads=1 --disable-accelerated-video-decode --channel=31900.1.2105914780'

When the problem occurs, the last of these disappears, the other three remain.

The repeated lang param is not a typo btw ;)

I'm running this VM in virtualbox, and I'm using gnome. The VM has 1 CPU core.

@Romane-T
Copy link

Good morning

See also thread adobe/brackets#10255 re: libcrypt version breaks Brackets

As per posting in that thread from Jason, installed and tested build at https://github.com/adobe/brackets/releases/download/linux-cef-2171/Brackets.Release.1.2.64-bit.deb. For the very first time since have been using Brackets, it closes cleanly on the first click on the 'x'. Closing via 'File->Quit' still closing cleanly as before.

Debian Jessie with KDE as desktop environment.

With greetings

Romane

@coelho-extremosistemas
Copy link

Hi all
I was testing this request, but I found errors when running the brackets-shell.
Use fedora-20 x64.
The title page of this fixed "Brackets"
and after I maximixar the window, you can not write on inputs

@ficristo
Copy link
Collaborator

I tryed in my Ubuntu VM and found that the close button works if I have the 3D acceleration enabled, otherwise it hangs the window.
When I hit File \ Close I always get a segfault. I tryed to debug with gdb but in the end I gave up...

@nethip What I can try to fix this?

@nethip
Copy link
Contributor

nethip commented May 25, 2016

@ficristo Are you talking about the crash happening on linux-1547?

@ficristo
Copy link
Collaborator

I was talking about this PR and the issues about the crash on exit.
Maybe I misunderstood the issues?

Is linux-1547 crashing? I thought this PR was crashing...

@nethip
Copy link
Contributor

nethip commented May 25, 2016

@ficristo Nope linux-1547 is stable 😄

It is this PR that is crashing. And about the fix, I think we need to study cefclient and migrate new changes to our appshell. You could download cefclient from https://cefbuilds.com.

@ficristo
Copy link
Collaborator

Ah, ok!

@pratts
Copy link

pratts commented Jul 3, 2016

Hello,

I tried to build this branch and create installer using 'grunt installer'. When I try to install the .deb file, I get the error
prateek@prateek-debian:~/work/open-source/brackets-shell$ sudo dpkg -i installer/linux/Brackets\ Release\ 1.2\ 64-bit.deb
(Reading database ... 189544 files and directories currently installed.)
Preparing to unpack .../Brackets Release 1.2 64-bit.deb ...
Unpacking brackets (1.8.0-16890) over (1.8.0-16890) ...
dpkg: dependency problems prevent configuration of brackets:
brackets depends on libgcrypt11 (>= 1.4.5); however:
Package libgcrypt11 is not installed.

dpkg: error processing package brackets (--install):
dependency problems - leaving unconfigured
Processing triggers for menu (2.1.47) ...
Processing triggers for hicolor-icon-theme (0.13-1) ...
Errors were encountered while processing:
brackets

Then I tried the solution provided in comment adobe/brackets#10255 (comment) and I modified the control file and included libgcrypt20 and run 'grunt installer' again. This time the .deb file installation was successful.

When I try to run brackets by typing the command 'brackets' in terminal, I get the error:
prateek@prateek-debian:~/work/open-source/brackets-shell$ brackets
[0703/121909:ERROR:browser_main_loop.cc(163)] Running without the SUID sandbox! See https://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment for more information on developing with the sandbox on.
[0703/121909:ERROR:renderer_main.cc(207)] Running without renderer sandbox
ATTENTION: default value of option force_s3tc_enable overridden by environment.
[0703/121909:ERROR:nss_util.cc(819)] After loading Root Certs, loaded==false: NSS error code: -8018
The quitting brackets using close button works fine but when I close brackets using file->quit or Ctrl+Q, the error 'Segmentation fault' appears on terminal.

OS : Debian 8.5

@pratts
Copy link

pratts commented Jul 3, 2016

Also when I try to run the file Brackets in out/Release folder and provide the path to index.html in brackets repository, nothing happens. I get the error :
prateek@prateek-debian:~/work/open-source/brackets-shell$ out/Release/./Brackets
[0703/122914:ERROR:browser_main_loop.cc(163)] Running without the SUID sandbox! See https://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment for more information on developing with the sandbox on.
ATTENTION: default value of option force_s3tc_enable overridden by environment.
[0703/122914:ERROR:nss_util.cc(819)] After loading Root Certs, loaded==false: NSS error code: -8018

Even pressing Ctrl+C on the terminal window does nothing. I have to kill the processes in another window/tab.

@ficristo
Copy link
Collaborator

Superceded by #619

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants