← Back to team overview

kernel-packages team mailing list archive

[Bug 1407521] [NEW] C compiler bcc struct passing fails

 

Public bug reported:

C compiler bcc copies structs and returns structs correctly but fails to
pass them to functions. From checking it turns out that the generated
code calls _memcpy with the wrong parameters. For example, this is the
generated assembly which should pass a 6-byte struct to a function.

! Debug: list struct composite original = [S+$14-$C] (used reg = )
add     sp,*-6
mov     ax,sp     <--- presumably the target address
mov     ax,*6   <--- gets overwritten by the size of the struct
push    ax     <--- push the size of the struct
lea     bx,-$A[bp]
push    bx     <--- push the source address
push    ax     <--- should be the target address
call    _memcpy
add     sp,*6

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: bcc 0.16.17-3.1ubuntu3
ProcVersionSignature: Ubuntu 3.13.0-30.54-generic 3.13.11.2
Uname: Linux 3.13.0-30-generic i686
ApportVersion: 2.14.1-0ubuntu3.2
Architecture: i386
Date: Sun Jan  4 22:58:22 2015
ProcEnviron:
 SHELL=/bin/bash
 TERM=ansi
 PATH=(custom, user)
 LANG=en_GB.utf8
 XDG_RUNTIME_DIR=<set>
SourcePackage: linux86
UpgradeStatus: Upgraded to trusty on 2014-06-20 (198 days ago)

** Affects: linux86 (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: apport-bug i386 trusty

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux86 in Ubuntu.
https://bugs.launchpad.net/bugs/1407521

Title:
  C compiler bcc struct passing fails

Status in linux86 package in Ubuntu:
  New

Bug description:
  C compiler bcc copies structs and returns structs correctly but fails
  to pass them to functions. From checking it turns out that the
  generated code calls _memcpy with the wrong parameters. For example,
  this is the generated assembly which should pass a 6-byte struct to a
  function.

  ! Debug: list struct composite original = [S+$14-$C] (used reg = )
  add     sp,*-6
  mov     ax,sp     <--- presumably the target address
  mov     ax,*6   <--- gets overwritten by the size of the struct
  push    ax     <--- push the size of the struct
  lea     bx,-$A[bp]
  push    bx     <--- push the source address
  push    ax     <--- should be the target address
  call    _memcpy
  add     sp,*6

  ProblemType: Bug
  DistroRelease: Ubuntu 14.04
  Package: bcc 0.16.17-3.1ubuntu3
  ProcVersionSignature: Ubuntu 3.13.0-30.54-generic 3.13.11.2
  Uname: Linux 3.13.0-30-generic i686
  ApportVersion: 2.14.1-0ubuntu3.2
  Architecture: i386
  Date: Sun Jan  4 22:58:22 2015
  ProcEnviron:
   SHELL=/bin/bash
   TERM=ansi
   PATH=(custom, user)
   LANG=en_GB.utf8
   XDG_RUNTIME_DIR=<set>
  SourcePackage: linux86
  UpgradeStatus: Upgraded to trusty on 2014-06-20 (198 days ago)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux86/+bug/1407521/+subscriptions


Follow ups

References