Source: aribas
Version: 1.64-6
Severity: serious
Tags: patch upstream

Dear maintainer,

The aribas autopkgtests fails when run on an i386 system with glibc 2.33
installed. Here is the relevant part of the tests: 

| Preparing to unpack .../aribas_1.64-6_i386.deb ...
| Unpacking aribas (1.64-6) ...
| Setting up aribas (1.64-6) ...
| Setting up autopkgtest-satdep (0) ...
| (Reading database ... 13148 files and directories currently installed.)
| Removing autopkgtest-satdep (0) ...
| autopkgtest [21:14:39]: test upstream: [-----------------------
| *** stack smashing detected ***: terminated
| Aborted
| autopkgtest [21:14:40]: test upstream: -----------------------]
| autopkgtest [21:14:40]: test upstream:  - - - - - - - - - - results - -
| - - - - - - - -
| upstream             FAIL non-zero exit status 1
| autopkgtest [21:14:40]: test upstream:  - - - - - - - - - - stderr - - -
| - - - - - - -
| *** stack smashing detected ***: terminated
| Aborted
| autopkgtest [21:14:40]: @@@@@@@@@@@@@@@@@@@@ summary
| upstream             FAIL non-zero exit status 1

The full autopkgtest log is available there:
https://ci.debian.net/data/autopkgtest/testing/i386/a/aribas/17524130/log.gz

After investigation it appears that aribas contains i386 assembly code
which doesn't follow the calling convention with regard to the direction
flag. The divarr and modarr function modifies it to the "backward"
direction with the STD instruction, but fails to modify it back to the
"forward" direction upon exit as required in the System V ABI [1]:

| EFLAGS  
|
| The flags register contains the system flags, such as the direction
| flag and the carry flag. The direction flag must be set to the
| "forward" (that is, zero) direction before entry and upon exit from
| a function. Other user flags have no specified role in the standard
| calling sequence and are not preserved.

The patch below fixes that, and is enough to get the autopkgtest
working.

Regards,
Aurelien


[1] http://www.sco.com/developers/devspecs/abi386-4.pdf


--- aribas-1.64.orig/src/LINUX/arito386.S
+++ aribas-1.64/src/LINUX/arito386.S
@@ -211,6 +211,7 @@ divarr:
        popl    %edi
        popl    %ebx
        popl    %ebp
+       cld
        ret
 
 /*---------------------------------------------------------*/
@@ -266,5 +267,6 @@ mod4arr:
        popl    %esi
        popl    %ebx
        popl    %ebp
+       cld
        ret
 /*---------------------------------------------------------*/

Reply via email to