1. Fatal error when attempting to execute bear.ex from the EuGtk package

I have downloaded and installed EuGtk 4.15.2 and was attempting to run bear.ex and encountered a number of problems. I solved some of them with changes to the EuGtk code but one is a show stopper and I would appreciate some help with this matter.
The first error I encountered was 'ifconfig' not being found. It was installed on my Debian testing/bullseye system but Debian (and maybe other Linux distributions) place it in /sbin and this is not in the path for a normal user. However you can run it if you prefix it with the path, so I changed GtkEngine.e, line 356, to

system(sprintf("/sbin/ifconfig > %s",{ipfile})) 
The second error I encountered was that PANGO_WEIGHT_NORMAL considered to be not defined in GtkFontSelector.e. I looked at the code at line 177 and noted that GtkEnums.e has a namespace declaration so I prefixed PANGO_WEIGHT_NORMAL with this and the problem went away. Hence I changed GtkFontSelector.e, line 177, to
weight = enums:PANGO_WEIGHT_NORMAL, 
The third error I encountered was with the libwebkit2gtk shared object file. As I am running testing Debian, my shared object version for this file is more recent than the code is testing for, so I changed GtkWebKit.plugin, line 30, to
dir("/usr/lib/x86_64-linux-gnu/libwebkit2gtk-4*") & 
However, after these changes, I still cannot get bear.ex to run. When I run it, the following is printed on the terminal window:
/opt/languages/euphoria/gtk/current/GtkEngine.e:1569 in function deallocate_string_pointer_array()  
A machine-level exception occurred during execution of this statement (signal 11)  
 
... called from /opt/languages/euphoria/gtk/current/GtkEngine.e:919 in function get()   
 
... called from /opt/languages/euphoria/gtk/current/bear/bear_prefs.e:12  
 
--> See ex.err  
 
Warning { not_used }: 
    <0231>:: /opt/languages/euphoria/gtk/current/GtkEngine.e - private variable 'name' of load_builder() is not used 
Warning { not_used }: 
    <0231>:: /opt/languages/euphoria/gtk/current/GtkEngine.e - private variable 'path' of load_builder() is not used 
Warning { resolution }: 
    /opt/languages/euphoria/gtk/current/bear/bear_functions.e:102 - identifier 'clipboard' in '/opt/languages/euphoria/gtk/current/bear/bear.ex' is not included 
Warning { resolution }: 
    /opt/languages/euphoria/gtk/current/bear/bear_help_index.e:9 - identifier 'eu_help_path' in '/opt/languages/euphoria/gtk/current/bear/bear.ex' is not included 
Warning { resolution }: 
    /opt/languages/euphoria/gtk/current/bear/bear_help.e:99 - identifier 'OpenWebPage' in '/opt/languages/euphoria/gtk/current/bear/bear_functions.e' is not included 
Warning { resolution }: 
    /opt/languages/euphoria/gtk/current/bear/bear_help.e:82 - identifier 'eu_help_path' in '/opt/languages/euphoria/gtk/current/bear/bear.ex' is not included 
Warning { resolution }: 
    /opt/languages/euphoria/gtk/current/bear/bear_recent.e:63 - identifier 'Open' in '/opt/languages/euphoria/gtk/current/bear/bear_functions.e' is not included 
Warning { resolution }: 
    /opt/languages/euphoria/gtk/current/GtkEnums.e:22 - identifier 'register' in '/opt/languages/euphoria/gtk/current/GtkEngine.e' is not included 
Warning { resolution }: 
    /opt/languages/euphoria/gtk/current/bear/bear_functions.e:1304 - identifier 'update_buttons' in '/opt/languages/euphoria/gtk/current/bear/bear_buttons.e' is not included 
Warning { resolution }: 
    /opt/languages/euphoria/gtk/current/bear/bear_buttons.e:1304 - identifier 'source_buffer' in '/opt/languages/euphoria/gtk/current/bear/bear.ex' is not included 
Warning { resolution }: 
    /opt/languages/euphoria/gtk/current/bear/bear_prefs.e:1304 - identifier 'settings' in '/opt/languages/euphoria/gtk/current/bear/bear.ex' is not included 

My kernel is 5.2.9, gtk version is 3.24.10 and gcc version is 9.2.1. I do have the ex.err file but as it was so large I did not want to include it here and did not know how to provide it to the forum.
I note that signal 11 is a SEGV. My eu.cfg file has the paths set correctly so I do not know how to progress this matter further. Any help would be much appreciated.

new topic     » topic index » view message » categorize

