pcb

Unit tests fail on i386

Bug #1814547 reported by Chad Parker
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pcb
Fix Released
High
Chad Parker

Bug Description

Unit-tests fail on i386 platforms.

The following warning is issued multiple times:

../../src/object_list.c:566:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
   g_assert_cmpint ((gint64) p, ==, 0);
                    ^
/usr/include/glib-2.0/glib/gtestutils.h:49:61: note: in definition of macro 'g_assert_cmpint'
                                              gint64 __n1 = (n1), __n2 = (n2); \
                                                             ^~

The test failure is here:

ERROR:../../src/object_list.c:472:object_list_test: assertion failed (compare_somestructs(&c, object_list_get_item(list, 1)) == 0): (1 == 0)
/bin/bash: line 5: 31409 Aborted ${dir}$tst
FAIL: unittest

This failure could result in DRC segmentation faults when running the DRC.

Changed in pcb:
status: New → In Progress
assignee: nobody → Chad Parker (parker-charles)
milestone: none → pcb-4.2.1
importance: Undecided → High
Revision history for this message
Bert Timmerman (bert-timmerman) wrote :
Download full text (6.9 KiB)

Hi Charles,

I read through the build spew and came across:

<snippet>

gcc -DLOCALEDIR=\"/usr/share/locale\" -DHAVE_CONFIG_H -I. -I../../src -I.. -I../.. -I../../src/../gts -Wdate-time -D_FORTIFY_SOURCE=2 -I/usr/include/dbus-1.0 -I/usr/lib/i386-linux-gnu/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/glib-2.0/include -pthread -I/usr/include/gtk-2.0 -I/usr/lib/i386-linux-gnu/gtk-2.0/include -I/usr/include/gio-unix-2.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/fribidi -I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16 -pthread -I/usr/include/gtkglext-1.0 -I/usr/lib/i386-linux-gnu/gtkglext-1.0/include -I/usr/include/gtk-2.0 -I/usr/lib/i386-linux-gnu/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/gtk-2.0 -I/usr/lib/i386-linux-gnu/gtk-2.0/include -I/usr/include/gio-unix-2.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/fribidi -I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16 -pthread -pthread -DPREFIXDIR=\"/usr\" -DBINDIR=\"/usr/bin\" -DHOST=\"i686-pc-linux-gnu\" -DPCBLIBDIR=\"/usr/share/pcb\" -DPCBTREEDIR=\"/usr/share/pcb/newlib\" -DPCBTREEPATH=\"/usr/share/pcb/newlib:/usr/share/pcb/pcblib-newlib\" -DNDEBUG -g -O2 -fdebug-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -ffloat-store -Wall -Wdeclaration-after-statement -MT pcb-move.o -MD -MP -MF .deps/pcb-move.Tpo -c -o pcb-move.o `test -f 'move.c' || echo '../../src/'`move.c
../../src/misc.c: In function 'ParseRouteString':
../../src/misc.c:1081:29: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'int' [-Wformat=]
   fprintf(stderr, "parsed %ld characters.\n", s - orig_s);
                           ~~^ ~~~~~~~~~~
                           %d
../../src/misc.c:1085:48: warning: format '%ld' expects argument of type 'long int', but argument 4 has type 'Coord' {aka 'long long int'} [-Wformat=]
   for (n=0; n < 5; n++) fprintf(stderr, "%d: %ld ", n, *style_items[n]);
                                              ~~^ ~~~~~~~~~~~~~~~
                                              %lld
../../src/misc.c: In function 'GetInfoString':
../../src/misc.c:2646:21: warning: macro "__DATE__" might prevent reproducible builds [-Wdate-time]
      "Compiled on " __DATE__ " at " __TIME__ "\n\n"
                     ^~~~~~~~
../../src/misc.c:2646:37: warning: macro "__TIME__" might prevent reproducible builds [-Wdate-time]
      "Compiled on " __DATE__ " at " __TIME__ "\n\n"
                                     ^~~~~~~~
mv -f .deps/pcb-main.Tpo .deps/pcb-main....

Read more...

Revision history for this message
Bert Timmerman (bert-timmerman) wrote :

home/bert/LP1814547_review

Revision history for this message
Chad Parker (parker-charles) wrote :

We may need to be careful here. Do we know for sure that a Coord has a consistent type alias across platforms?

Revision history for this message
Chad Parker (parker-charles) wrote :

OK, I've determined that this test failure is not going to hurt anything in this version of pcb. There isn't any code that calls the affected function. Therefore we do not need to do a quick release to fix the original issue.

I've built Bert's review branch that addresses the warnings, and I think it's fine. So, we can go ahead and merge that branch.

Revision history for this message
Bert Timmerman (bert-timmerman) wrote :

Merged into master and pushed upstream.

Changed in pcb:
status: In Progress → Fix Committed
Changed in pcb:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.