Project

General

Profile

Actions

Bug #13570

closed

libpkg: overflow in conversion

Added by Toomas Soome over 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
lib - userland libraries
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

Build error with gcc 10:

    ../common/gpkgmap.c: In function 'gpkgmap':
    ../common/gpkgmap.c:156:42: error: overflow in conversion from 'fsblkcnt_t' {aka 'long long unsigned int'} to 'time_t' {aka 'long int'} changes value from 'ept->cinfo.size = 18446744073709551615' to '-1' [-Werror=overflow]
      156 |  ept->cinfo.cksum = ept->cinfo.modtime = ept->cinfo.size = (-1);
          |                                          ^~~
    cc1: all warnings being treated as errors
    *** Error code 1
    dmake: Fatal error: Command failed for target `pics/gpkgmap.o'
    Current working directory /code/illumos-gate/usr/src/lib/libpkg/i386

Initialize one variable at a time.

Testing done: build/install/boot

wsdiff is reporting local variable address differences only:

/code/13570/usr/src/lib/libpkg/i386/pics/gpkgmap.o
NOTE: ELF .text difference detected.

1027c1027
<     gpkgmap+0x9e:        c7 86 e4 00 00 00  movl   $-0x1,0xe4(%esi)   <0xffffffff>
---
>     gpkgmap+0x9e:        c7 86 e0 00 00 00  movl   $-0x1,0xe0(%esi)   <0xffffffff>
1029c1029
<     gpkgmap+0xa8:        c7 86 e8 00 00 00  movl   $-0x1,0xe8(%esi)   <0xffffffff>
---
>     gpkgmap+0xa8:        c7 86 ec 00 00 00  movl   $-0x1,0xec(%esi)   <0xffffffff>
1031c1031
<     gpkgmap+0xb2:        c7 86 ec 00 00 00  movl   $-0x1,0xec(%esi)   <0xffffffff>
---
>     gpkgmap+0xb2:        c7 86 e4 00 00 00  movl   $-0x1,0xe4(%esi)   <0xffffffff>
1033c1033
<     gpkgmap+0xbc:        c7 86 e0 00 00 00  movl   $-0x1,0xe0(%esi)   <0xffffffff>
---
>     gpkgmap+0xbc:        c7 86 e8 00 00 00  movl   $-0x1,0xe8(%esi)   <0xffffffff>

Actions #1

Updated by Electric Monk over 1 year ago

  • Gerrit CR set to 1276
Actions #2

Updated by Toomas Soome about 1 year ago

  • Description updated (diff)
Actions #3

Updated by Electric Monk about 1 year ago

  • Status changed from In Progress to Closed
  • % Done changed from 90 to 100

git commit 4f35a7b5b2167eb724fee72b2b0eb60b40909598

commit  4f35a7b5b2167eb724fee72b2b0eb60b40909598
Author: Toomas Soome <tsoome@me.com>
Date:   2021-05-18T14:56:39.000Z

    13570 libpkg: overflow in conversion
    Reviewed by: Andy Fiddaman <andy@omnios.org>
    Reviewed by: Peter Tribble <peter.tribble@gmail.com>
    Approved by: Dan McDonald <danmcd@joyent.com>

Actions

Also available in: Atom PDF