|
Post by alexfish on Jul 6, 2023 19:09:18 GMT 1
Alternate work around for those inflicted with this bug
Style:: name the functions used . followed by the includes
eg:
INCLUDE "hug.bac", INIT, WINDOW, DISPLAY, HUGLIB$
gtk$ = HUGLIB$("gtk") PRINT gtk$ IMPORT "gtk_socket_new(void)" FROM gtk$ TYPE long IMPORT "gtk_socket_get_id(long)" FROM gtk$ TYPE long IMPORT "gtk_plug_new(long)" FROM gtk$ TYPE long '=========================================== gtk$ = HUGLIB$("gtk") PRINT gtk$ '=========================================== INIT
win = WINDOW("test hug",600,400) sock = gtk_socket_new() PRINT sock DISPLAY
BR Alex
|
|
|
Post by Pjot on Jul 7, 2023 8:22:22 GMT 1
Thanks Alex,
Believe it or not, but we're actually zooming into the problem.
I can see many things based on your output and I will provide a modified "bacon.sh" shortly, which you could use for the compile process.
Then, the debugging in the resulting binary should clarify further why the first lookup into the GTK library succeeds, and why the second lookup, which uses the exact same code, fails.
BR Peter
|
|
|
Post by Pjot on Jul 8, 2023 12:54:42 GMT 1
Hi Alex, I made some adjustments to the BaCon code (it was more easy than the script). It is available here. If you have time, can you compile this BaCon binary, and then use it to compile your test program? Please let me know the outcome when executing it. # wget http://www.basic-converter.org/debug/bacon.bac # bacon ./bacon # ./bacon debug # ./debug
Thanks, Peter
|
|
|
Post by alexfish on Jul 8, 2023 16:58:27 GMT 1
Hi Peter
had to change the version number to match
then
INCLUDE "hug.bac"
win = WINDOW("test",600,400)
DISPLAY
results are
pi@raspberrypi:~/bacontest $ ./testhug DEBUG1:0:50 ERROR DLOPEN:306:libgtkgl-2.0.so.0 ERROR DLOPEN:357:libgoocanvas.so.0 ERROR DLOPEN:357:libgoocanvas.so.1 ERROR DLOPEN:357:libgoocanvas.so.2 ERROR DLOPEN:357:libgoocanvas.so.3 ERROR DLOPEN:357:libgoocanvas.so.4 ERROR DLOPEN:357:libgoocanvas.so.5 ERROR DLOPEN:357:libgoocanvas.so.6 ERROR DLOPEN:357:libgoocanvas.so.7 ERROR DLOPEN:357:libgoocanvas.so.8 ERROR DLOPEN:357:libgoocanvas.so.9 ERROR DLOPEN:357:libgoocanvas.so.10 ERROR DLOPEN:357:libgoocanvas.so.11 ERROR DLOPEN:357:libgoocanvas.so.12 ERROR DLOPEN:357:libgoocanvas.so.13 ERROR DLOPEN:357:libgoocanvas.so.14 ERROR DLOPEN:357:libgoocanvas.so.15 ERROR DLOPEN:357:libgoocanvas.so.16 ERROR DLOPEN:357:libgoocanvas.so.17 ERROR DLOPEN:357:libgoocanvas.so.18 ERROR DLOPEN:357:libgoocanvas.so.19 ERROR DLOPEN:357:libgoocanvas.so.20 ERROR DLOPEN:357:libgoocanvas.so.21 ERROR DLOPEN:357:libgoocanvas.so.22 ERROR DLOPEN:357:libgoocanvas.so.23 ERROR DLOPEN:357:libgoocanvas.so.24 ERROR DLOPEN:357:libgoocanvas.so.25 ERROR DLOPEN:357:libgoocanvas.so.26 ERROR DLOPEN:357:libgoocanvas.so.27 ERROR DLOPEN:357:libgoocanvas.so.28 ERROR DLOPEN:357:libgoocanvas.so.29 ERROR DLOPEN:357:libgoocanvas.so.30 ERROR DLOPEN:357:libgoocanvas.so.31 ERROR DLOPEN:357:libgoocanvas.so.32 ERROR DLOPEN:357:libgoocanvas.so.33 ERROR DLOPEN:357:libgoocanvas.so.34 ERROR DLOPEN:357:libgoocanvas.so.35 ERROR DLOPEN:357:libgoocanvas.so.36 ERROR DLOPEN:357:libgoocanvas.so.37 ERROR DLOPEN:357:libgoocanvas.so.38 ERROR DLOPEN:357:libgoocanvas.so.39 ERROR DLOPEN:357:libgoocanvas.so.40 ERROR DLOPEN:357:libgoocanvas.so.41 ERROR DLOPEN:357:libgoocanvas.so.42 ERROR DLOPEN:357:libgoocanvas.so.43 ERROR DLOPEN:357:libgoocanvas.so.44 ERROR DLOPEN:357:libgoocanvas.so.45 ERROR DLOPEN:357:libgoocanvas.so.46 ERROR DLOPEN:357:libgoocanvas.so.47 ERROR DLOPEN:357:libgoocanvas.so.48 ERROR DLOPEN:357:libgoocanvas.so.49 ERROR DLOPEN:381:libGL.so.0 ^C
then
INCLUDE "hug.bac"
gtk$ = HUGLIB$("gtk") PRINT gtk$
win = WINDOW("test",600,400)
DISPLAY
results
DEBUG1:0:50 ERROR DLOPEN:306:libgtkgl-2.0.so.0 ERROR DLOPEN:357:libgoocanvas.so.0 ERROR DLOPEN:357:libgoocanvas.so.1 ERROR DLOPEN:357:libgoocanvas.so.2 ERROR DLOPEN:357:libgoocanvas.so.3 ERROR DLOPEN:357:libgoocanvas.so.4 ERROR DLOPEN:357:libgoocanvas.so.5 ERROR DLOPEN:357:libgoocanvas.so.6 ERROR DLOPEN:357:libgoocanvas.so.7 ERROR DLOPEN:357:libgoocanvas.so.8 ERROR DLOPEN:357:libgoocanvas.so.9 ERROR DLOPEN:357:libgoocanvas.so.10 ERROR DLOPEN:357:libgoocanvas.so.11 ERROR DLOPEN:357:libgoocanvas.so.12 ERROR DLOPEN:357:libgoocanvas.so.13 ERROR DLOPEN:357:libgoocanvas.so.14 ERROR DLOPEN:357:libgoocanvas.so.15 ERROR DLOPEN:357:libgoocanvas.so.16 ERROR DLOPEN:357:libgoocanvas.so.17 ERROR DLOPEN:357:libgoocanvas.so.18 ERROR DLOPEN:357:libgoocanvas.so.19 ERROR DLOPEN:357:libgoocanvas.so.20 ERROR DLOPEN:357:libgoocanvas.so.21 ERROR DLOPEN:357:libgoocanvas.so.22 ERROR DLOPEN:357:libgoocanvas.so.23 ERROR DLOPEN:357:libgoocanvas.so.24 ERROR DLOPEN:357:libgoocanvas.so.25 ERROR DLOPEN:357:libgoocanvas.so.26 ERROR DLOPEN:357:libgoocanvas.so.27 ERROR DLOPEN:357:libgoocanvas.so.28 ERROR DLOPEN:357:libgoocanvas.so.29 ERROR DLOPEN:357:libgoocanvas.so.30 ERROR DLOPEN:357:libgoocanvas.so.31 ERROR DLOPEN:357:libgoocanvas.so.32 ERROR DLOPEN:357:libgoocanvas.so.33 ERROR DLOPEN:357:libgoocanvas.so.34 ERROR DLOPEN:357:libgoocanvas.so.35 ERROR DLOPEN:357:libgoocanvas.so.36 ERROR DLOPEN:357:libgoocanvas.so.37 ERROR DLOPEN:357:libgoocanvas.so.38 ERROR DLOPEN:357:libgoocanvas.so.39 ERROR DLOPEN:357:libgoocanvas.so.40 ERROR DLOPEN:357:libgoocanvas.so.41 ERROR DLOPEN:357:libgoocanvas.so.42 ERROR DLOPEN:357:libgoocanvas.so.43 ERROR DLOPEN:357:libgoocanvas.so.44 ERROR DLOPEN:357:libgoocanvas.so.45 ERROR DLOPEN:357:libgoocanvas.so.46 ERROR DLOPEN:357:libgoocanvas.so.47 ERROR DLOPEN:357:libgoocanvas.so.48 ERROR DLOPEN:357:libgoocanvas.so.49 ERROR DLOPEN:381:libGL.so.0 DEBUG1:0:50 ERROR1 DLSYM:114:gtk_init DEBUG1:1:50 ERROR1 DLSYM:114:gtk_init DEBUG1:2:50 ERROR1 DLSYM:114:gtk_init DEBUG1:3:50 ERROR1 DLSYM:114:gtk_init DEBUG1:4:50 ERROR1 DLSYM:114:gtk_init DEBUG1:5:50 ERROR1 DLSYM:114:gtk_init DEBUG1:6:50 ERROR1 DLSYM:114:gtk_init DEBUG1:7:50 ERROR1 DLSYM:114:gtk_init DEBUG1:8:50 ERROR1 DLSYM:114:gtk_init DEBUG1:9:50 ERROR1 DLSYM:114:gtk_init DEBUG1:10:50 ERROR1 DLSYM:114:gtk_init DEBUG1:11:50 ERROR1 DLSYM:114:gtk_init DEBUG1:12:50 ERROR1 DLSYM:114:gtk_init DEBUG1:13:50 ERROR1 DLSYM:114:gtk_init DEBUG1:14:50 ERROR1 DLSYM:114:gtk_init DEBUG1:15:50 ERROR1 DLSYM:114:gtk_init DEBUG1:16:50 ERROR1 DLSYM:114:gtk_init DEBUG1:17:50 ERROR1 DLSYM:114:gtk_init DEBUG1:18:50 ERROR1 DLSYM:114:gtk_init DEBUG1:19:50 ERROR1 DLSYM:114:gtk_init DEBUG1:20:50 ERROR1 DLSYM:114:gtk_init DEBUG1:21:50 ERROR1 DLSYM:114:gtk_init DEBUG1:22:50 ERROR1 DLSYM:114:gtk_init DEBUG1:23:50 ERROR1 DLSYM:114:gtk_init DEBUG1:24:50 ERROR1 DLSYM:114:gtk_init DEBUG1:25:50 ERROR1 DLSYM:114:gtk_init DEBUG1:26:50 ERROR1 DLSYM:114:gtk_init DEBUG1:27:50 ERROR1 DLSYM:114:gtk_init DEBUG1:28:50 ERROR1 DLSYM:114:gtk_init DEBUG1:29:50 ERROR1 DLSYM:114:gtk_init DEBUG1:30:50 ERROR1 DLSYM:114:gtk_init DEBUG1:31:50 ERROR1 DLSYM:114:gtk_init DEBUG1:32:50 ERROR1 DLSYM:114:gtk_init DEBUG1:33:50 ERROR1 DLSYM:114:gtk_init DEBUG1:34:50 ERROR1 DLSYM:114:gtk_init DEBUG1:35:50 ERROR1 DLSYM:114:gtk_init DEBUG1:36:50 ERROR1 DLSYM:114:gtk_init DEBUG1:37:50 ERROR1 DLSYM:114:gtk_init DEBUG1:38:50 ERROR1 DLSYM:114:gtk_init DEBUG1:39:50 ERROR1 DLSYM:114:gtk_init DEBUG1:40:50 ERROR1 DLSYM:114:gtk_init DEBUG1:41:50 ERROR1 DLSYM:114:gtk_init DEBUG1:42:50 ERROR1 DLSYM:114:gtk_init DEBUG1:43:50 ERROR1 DLSYM:114:gtk_init DEBUG1:44:50 ERROR1 DLSYM:114:gtk_init DEBUG1:45:50 ERROR1 DLSYM:114:gtk_init DEBUG1:46:50 ERROR1 DLSYM:114:gtk_init DEBUG1:47:50 ERROR1 DLSYM:114:gtk_init DEBUG1:48:50 ERROR1 DLSYM:114:gtk_init DEBUG1:49:50 ERROR1 DLSYM:114:gtk_init DEBUG1:50:50 DEBUG3:libgtk-x11-2.0.so.49:50:50 Gtk library not found!
BR Alex
|
|
|
Post by Pjot on Jul 9, 2023 12:43:37 GMT 1
Thanks Alex, I now may have found the cause of the issue. Could you download this BETA version, compile it and then use it to compile your test program? It is my expectation that all should work fine on your system now. If so, I will improve the changes further and explain in more detail what is going on. Please let me know your outcome. # wget http://www.basic-converter.org/debug/bacon-beta.bac # bacon ./bacon-beta # ./bacon-beta debug # ./debug
Thanks, Peter
|
|
|
Post by alexfish on Jul 9, 2023 13:51:46 GMT 1
Hi Peter Looking Good pi@raspberrypi:~/beta $ bacon ./bacon-beta Converting './bacon-beta.bac'... done, 10508 lines were processed in 1.628 seconds. Creating lexical analyzer using flex... done. Compiling './bacon-beta.bac'... cc -c bacon-beta.bac.c cc -o bacon-beta bacon-beta.bac.o -lm Done, program 'bacon-beta' ready.
pi@raspberrypi:~/beta $ wget http://basic-converter.org/hug.bac --2023-07-09 13:21:58-- http://basic-converter.org/hug.bac Resolving basic-converter.org (basic-converter.org)... 83.96.176.80, 64:ff9b::5360:b050 Connecting to basic-converter.org (basic-converter.org)|83.96.176.80|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 104683 (102K) [text/plain] Saving to: ‘hug.bac’
hug.bac 100%[===================>] 102.23K --.-KB/s in 0.1s
2023-07-09 13:21:58 (1.04 MB/s) - ‘hug.bac’ saved [104683/104683]
pi@raspberrypi:~/beta $ ./bacon-beta testhug Converting 'testhug.bac'... done, 2986 lines were processed in 0.517 seconds. Creating lexical analyzer using flex... done. Compiling 'testhug.bac'... cc -c testhug.bac.c cc -o testhug testhug.bac.o -ldl -lm Done, program 'testhug' ready. obvious the simple bit of code that used to fail INCLUDE "hug.bac"
gtk$ = HUGLIB$("gtk") PRINT gtk$
win = WINDOW("test",600,400)
DISPLAY will now test rest of HUGLIB$() , and report back ASP. I say that since have installed i3 on another arm device + just done the install of BaCon 4.7 + first compile Now To test HUG Back soon Many Thanks + BR Alex Attachments:
|
|
|
Post by Pjot on Jul 9, 2023 18:16:37 GMT 1
Hi Alex, Great! Though I never could reproduce this problem myself, and neither observed this issue myself before on any other system, we seem to have stumbled into a very rare set of circumstances. In HUG, functions are imported from a library (either GTK, GDK, GooCanvas, etc). Normally, the required libraries for HUG all have a dependency to each other. So, when we import a GDK function, this could have been done by an IMPORT from the "libgtk-x11-2.0.so.0" as well, for example. The way IMPORT works is that it creates a handle for each individual library. However, in case of HUG, the library is kept in a variable name. That variable name has the same name for each of the SUB's in the HUG file. The handle is declared globally, and therefore, the handle to import a function from a library is always the same. If all libraries have a dependency to each other, this is not a problem. However, after your upgrade, for some reason, it seems that some of the GTK/GDK/etc libraries do not have such dependency anymore. At least, not all of them. This is a very rare situation and "should not happen" (famous words of a developer). But it did. The code has been changed to make sure that the handle is local to each SUB. It should fix this rare circumstance and should work for your system. You can obtain a full tarball of the latest beta here. Best regards Peter
|
|