On 08.10.2014 20:13, Elan Ruusamäe wrote:

... seems to be related to the "or str" statement, and the length of the inline string, <3 is ok, >=4 is epic fail:

# rpm -E '%{lua:print(os.getenv("TMPDIR") or "4231")}'
*** Error in `rpm': malloc(): memory corruption: 0x0997afb8 ***
^C
# rpm -E '%{lua:print(os.getenv("TMPDIR") or "423")}'
423
# rpm -E '%{lua:print(os.getenv("TMPDIR") or "asdf")}'
*** Error in `rpm': malloc(): memory corruption: 0x083bfe28 ***
^C
# rpm -E '%{lua:print(os.getenv("TMPDIR") or "bla")}'
bla
#
and as you already guessed, the boundary on 64bit system is 7 chars:

➔ rpm -E '%{lua:print(os.getenv("TMPDIR") or "blahbla")}'
/home/users/glen/tmp

➔ rpm -E '%{lua:print(os.getenv("TMPDIR") or "blahblah")}'
*** Error in `rpm': free(): invalid next size (fast): 0x0000000000696a50 ***
======= Backtrace: =========
/lib64/libc.so.6[0x3dec2735b8]
/lib64/libc.so.6[0x3dec2789ae]
/lib64/libc.so.6[0x3dec2796d6]
/usr/lib64/librpmio-5.4.so[0x3df0cacb93]
/usr/lib64/librpmio-5.4.so(expandMacros+0xa1)[0x3df0cad0c1]
/usr/lib64/librpmio-5.4.so(rpmExpand+0x108)[0x3df0cad268]
/usr/lib64/librpm-5.4.so[0x3df2c2d170]
/lib64/libpopt.so.0[0x3ded8029f1]
/lib64/libpopt.so.0[0x3ded802981]
/lib64/libpopt.so.0(poptGetNextOpt+0x389)[0x3ded804699]
/usr/lib64/librpm-5.4.so(rpmcliInit+0x17f)[0x3df2c2d78f]
rpm[0x40277d]
/lib64/libc.so.6(__libc_start_main+0xf5)[0x3dec221c15]
rpm[0x403ada]
...


--
glen

_______________________________________________
pld-devel-en mailing list
pld-devel-en@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-devel-en

Reply via email to