Hi,
I'm trying to compile the opgui 12.0 on a Linux xubuntu 22.04. Unfortunately, the build process generates a lot of warning and the final bin opgui falls in segmentation fault when running
The CLI OP build compiles well on its side
sample of the compilation warnings:
......
opgui.c:1598:17: warning: format not a string literal and no format arguments [-Wformat-security]
1598 | if(saveLog&&logfile) fprintf(logfile,strings[S_comTimeout]);
| ^~
opgui.c: In function ‘main’:
opgui.c:1778:17: warning: format not a string literal and no format arguments [-Wformat-security]
1778 | printf(strings[I_GUI_CMD_HELP]);
| ^~~~~~
opgui.c:1802:17: warning: format not a string literal and no format arguments [-Wformat-security]
1802 | else printf(strings[S_noprog]);
| ^~~~
opgui.c: In function ‘DisplayEE’:
opgui.c:1272:42: warning: ‘%s’ directive writing up to 255 bytes into a region of size between 246 and 250 [-Wformat-overflow=]
1272 | sprintf(t,"%04X: %s %s\r\n",i,s,v);
| ^~ ~
In file included from /usr/include/stdio.h:894,
from /usr/include/pango-1.0/pango/pango-utils.h:25,
from /usr/include/pango-1.0/pango/pango.h:51,
from /usr/include/gtk-3.0/gdk/gdktypes.h:35,
from /usr/include/gtk-3.0/gdk/gdkapplaunchcontext.h:30,
from /usr/include/gtk-3.0/gdk/gdk.h:32,
from /usr/include/gtk-3.0/gtk/gtk.h:30,
from common.h:30,
from opgui.c:24:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:38:10: note: ‘__builtinsprintfchk’ output between 10 and 524 bytes into a destination of size 256
38 | return builtinsprintfchk (s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
39 | __glibc_objsize (__s), __fmt,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
40 | __va_arg_pack ());
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Can you check the gtk3 version?
3.12 or later is required
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2023-01-11
yes here it is
libgtk-3-bin 3.24.33-1ubuntu2 amd64 programs for the GTK graphical user interface library
ii libgtk-3-common 3.24.33-1ubuntu2 all common files for the GTK graphical user interface library
ii libgtk-3-dev:amd64 3.24.33-1ubuntu2 amd64 development files for the GTK library
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2023-01-20
hi,
the problem is in the deviceRW.c
remove tabulators from beginning of the 345, 386 and 405 rows..
the 'nameToGroup' function returns with -1 if it found these tabs -> groupNames array does not have -1. member (opgui.c 807.row)
regards,
Attila
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Nice catch! I'm still not sure why it gives problems only in some environments.
Anyways, can you try with the original deviceRW.c and the following replacement for line 798 of opgui.c:
for(tok=strtok(devices,",\t");tok;tok=strtok(NULL,",\t")) {
It should ignore tab charachters now.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2023-01-21
hi,
yes, this is a possible solution (if you will not put any other wild characters into string ;-) ).
by the way, I think it is not an environment dependent issue, you can reconstruct it: Device -> Filter by type -> *
regards,
Attila
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2023-01-21
but I think it's better way to handle the error
insert this into opgui.c between 801 and 802 row:
if (info.group == -1) continue;
and there is a debug row in deviceRw.c at row 1104, remove the comment and change 'Debug1' to 'PrintMessage1', so it will seen the problem in the canvas if there is any.
regards,
Attila
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2023-01-21
... and put the info.group search and error handling before the info.device memory allocation....
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I'm trying to compile the opgui 12.0 on a Linux xubuntu 22.04. Unfortunately, the build process generates a lot of warning and the final bin opgui falls in segmentation fault when running
The CLI OP build compiles well on its side
xubuntu: 22.04
gcc 11.3.0
package libgtk-3.0 installed (bin, common, dev, perl)
sample of the compilation warnings:
......
opgui.c:1598:17: warning: format not a string literal and no format arguments [-Wformat-security]
1598 | if(saveLog&&logfile) fprintf(logfile,strings[S_comTimeout]);
| ^~
opgui.c: In function ‘main’:
opgui.c:1778:17: warning: format not a string literal and no format arguments [-Wformat-security]
1778 | printf(strings[I_GUI_CMD_HELP]);
| ^~~~~~
opgui.c:1802:17: warning: format not a string literal and no format arguments [-Wformat-security]
1802 | else printf(strings[S_noprog]);
| ^~~~
opgui.c: In function ‘DisplayEE’:
opgui.c:1272:42: warning: ‘%s’ directive writing up to 255 bytes into a region of size between 246 and 250 [-Wformat-overflow=]
1272 | sprintf(t,"%04X: %s %s\r\n",i,s,v);
| ^~ ~
In file included from /usr/include/stdio.h:894,
from /usr/include/pango-1.0/pango/pango-utils.h:25,
from /usr/include/pango-1.0/pango/pango.h:51,
from /usr/include/gtk-3.0/gdk/gdktypes.h:35,
from /usr/include/gtk-3.0/gdk/gdkapplaunchcontext.h:30,
from /usr/include/gtk-3.0/gdk/gdk.h:32,
from /usr/include/gtk-3.0/gtk/gtk.h:30,
from common.h:30,
from opgui.c:24:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:38:10: note: ‘__builtinsprintfchk’ output between 10 and 524 bytes into a destination of size 256
38 | return builtinsprintfchk (s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
39 | __glibc_objsize (__s), __fmt,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
40 | __va_arg_pack ());
Let me try to reproduce the problem
I don't see any problem.
My system is Mint 19.2 gcc 7.5.0
Same warnings but the executable runs fine.
Ok thanks for your feedback
Does running as super user make any difference?
(Not that it should be required, just as a trial)
Same sentence
user or sudo
make clean
make
./opgui
Segmentation fault (core dumped)
It must be noted that it run under ubuntu 18.04 still with warning but without the core dumped.
Can you check the gtk3 version?
3.12 or later is required
yes here it is
libgtk-3-bin 3.24.33-1ubuntu2 amd64 programs for the GTK graphical user interface library
ii libgtk-3-common 3.24.33-1ubuntu2 all common files for the GTK graphical user interface library
ii libgtk-3-dev:amd64 3.24.33-1ubuntu2 amd64 development files for the GTK library
hi,
the problem is in the deviceRW.c
remove tabulators from beginning of the 345, 386 and 405 rows..
the 'nameToGroup' function returns with -1 if it found these tabs -> groupNames array does not have -1. member (opgui.c 807.row)
regards,
Attila
Nice catch! I'm still not sure why it gives problems only in some environments.
Anyways, can you try with the original deviceRW.c and the following replacement for line 798 of opgui.c:
for(tok=strtok(devices,",\t");tok;tok=strtok(NULL,",\t")) {
It should ignore tab charachters now.
hi,
yes, this is a possible solution (if you will not put any other wild characters into string ;-) ).
by the way, I think it is not an environment dependent issue, you can reconstruct it: Device -> Filter by type -> * regards,
Attila
but I think it's better way to handle the error
insert this into opgui.c between 801 and 802 row:
if (info.group == -1) continue;
and there is a debug row in deviceRw.c at row 1104, remove the comment and change 'Debug1' to 'PrintMessage1', so it will seen the problem in the canvas if there is any.
regards,
Attila
... and put the info.group search and error handling before the info.device memory allocation....
I will add all the above into version 0.12.1
I'm glad I could help
Attila
Thanks a lot, could run now