Jeroen Demeyer on Tue, 29 Sep 2015 12:07:48 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

concat() symbol collision


Hello pari devs,

libPARI exports the function concat(). This is a dangerous name, since other libraries might also use this function name. William Stein reported a segfault in Sage which could be traced back to this:

...
/projects/sage/sage-6.9/local/lib/libpari-gmp-2.8.so.0(gcopy+0x2a0)[0x7f5092d3cb30]
/projects/sage/sage-6.9/local/lib/libpari-gmp-2.8.so.0(concat+0x830)[0x7f5092b00680]
/usr/lib/libkpathsea.so.6(kpathsea_selfdir+0x2af)[0x7f504b6d0c2f]
/usr/lib/libkpathsea.so.6(kpathsea_set_program_name+0x6b)[0x7f504b6d0d1b]
...

It turns out that libkpathsea.so also exports a function called concat().

So I think we should rename concat -> pari_concat (or some other name). If you worry about backwards compatibility, you can always

#define concat pari_concat


Cheers,
Jeroen.