opnsense / ports

OPNsense ports on top of FreeBSD
https://opnsense.org/
Other
163 stars 116 forks source link

Undefined symbol "__safestack_unsafe_stack_ptr" #49

Closed Stephanowicz closed 7 years ago

Stephanowicz commented 7 years ago

Hi,

I wanted to install nfdump and nfsen from the ports.

I got this error first when compiling nfdump. I finally managed to compile it with adding

CFLAGS+= -fsanitize=safe-stack
CXXFLAGS+= -fsanitize=safe-stack
LDFLAGS+= -fsanitize=safe-stack

to the makefile.

But now I'm stuck with starting nfsen, as this error now occurs in the pearl loader:

Can't load '/usr/local/lib/perl5/site_perl/mach/5.24/auto/RRDs/RRDs.so' for module RRDs: /usr/local/lib/librrd.so.8: Undefined symbol "__safestack_unsafe_stack_ptr" at /usr/local/lib/perl5/5.24/mach/DynaLoader.pm line 193.

Is there any workaround to get this running?

Cheers,

Stephan

fichtner commented 7 years ago

this was built with safestack, but safestack does not work on shared libraries very well

try to rebuild cleanly with

# make your-command HARDENING_OFF=safestack

Find out which pkg uses the RRDs.so file by:

# pkg which /usr/local/lib/perl5/site_perl/mach/5.24/auto/RRDs/RRDs.so

Remove the port, build again...

Stephanowicz commented 7 years ago

Great! That did it!

Thanx,

Stephan

fichtner commented 7 years ago

cool :) please leave this open, I need to fix hardenedbsd safestack annotations.

fichtner commented 7 years ago

Removed safestack from rrdtool in OPNsense ports repo (wasn't in HardenedBSD), thanks for the report!