2. Re: Fatal error when attempting to execute bear.ex from the EuGtk package

srb623 said...

I do have the ex.err file but as it was so large I did not want to include it here and did not know how to provide it to the forum.

There is a link on the right for Pastey. This is a place to dump large blobs of text to share with the forum.

-Greg

new topic     » goto parent     » topic index » view message » categorize

3. Re: Fatal error when attempting to execute bear.ex from the EuGtk package

Thanks! It's rare that anyone takes the trouble to report things like this.

As for posting the ex.err - it's rarely needed or helpful. the line:
... called from /opt/languages/euphoria/gtk/current/bear/bear_prefs.e:12

tells us what's wrong and where (but not how to fix it).

It would appear that EuGTK is unable to create a SourceStyleSchemeManager, or perhaps there are no style schemes found. Replace the code with the following, and see what happens:

constant style_scheme_mgr = create(GtkSourceStyleSchemeManager,"name=StyleMan")  
sequence style_scheme_ids = "" 
if style_scheme_mgr > 0 then -- avoid a crash if null. 
   style_scheme_ids = get(style_scheme_mgr,"scheme ids") 
end if 
object style_scheme 

If you do this, bear should run, and if you see no options in Preferences/Syntax Styles, then perhaps no gedit syntax styles were installed, See the demos/resources/gedit_syntax folder for these, and installation instructions.

Several different editors use these styles, but there are two different places they are installed:
For gedit, pluma, and similar editors which use GTK2, they are in /usr/share/gtksourceview-2.0...

Whereas for other editors, such as Xed, the Gtk3 Sourceview (used by the Bear), etc. they are in /usr/share/gtksourceview-3.0...

If the latter doesn't exist, then you could try to set it up manually, or just install xed or one of the other GTK3 based text editors, which will do the required setup for you.

Of course, it's possible that Debian puts the above styles in some other place. EuGTK doesn't link to them, all that is done by libgtksourceview, so theoretically it should know where to find them.

Hopefully that helps. I appreciate the assistance with the other items, and will try to find a more generic way to locate ifconfig, etc. I'm counting on ifconfig being available on all Linux platforms, but is that a safe assumption?

new topic     » goto parent     » topic index » view message » categorize

4. Re: Fatal error when attempting to execute bear.ex from the EuGtk package

Irv,
Thanks for your prompt reply and advice regarding how to fix bear. I commented out the old code and added the new code above it and it still fails with the following error:

/opt/languages/euphoria/gtk/current/GtkEngine.e:1569 in function deallocate_string_pointer_array()  
A machine-level exception occurred during execution of this statement (signal 11)  
 
... called from /opt/languages/euphoria/gtk/current/GtkEngine.e:919 in function get()   
 
... called from /opt/languages/euphoria/gtk/current/bear/bear_prefs.e:14  
Line 14 in bear_prefs.e is now
   style_scheme_ids = get(style_scheme_mgr,"scheme ids")   
and for some reason it is still failing. I did check for style files etc in /usr/share/gtksourceview-3.0/styles and there were some there but I did follow your setup instructions and added some more in case bear was looking for something specific.
Just a bit of (friendly) advice re your setup instructions:

  • where you are setting file modes for the euphoria.lang file, you do not want a non privileged user to be able to edit or delete the file which is possible with such a broad file mode as 777 (gives rwx for user, group and other). Personally, I'd set it to 644 (rw, r, r - for user, group and other), as all other files in this directory have that permission. So change,

sudo chmod 777 /usr/share/gtksourceview-2.0/language-specs/euphoria.lang 
sudo chmod 777 /usr/share/gtksourceview-3.0/language-specs/euphoria.lang 
to
sudo chmod 644 /usr/share/gtksourceview-2.0/language-specs/euphoria.lang 
sudo chmod 644 /usr/share/gtksourceview-3.0/language-specs/euphoria.lang 

  • I also noted that you were copying all of the .xml files to /usr/share/gtksourceview-2.0/styles/ and /usr/share/gtksourceview-3.0/styles/ with a simple copy. While this will work, it does not allow for the fact that the distribution's package manager may have some of these files already and they may be newer than the version that you are copying. So you need to advise the user of this, or do the following:

for f in *.xml 
do 
   if [ ! -f /usr/share/gtksourceview-2.0/styles/$f ] 
   then 
      cp $f /usr/share/gtksourceview-2.0/styles 
   fi 
   if [ ! -f /usr/share/gtksourceview-3.0/styles/$f ] 
   then 
      cp $f /usr/share/gtksourceview-3.0/styles 
   fi 
