Acknowledgement sent
to Petr Vandrovec <[email protected]>:
New Bug report received and forwarded. Copy sent to Anibal Monsalve Salazar <[email protected]>.
(Sat, 07 Jul 2018 06:27:04 GMT) (full text, mbox, link).
Subject: nasm does not handle rdf2 output correctly due to incorrect use of
pure_func
Date: Fri, 6 Jul 2018 23:08:12 -0700
Package: nasm
Version: 2.13.03-1
Hi,
when I tried to switch to new nasm for one of our projects,
nasm started panicking;
nasm: panic: rdf segment numbers not allocated as expected (0,0,0)
nasm code in question calls seg_alloc 3 times:
segtext = seg_alloc();
segdata = seg_alloc();
segbss = seg_alloc();
if (segtext != 0 || segdata != 2 || segbss != 4)
nasm_panic(0,
"rdf segment numbers not allocated as expected (%d,%d,%d)",
segtext, segdata, segbss);
and seg_alloc returns consecutive even integers, so it should never
happen that all three would be zeroes.
Except that seg_alloc() is marked as pure_func, and so new gcc figures
out that seg_alloc() returns constant, and so it can call it just once,
and then assign returned value to all three variables :-(
Simple fix below solves the problem.
Petr
Signed-off-by: Petr Vandrovec <[email protected]>
--- nasm-2.13.03/include/nasmlib.h 2018-02-07 13:40:15.000000000 -0800
+++ nasm-2.13.03.patched/include/nasmlib.h 2018-07-06 22:59:37.595561715 -0700
@@ -192,7 +192,7 @@
* seg_alloc: allocate a hitherto unused segment number.
*/
void pure_func seg_init(void);
-int32_t pure_func seg_alloc(void);
+int32_t seg_alloc(void);
/*
* many output formats will be able to make use of this: a standard
Acknowledgement sent
to Jordan Justen <[email protected]>:
Extra info received and forwarded to list. Copy sent to Anibal Monsalve Salazar <[email protected]>.
(Tue, 12 Feb 2019 09:54:02 GMT) (full text, mbox, link).
Subject: RE: nasm does not handle rdf2 output correctly due to incorrect use of pure_func
Date: Tue, 12 Feb 2019 01:41:25 -0800
Hi. Does the 2.14-1 release fix this? I see that upstream included at
patch exactly like yours:
commit 9f45a77f46829e666b35530939b9237cf978d4dc
Author: Cyrill Gorcunov <[email protected]>
Date: Sat Feb 10 00:40:46 2018 +0300
nasmlib: Drop pure_func attrib from seg_alloc
This patch should have been included is 2.14-1.
Thanks,
-Jordan
Acknowledgement sent
to Παναγιώτης Μπίκος <[email protected]>:
Extra info received and forwarded to list. Copy sent to Anibal Monsalve Salazar <[email protected]>.
(Sun, 17 Nov 2019 19:54:04 GMT) (full text, mbox, link).
Debbugs is free software and licensed under the terms of the GNU General
Public License version 2. The current version can be obtained
from https://bugs.debian.org/debbugs-source/.