After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 771298 - giscanner/scannerparser.y: potentially negates G_MININT64 which cannot be represented
giscanner/scannerparser.y: potentially negates G_MININT64 which cannot be rep...
Status: RESOLVED OBSOLETE
Product: gobject-introspection
Classification: Platform
Component: g-ir-scanner
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2016-09-12 13:36 UTC by Tobias Mueller
Modified: 2018-02-08 12:43 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Tobias Mueller 2016-09-12 13:36:22 UTC
When applying the following patch

--- a/giscanner/scannerparser.y
+++ b/giscanner/scannerparser.y
@@ -453,6 +453,11 @@ unary_expression
                        break;
                case UNARY_MINUS:
                        $$ = gi_source_symbol_copy ($2);
+                       if ($2->const_int == G_MININT64) {
+                           printf ("Error in line number %d: Cannote negate %ld\n",
+                                   lineno, $2->const_int);
+                           exit (1);
+                       }
                        $$->const_int = -$2->const_int;
                        break;
                case UNARY_BITWISE_COMPLEMENT:


I cannot "make" anymore:

/bin/bash ./libtool  --tag=CC   --mode=link gcc -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -fsanitize=address -fsanitize=undefined -O0 -g3 -fno-common   -o libgiscanner.la  libgiscanner_la-sourcescanner.lo libgiscanner_la-scannerlexer.lo libgiscanner_la-scannerparser.lo -lgobject-2.0 -lglib-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -ldl 
libtool: link: rm -fr  .libs/libgiscanner.a .libs/libgiscanner.la
libtool: link: ar cru .libs/libgiscanner.a .libs/libgiscanner_la-sourcescanner.o .libs/libgiscanner_la-scannerlexer.o .libs/libgiscanner_la-scannerparser.o 
ar: `u' modifier ignored since `D' is the default (see `U')
libtool: link: ranlib .libs/libgiscanner.a
libtool: link: ( cd ".libs" && rm -f "libgiscanner.la" && ln -s "../libgiscanner.la" "libgiscanner.la" )
/bin/bash ./libtool  --tag=CC   --mode=link gcc -I/usr/include/python2.7 -I/usr/include/x86_64-linux-gnu/python2.7 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I./giscanner -fsanitize=address -fsanitize=undefined -O0 -g3 -fno-common -module -avoid-version -export-symbols-regex "init_giscanner|PyInit__giscanner"   -o _giscanner.la -rpath /var/tmp/evo/lib/gobject-introspection/giscanner _giscanner_la-giscannermodule.lo libgiscanner.la -lgobject-2.0 -lglib-2.0  -ldl 
libtool: link: rm -fr  .libs/_giscanner.a .libs/_giscanner.exp .libs/_giscanner.la .libs/_giscanner.lai .libs/_giscanner.so .libs/_giscanner.ver
libtool: link: /usr/bin/nm -B  .libs/_giscanner_la-giscannermodule.o   ./.libs/libgiscanner.a | sed -n -e 's/^.*[	 ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[	 ][	 ]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p' | sed '/ __gnu_lto/d' | /bin/sed 's/.* //' | sort | uniq > .libs/_giscanner.exp
libtool: link: /bin/grep -E -e "init_giscanner|PyInit__giscanner" ".libs/_giscanner.exp" > ".libs/_giscanner.expT"
libtool: link: mv -f ".libs/_giscanner.expT" ".libs/_giscanner.exp"
libtool: link: echo "{ global:" > .libs/_giscanner.ver
libtool: link:  cat .libs/_giscanner.exp | sed -e "s/\(.*\)/\1;/" >> .libs/_giscanner.ver
libtool: link:  echo "local: *; };" >> .libs/_giscanner.ver
libtool: link:  gcc -shared  -fPIC -DPIC  .libs/_giscanner_la-giscannermodule.o  -Wl,--whole-archive ./.libs/libgiscanner.a -Wl,--no-whole-archive  -lgio-2.0 -lgobject-2.0 -lglib-2.0 -ldl  -fsanitize=address -fsanitize=undefined -O0 -g3   -pthread -Wl,-soname -Wl,_giscanner.so -Wl,-version-script -Wl,.libs/_giscanner.ver -o .libs/_giscanner.so
libtool: link: (cd .libs/_giscanner.lax/libgiscanner.a && ar x "/home/muelli/vcs/gobject-introspection/./.libs/libgiscanner.a")
libtool: link: ar cru .libs/_giscanner.a  _giscanner_la-giscannermodule.o  .libs/_giscanner.lax/libgiscanner.a/libgiscanner_la-scannerlexer.o .libs/_giscanner.lax/libgiscanner.a/libgiscanner_la-scannerparser.o .libs/_giscanner.lax/libgiscanner.a/libgiscanner_la-sourcescanner.o 
ar: `u' modifier ignored since `D' is the default (see `U')
libtool: link: ranlib .libs/_giscanner.a
libtool: link: rm -fr .libs/_giscanner.lax
libtool: link: ( cd ".libs" && rm -f "_giscanner.la" && ln -s "../_giscanner.la" "_giscanner.la" )
sed -e s,@libdir\@,/var/tmp/evo/lib, -e s,@datarootdir\@,/var/tmp/evo/share, -e s,@PYTHON\@,/usr/bin/python, -e s,@TOOL_MODULE\@,scannermain, -e s,@TOOL_FUNCTION\@,scanner_main, tools/g-ir-tool-template.in > g-ir-scanner.tmp && mv g-ir-scanner.tmp g-ir-scanner
sed -e s,@libdir\@,/var/tmp/evo/lib, -e s,@datarootdir\@,/var/tmp/evo/share, -e s,@PYTHON\@,/usr/bin/python, -e s,@TOOL_MODULE\@,annotationmain, -e s,@TOOL_FUNCTION\@,annotation_main, tools/g-ir-tool-template.in > g-ir-annotation-tool.tmp && mv g-ir-annotation-tool.tmp g-ir-annotation-tool
sed -e s,@libdir\@,/var/tmp/evo/lib, -e s,@datarootdir\@,/var/tmp/evo/share, -e s,@PYTHON\@,/usr/bin/python, -e s,@TOOL_MODULE\@,docmain, -e s,@TOOL_FUNCTION\@,doc_main, tools/g-ir-tool-template.in > g-ir-doc-tool.tmp && mv g-ir-doc-tool.tmp g-ir-doc-tool
CPPFLAGS="" CFLAGS="-fsanitize=address -fsanitize=undefined -O0 -g3 -fno-common" LDFLAGS="" CC="gcc" PKG_CONFIG="/usr/bin/pkg-config" DLLTOOL="false"  env PATH=".libs:/home/muelli/.local/bin/:~/.local/bin:OME/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/muelli/perl5/bin/" LPATH=.libs CC="gcc" PYTHONPATH=.:. UNINSTALLED_INTROSPECTION_SRCDIR=. UNINSTALLED_INTROSPECTION_BUILDDIR=. ./g-ir-scanner  --verbose -I. --add-include-path=. --add-include-path=./gir --add-include-path=. --add-include-path=. --add-include-path=./gir --namespace=GLib --nsversion=2.0 --libtool="/bin/bash ./libtool" --pkg=glib-2.0    --library=glib-2.0 --library=gobject-2.0 --external-library --reparse-validate --identifier-prefix=G --symbol-prefix=g --symbol-prefix=glib --c-include="glib.h"  --cflags-begin -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -DGETTEXT_PACKAGE=Dummy -DGLIB_COMPILATION -D__G_I18N_LIB_H__ --cflags-end  /usr/lib/x86_64-linux-gnu/glib-2.0/include/glibconfig.h /usr/include/glib-2.0/glib/giochannel.h /usr/include/glib-2.0/glib/gprintf.h /usr/include/glib-2.0/glib/gversion.h /usr/include/glib-2.0/glib/genviron.h /usr/include/glib-2.0/glib/gstrfuncs.h /usr/include/glib-2.0/glib/gvariant.h /usr/include/glib-2.0/glib/garray.h /usr/include/glib-2.0/glib/gdatetime.h /usr/include/glib-2.0/glib/gmappedfile.h /usr/include/glib-2.0/glib/gtrashstack.h /usr/include/glib-2.0/glib/gtestutils.h /usr/include/glib-2.0/glib/gi18n-lib.h /usr/include/glib-2.0/glib/gurifuncs.h /usr/include/glib-2.0/glib/gsequence.h /usr/include/glib-2.0/glib/gnode.h /usr/include/glib-2.0/glib/gprimes.h /usr/include/glib-2.0/glib/gstringchunk.h /usr/include/glib-2.0/glib/gstring.h /usr/include/glib-2.0/glib/gscanner.h /usr/include/glib-2.0/glib/gdataset.h /usr/include/glib-2.0/glib/gpoll.h /usr/include/glib-2.0/glib/gmacros.h /usr/include/glib-2.0/glib/ghostutils.h /usr/include/glib-2.0/glib/gbase64.h /usr/include/glib-2.0/glib/ghmac.h /usr/include/glib-2.0/glib/grand.h /usr/include/glib-2.0/glib/gquark.h /usr/include/glib-2.0/glib/ggettext.h /usr/include/glib-2.0/glib/gmain.h /usr/include/glib-2.0/glib/ghash.h /usr/include/glib-2.0/glib/gbytes.h /usr/include/glib-2.0/glib/gmessages.h /usr/include/glib-2.0/glib/gi18n.h /usr/include/glib-2.0/glib/gtimezone.h /usr/include/glib-2.0/glib/glist.h /usr/include/glib-2.0/glib/gutils.h /usr/include/glib-2.0/glib/gcharset.h /usr/include/glib-2.0/glib/glib-autocleanups.h /usr/include/glib-2.0/glib/gkeyfile.h /usr/include/glib-2.0/glib/gdate.h /usr/include/glib-2.0/glib/galloca.h /usr/include/glib-2.0/glib/gwin32.h /usr/include/glib-2.0/glib/gqueue.h /usr/include/glib-2.0/glib/gregex.h /usr/include/glib-2.0/glib/gbitlock.h /usr/include/glib-2.0/glib/gbookmarkfile.h /usr/include/glib-2.0/glib/gshell.h /usr/include/glib-2.0/glib/ghook.h /usr/include/glib-2.0/glib/gbacktrace.h /usr/include/glib-2.0/glib/gmarkup.h /usr/include/glib-2.0/glib/gqsort.h /usr/include/glib-2.0/glib/gslist.h /usr/include/glib-2.0/glib/gconvert.h /usr/include/glib-2.0/glib/gpattern.h /usr/include/glib-2.0/glib/gthread.h /usr/include/glib-2.0/glib/gstdio.h /usr/include/glib-2.0/glib/gatomic.h /usr/include/glib-2.0/glib/gtimer.h /usr/include/glib-2.0/glib/gunicode.h /usr/include/glib-2.0/glib/gmem.h /usr/include/glib-2.0/glib/gslice.h /usr/include/glib-2.0/glib/goption.h /usr/include/glib-2.0/glib/gvarianttype.h /usr/include/glib-2.0/glib/gchecksum.h /usr/include/glib-2.0/glib/gtree.h /usr/include/glib-2.0/glib/gerror.h /usr/include/glib-2.0/glib/gdir.h /usr/include/glib-2.0/glib/gtypes.h /usr/include/glib-2.0/glib/gfileutils.h /usr/include/glib-2.0/glib/gthreadpool.h /usr/include/glib-2.0/glib/gasyncqueue.h /usr/include/glib-2.0/glib/gspawn.h /usr/include/glib-2.0/glib/gversionmacros.h /usr/include/glib-2.0/gobject/glib-types.h gir/glib-2.0.c /usr/include/glib-2.0/glib-unix.h g-ir-scanner g-ir-compiler --output GLib-2.0.gir
/usr/include/glib-2.0/glib/glib-autocleanups.h:41: syntax error, unexpected typedef-name, expecting identifier or '(' in 'typedef GAsyncQueue *GAsyncQueue_autoptr;' at 'GAsyncQueue_autoptr'
/usr/include/glib-2.0/glib/glib-autocleanups.h:42: syntax error, unexpected typedef-name, expecting identifier or '(' in 'typedef GBookmarkFile *GBookmarkFile_autoptr;' at 'GBookmarkFile_autoptr'
/usr/include/glib-2.0/glib/glib-autocleanups.h:43: syntax error, unexpected typedef-name, expecting identifier or '(' in 'typedef GBytes *GBytes_autoptr;' at 'GBytes_autoptr'
/usr/include/glib-2.0/glib/glib-autocleanups.h:44: syntax error, unexpected typedef-name, expecting identifier or '(' in 'typedef GChecksum *GChecksum_autoptr;' at 'GChecksum_autoptr'
/usr/include/glib-2.0/glib/glib-autocleanups.h:45: syntax error, unexpected typedef-name, expecting identifier or '(' in 'typedef GDateTime *GDateTime_autoptr;' at 'GDateTime_autoptr'
/usr/include/glib-2.0/glib/glib-autocleanups.h:46: syntax error, unexpected typedef-name, expecting identifier or '(' in 'typedef GDir *GDir_autoptr;' at 'GDir_autoptr'
/usr/include/glib-2.0/glib/glib-autocleanups.h:47: syntax error, unexpected typedef-name, expecting identifier or '(' in 'typedef GError *GError_autoptr;' at 'GError_autoptr'
/usr/include/glib-2.0/glib/glib-autocleanups.h:48: syntax error, unexpected typedef-name, expecting identifier or '(' in 'typedef GHashTable *GHashTable_autoptr;' at 'GHashTable_autoptr'
/usr/include/glib-2.0/glib/glib-autocleanups.h:49: syntax error, unexpected typedef-name, expecting identifier or '(' in 'typedef GHmac *GHmac_autoptr;' at 'GHmac_autoptr'
/usr/include/glib-2.0/glib/glib-autocleanups.h:50: syntax error, unexpected typedef-name, expecting identifier or '(' in 'typedef GIOChannel *GIOChannel_autoptr;' at 'GIOChannel_autoptr'
/usr/include/glib-2.0/glib/glib-autocleanups.h:51: syntax error, unexpected typedef-name, expecting identifier or '(' in 'typedef GKeyFile *GKeyFile_autoptr;' at 'GKeyFile_autoptr'
/usr/include/glib-2.0/glib/glib-autocleanups.h:52: syntax error, unexpected typedef-name, expecting identifier or '(' in 'typedef GList *GList_autoptr;' at 'GList_autoptr'
/usr/include/glib-2.0/glib/glib-autocleanups.h:53: syntax error, unexpected typedef-name, expecting identifier or '(' in 'typedef GArray *GArray_autoptr;' at 'GArray_autoptr'
/usr/include/glib-2.0/glib/glib-autocleanups.h:54: syntax error, unexpected typedef-name, expecting identifier or '(' in 'typedef GPtrArray *GPtrArray_autoptr;' at 'GPtrArray_autoptr'
/usr/include/glib-2.0/glib/glib-autocleanups.h:55: syntax error, unexpected typedef-name, expecting identifier or '(' in 'typedef GByteArray *GByteArray_autoptr;' at 'GByteArray_autoptr'
/usr/include/glib-2.0/glib/glib-autocleanups.h:56: syntax error, unexpected typedef-name, expecting identifier or '(' in 'typedef GMainContext *GMainContext_autoptr;' at 'GMainContext_autoptr'
/usr/include/glib-2.0/glib/glib-autocleanups.h:57: syntax error, unexpected typedef-name, expecting identifier or '(' in 'typedef GMainLoop *GMainLoop_autoptr;' at 'GMainLoop_autoptr'
/usr/include/glib-2.0/glib/glib-autocleanups.h:58: syntax error, unexpected typedef-name, expecting identifier or '(' in 'typedef GSource *GSource_autoptr;' at 'GSource_autoptr'
/usr/include/glib-2.0/glib/glib-autocleanups.h:59: syntax error, unexpected typedef-name, expecting identifier or '(' in 'typedef GMappedFile *GMappedFile_autoptr;' at 'GMappedFile_autoptr'
/usr/include/glib-2.0/glib/glib-autocleanups.h:60: syntax error, unexpected typedef-name, expecting identifier or '(' in 'typedef GMarkupParseContext *GMarkupParseContext_autoptr;' at 'GMarkupParseContext_autoptr'
/usr/include/glib-2.0/glib/glib-autocleanups.h:61: syntax error, unexpected typedef-name, expecting identifier or '(' in 'typedef GNode *GNode_autoptr;' at 'GNode_autoptr'
/usr/include/glib-2.0/glib/glib-autocleanups.h:62: syntax error, unexpected typedef-name, expecting identifier or '(' in 'typedef GOptionContext *GOptionContext_autoptr;' at 'GOptionContext_autoptr'
/usr/include/glib-2.0/glib/glib-autocleanups.h:63: syntax error, unexpected typedef-name, expecting identifier or '(' in 'typedef GOptionGroup *GOptionGroup_autoptr;' at 'GOptionGroup_autoptr'
/usr/include/glib-2.0/glib/glib-autocleanups.h:64: syntax error, unexpected typedef-name, expecting identifier or '(' in 'typedef GPatternSpec *GPatternSpec_autoptr;' at 'GPatternSpec_autoptr'
/usr/include/glib-2.0/glib/glib-autocleanups.h:65: syntax error, unexpected typedef-name, expecting identifier or '(' in 'typedef GQueue *GQueue_autoptr;' at 'GQueue_autoptr'
/usr/include/glib-2.0/glib/glib-autocleanups.h:67: syntax error, unexpected typedef-name, expecting identifier or '(' in 'typedef GRand *GRand_autoptr;' at 'GRand_autoptr'
/usr/include/glib-2.0/glib/glib-autocleanups.h:68: syntax error, unexpected typedef-name, expecting identifier or '(' in 'typedef GRegex *GRegex_autoptr;' at 'GRegex_autoptr'
/usr/include/glib-2.0/glib/glib-autocleanups.h:69: syntax error, unexpected typedef-name, expecting identifier or '(' in 'typedef GMatchInfo *GMatchInfo_autoptr;' at 'GMatchInfo_autoptr'
/usr/include/glib-2.0/glib/glib-autocleanups.h:70: syntax error, unexpected typedef-name, expecting identifier or '(' in 'typedef GScanner *GScanner_autoptr;' at 'GScanner_autoptr'
/usr/include/glib-2.0/glib/glib-autocleanups.h:71: syntax error, unexpected typedef-name, expecting identifier or '(' in 'typedef GSequence *GSequence_autoptr;' at 'GSequence_autoptr'
/usr/include/glib-2.0/glib/glib-autocleanups.h:72: syntax error, unexpected typedef-name, expecting identifier or '(' in 'typedef GSList *GSList_autoptr;' at 'GSList_autoptr'
/usr/include/glib-2.0/glib/glib-autocleanups.h:73: syntax error, unexpected typedef-name, expecting identifier or '(' in 'typedef GString *GString_autoptr;' at 'GString_autoptr'
/usr/include/glib-2.0/glib/glib-autocleanups.h:74: syntax error, unexpected typedef-name, expecting identifier or '(' in 'typedef GStringChunk *GStringChunk_autoptr;' at 'GStringChunk_autoptr'
/usr/include/glib-2.0/glib/glib-autocleanups.h:75: syntax error, unexpected typedef-name, expecting identifier or '(' in 'typedef GThread *GThread_autoptr;' at 'GThread_autoptr'
/usr/include/glib-2.0/glib/glib-autocleanups.h:77: syntax error, unexpected typedef-name, expecting identifier or '(' in 'typedef GMutexLocker *GMutexLocker_autoptr;' at 'GMutexLocker_autoptr'
/usr/include/glib-2.0/glib/glib-autocleanups.h:79: syntax error, unexpected typedef-name, expecting identifier or '(' in 'typedef GTimer *GTimer_autoptr;' at 'GTimer_autoptr'
/usr/include/glib-2.0/glib/glib-autocleanups.h:80: syntax error, unexpected typedef-name, expecting identifier or '(' in 'typedef GTimeZone *GTimeZone_autoptr;' at 'GTimeZone_autoptr'
/usr/include/glib-2.0/glib/glib-autocleanups.h:81: syntax error, unexpected typedef-name, expecting identifier or '(' in 'typedef GTree *GTree_autoptr;' at 'GTree_autoptr'
/usr/include/glib-2.0/glib/glib-autocleanups.h:82: syntax error, unexpected typedef-name, expecting identifier or '(' in 'typedef GVariant *GVariant_autoptr;' at 'GVariant_autoptr'
/usr/include/glib-2.0/glib/glib-autocleanups.h:83: syntax error, unexpected typedef-name, expecting identifier or '(' in 'typedef GVariantBuilder *GVariantBuilder_autoptr;' at 'GVariantBuilder_autoptr'
/usr/include/glib-2.0/glib/glib-autocleanups.h:85: syntax error, unexpected typedef-name, expecting identifier or '(' in 'typedef GVariantIter *GVariantIter_autoptr;' at 'GVariantIter_autoptr'
/usr/include/glib-2.0/glib/glib-autocleanups.h:86: syntax error, unexpected typedef-name, expecting identifier or '(' in 'typedef GVariantDict *GVariantDict_autoptr;' at 'GVariantDict_autoptr'
/usr/include/glib-2.0/glib/glib-autocleanups.h:88: syntax error, unexpected typedef-name, expecting identifier or '(' in 'typedef GVariantType *GVariantType_autoptr;' at 'GVariantType_autoptr'
Error in line number 73: Cannote negate -9223372036854775808
Makefile:3488: recipe for target 'GLib-2.0.gir' failed
make[2]: *** [GLib-2.0.gir] Error 1
make[2]: Leaving directory '/home/muelli/vcs/gobject-introspection'
Makefile:2778: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/muelli/vcs/gobject-introspection'
Makefile:1557: recipe for target 'all' failed
make: *** [all] Error 2




We see:

Error in line number 73: Cannote negate -9223372036854775808
Makefile:3488: recipe for target 'GLib-2.0.gir' failed
make[2]: *** [GLib-2.0.gir] Error 1

Negating -9223372036854775808 would give 9223372036854775808 which is too big for a signed int64.

I couldn't find out where this value is coming from.

I don't really understand what the parser is supposed to be doing, but I guess that it should check if the value cannot be negated.
I also think that the GLib thing should scan without it complaining too much.
Comment 1 GNOME Infrastructure Team 2018-02-08 12:43:02 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gobject-introspection/issues/163.