done 
What it does is iterate over all .xml files and for each file, f, checks to see if the file does not exist in the directory, and if so we can safely copy it, otherwise it is ignored and the distribution version will be used.
I hope that I have not caused offence my suggesting such changes to your code/setup. Hoping that you can provide further suggestions re fixing the problem and allowing me to run bear.

new topic     » goto parent     » topic index » view message » categorize

5. Re: Fatal error when attempting to execute bear.ex from the EuGtk package

Well it seems that create(GtkSourceStyleSchemeManager is returning something other than a pointer to a style_scheme_mgr or a null. Take a look at it with ? style_scheme_mgr and see what it is returning.

? style_scheme_mgr 
style_scheme_ids = get(style_scheme_mgr,"scheme ids")  

I appreciate the advice on setting up the xml files, and anything else you can suggest.

One thing, the documentation probably won't work, since this seems to have been installed in a directory other than your home directory per instructions. If you can suggest an improvement there, so it can work from wherever it is installed, I would be happy to implement it.

Now, I will go download and install a copy of Debian testing to see what results I get.

EDIT: Debian testing failed to install. No reason given. We'll have to track down the problem some other way.

new topic     » goto parent     » topic index » view message » categorize

6. Re: Fatal error when attempting to execute bear.ex from the EuGtk package

Output the variable as suggested and it printed a large number which I assumed to be a memory address/pointer so that looked good as per your explanations. So I decided to ensure that my copy of Euphoria was installed correctly (the 4.1.0 beta version as advised) and so removed the directory completely and set it up again. Re-ran bear.ex and for reasons I cannot work out it now works and I have a running copy of bear ! Maybe I had an error in a configuration file. Anyway all solved. Sorry if I wasted any of your time.
With regards to your question re ifconfig, I think you'd be safe in assuming all Linux distributions have it. The location of the file may differ though as standardisation of directories is not perfect. From memory I'm sure I have some C++ lying around that splits an environment variable on the path separator and for each path in the list looks to see if the specified file is there and if so returns it. I'll hunt for it this afternoon and see if I can make it more generic and when happy with the C++ I'll have a go at converting it to Euphoria. If all goes well I'll post it here and if you like it you can use it in GtkEngine.e
Also with respect to the documentation, you are correct in that it does not work properly. On Linux the user would not download the documentation and unpack it to /gtk3 as the gtk3 documentation is contained within a package that would be installed via the package manager. Under Debian it is /usr/share/gtk-doc/html. Will try to find some time to look at that and see if there is a generic way of solving the problem.

new topic     » goto parent     » topic index » view message » categorize

7. Re: Fatal error when attempting to execute bear.ex from the EuGtk package

Great! Glad to hear that you got it running.

Any time you want to make suggestions please feel free.

As for the documentation, I probably should just package it separately, so people can put it wherever they wish. But currently, the docs have links to various demo programs, so that if you're viewing the docs with the Bear, you can load and execute the program directly from the links. Getting that to work when things are moved or installed in unknown locations is likely to be difficult.

Now, a question about Debian - twice I have tried to install, it goes through all the steps, then presents a message: Unable to complete installation.

I can look at the partition where it was installed, and the files are there. Debian offered to save an installation log in /mnt, but there are no files in /mnt. Don't know where to go from here.

Edit: I looked at the /usr/share/gtk-doc/html folder in Debian. While it does contain some documentation on clutter-gtk, gtksourceview, the glade user interface, etc. nowhere there are the actual GTK3 docs that you need for programming in GTK3. Possibly because the installation never finished?

At any rate, distros such as Mint Linux don't have that folder, and I've not found the docs anywhere else after some searching. Seems best to have the latest docs anyway, since they may contain bug reports and corrections to documentation that were only discovered *after* people started using the release.

new topic     » goto parent     » topic index » view message » categorize

8. Re: Fatal error when attempting to execute bear.ex from the EuGtk package

I had a go at writing a Euphoria function to search path variables for a specified filename with the idea being that it could be used to locate ifconfig more generically rather than hard coding /sbin or whatever in your code. Have given it some testing and it looks OK to me but I will let you be the final judge of that. The code is as follows:

-- 
-- Next we need to declare the include files that we require. 
-- 
include std/filesys.e 
include std/sequence.e 
 
-- 
-- Function to return the fully qualified name of the file if the filename FILENAME can 
-- be found in any of the paths listed in the variable PATH or the additional paths to 
-- search EXTRA_PATHS.  The paths in EXTRA_PATHS will be searched before those 
-- in PATH.  If the filename FILENAME cannot be found then an empty string will be 
-- returned. 
-- 
function find_in_path(sequence filename, sequence path, sequence extra_paths = "") 
    sequence path_filename 
    sequence path_list 
     
    sequence path_list1 
    sequence path_list2 
     
    -- 
    -- FIrst we must ensure that the filename FILENAME contains some data and if not we 
    -- return the empty string to the caller. 
    -- 
    if length(filename) = 0 then 
        return "" 
    end if 
     
    -- 
    -- Next we must check to see if the filename FILENAME is a fully qualified name 
    -- and if so we must exit with the current name as it will not be located in any 
    -- of the paths. 
    -- 
    if filename[1] = filesys:SLASH then 
        return filename 
    end if 
     
    -- 
    -- Next we must split the path variable PATH on the path separator and create 
    -- a sequence of strings of the results. 
    -- 
    path_list1 = stdseq:split_any(path, filesys:PATHSEP, , 1) 
     
    -- 
    -- Next we must split the additional paths EXTRA_PATHS on the path separator 
    -- and create a sequence of strings of the results. 
    -- 
    path_list2 = stdseq:split_any(extra_paths, filesys:PATHSEP, , 1) 
     
    -- 
    -- Next we must create the combined list of the two path variables.  As we 
    -- wish to search the extra paths first it must come first in the below. 
    -- 
    path_list  = path_list2 & path_list1 
 
    -- 
    -- Now we need to loop for all paths in the above list and for each of them 
    -- we create a filename and then check for its existence.  If it does then we 
    -- return 'true' to the caller. 
    -- 
    for ix = 1 to length(path_list) do 
        -- 
        -- Now we need to form the fully qualified name of the file given the IX'th 
        -- path entry, the file system separator and the name of the file passed to 
        -- this routine for checking. 
        -- 
        path_filename = path_list[ix] & filesys:SLASH & filename 
         
        -- 
        -- Now we need to check to see if the above exists and if so we return 
        -- the fully qualified name of the file to the caller. 
        -- 
        if filesys:file_exists(path_filename) then 
            return path_filename 
        end if 
    end for 
     
    -- 
    -- Finally, if we reach this point, then the file was not found in any of the 
    -- paths specified, and thus we return an empty string so that the caller 
    -- can determine that the file was not located. 
    return "" 
end function 
 
 
printf(1, "%s\n", { find_in_path("ldconfig", getenv("PATH"), "/sbin:/usr/sbin") } ) 
printf(1, "%s\n", { find_in_path("ls", getenv("PATH")) } ) 
printf(1, "%s\n", { find_in_path("xxx", getenv("PATH")) } ) 
 

On my Debian system, the first prints /sbin/ldconfig, the second /bin/ls and the third an empty string as it is (correctly) not located. Hope this can be of some help to you.

new topic     » goto parent     » topic index » view message » categorize

9. Re: Fatal error when attempting to execute bear.ex from the EuGtk package

Just had a look at my /usr/share/gtk-doc/html directory and it contains the following

drwxr-xr-x 2 root root  12K Sep  7 15:19 gdk3/ 
drwxr-xr-x 2 root root  28K Sep  7 15:19 gtk3/ 
in addition to 80+ other directories that would be other documentation that was installed. To install the GTK/GDK documentation, on Debian, you need to install the libgtk-3-doc package and it will fetch other dependent packages and install other related documentation to the above directory. With regards to bear, it might be an option to create a symbolic link (ie ln -s) between the Debian installed directory and /gtk3 - will look into that at some stage.
With respect to your install problem for Debian, are you using the 'netinst' installer or did you download the entire dvd ? Personally when I've used the 'netinst' installer I've not had any problems and I've installed Debian a number of times over the years. The 'netinst' installer fetches the required packages from the debian mirror that you select (a list is provided based on your country code). One other thing that may be causing you problems is how you have partitioned your hard drive. Did you do the 'simple' install of just one partition for everything - or did you do the separate partitions for /home, /usr etc ? If the latter, maybe you have made one of the partitions to small and Debian is aborting due to insufficient room to write the files. The other bit of advice I can offer is to avoid LVM like the plague.

new topic     » goto parent     » topic index » view message » categorize

10. Re: Fatal error when attempting to execute bear.ex from the EuGtk package

Hi, and thanks.

Yes, I installed from dvd, and hopefully the single partition was not too small (254 gig).

It may be that my internet connection is not exactly the best (slow and drops occasionally).

That said, I'll work on other things for now, and try Debian later.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu