Opened 9 years ago

Closed 8 years ago

#2287 closed defect (fixed)

Vidalia crashes upon startup (FreeBSD)

Reported by: orion Owned by: chiiph
Priority: High Milestone:
Component: Archived/Vidalia Version: Vidalia 0.2.10
Severity: Keywords: vidalia crash
Cc: kubito@… Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

Every time I try to start vidalia I get a seg fault. I am running version 0.2.10 on FreeBSD 8.1-RELEASE (amd64) which is the most up to date version in ports.

Child Tickets

Attachments (1)

gdb.log (3.2 KB) - added by Shew 9 years ago.
Output of 'gdb /usr/local/bin/vidalia'

Download all attachments as: .zip

Change History (11)

comment:1 Changed 9 years ago by chiiph

Can you try running Vidalia inside gdb, and then check the backtrace to see where it fails?

It'd be something like this:
$ gdb $(which vidalia)
Then inside gdb type the command: run
And once it crashes use the command: bt to get a the backtrace

comment:2 Changed 9 years ago by rransom

Priority: blockermajor

Changed 9 years ago by Shew

Attachment: gdb.log added

Output of 'gdb /usr/local/bin/vidalia'

comment:3 Changed 9 years ago by Shew

I am also having the same problem with Vidalia 0.2.10 on FreeBSD 8.1 i386.

I added the output of 'gdb /usr/local/bin/vidalia' with the commands chiiph suggested.

I noticed that if I do:
mv /usr/local/lib/libssl.so.7 /usr/local/lib/libssl.so.7.old
ln /usr/lib/libssl.so.6 /usr/local/lib/libssl.so.7
Then Vidalia works fine. I guess that libssl.so.6 was installed by the FreeBSD installer, and libssl.so.7 was installed by the OpenSSL port? 'openssl version' outputs 'OpenSSL 0.9.8n 24 Mar 2010' and the ports system lists it as 'openssl-1.0.0_4', if that helps.

comment:4 in reply to:  3 ; Changed 9 years ago by rransom

Resolution: invalid
Status: newclosed

Replying to Shew:

I am also having the same problem with Vidalia 0.2.10 on FreeBSD 8.1 i386.

I added the output of 'gdb /usr/local/bin/vidalia' with the commands chiiph suggested.

I noticed that if I do:
mv /usr/local/lib/libssl.so.7 /usr/local/lib/libssl.so.7.old
ln /usr/lib/libssl.so.6 /usr/local/lib/libssl.so.7
Then Vidalia works fine. I guess that libssl.so.6 was installed by the FreeBSD installer, and libssl.so.7 was installed by the OpenSSL port? 'openssl version' outputs 'OpenSSL 0.9.8n 24 Mar 2010' and the ports system lists it as 'openssl-1.0.0_4', if that helps.

Then this isn't a Vidalia bug. portupgrade might help you; see the documentation for the FreeBSD ports system.

comment:5 in reply to:  4 Changed 9 years ago by Shew

Actually, when I used strings on libssl.so.7 it showed that it was 1.0.0_4, which is the latest version. The openssl command apparently went with libssl.so.6, which worked fine when I used it with Vidalia. So there is some new behavior that Vidalia will become buggy with when people upgrade to 1.0.0_4 on FreeBSD. It is not something that can be solved by portupgrade.

comment:6 Changed 9 years ago by Shew

Resolution: invalid
Status: closedreopened

I have now tested Vidalia with the following OpenSSL versions:
1.0.0c (the latest FreeBSD port)
1.0.0b
1.0.0a
1.0.0
0.9.8n

And I have found that Vidalia is broken with the entire 1.0.0x branch on FreeBSD. I had to backport all the way to 0.9.8n (revision 1.166 of the ports system Makefile, and friends) from 9 months ago to get it to work. This is a major problem.

comment:7 in reply to:  6 Changed 9 years ago by alvest

Replying to Shew:

... I have found that Vidalia is broken with the entire 1.0.0x branch on FreeBSD.

Your gdb.log showed me that Vidalia depends on a library built with the port "net/qt4-network", which in turn uses openssl. Thanks for that clue. I think I may have fixed this problem on FreeBSD (RELENG_8), by adding the following line to the port's "Makefile" file and rebuilding that (qt4-network) port:

CONFIGURE_ARGS+= -openssl-linked

At least after I did that, vidalia ran for me without crashing. Hope it works for you too.

comment:8 Changed 9 years ago by rakuco

Cc: kubito@… added

Hi, I was directed here after a mail about this problem was sent to the KDE on FreeBSD mailing list.

By default, Qt loads OpenSSL during runtime, first looking for lib{crypto,ssl}.so.SHLIB_MAJOR_VERSION (this is defined in opensslv.h), then for lib{crypto,ssl}.so, first relying on dlopen, then using some hardcoded paths/loading LD_LIBRARY_PATH. Since the OpenSSL version in FreeBSD's base system does not install lib{crypto,ssl}.so.SHLIB_MAJOR_VERSION (that would be lib{crypto,ssl}.so.0.9.8), Qt falls back to loading lib{crypto,ssl}.so, which is installed both in /usr/lib (base OpenSSL) and /usr/local/lib (ports OpenSSL). FreeBSD's loader looks for a given library in the following order: LD_LIBRARY_PATH, rpath, ldconfig hints and /lib:/usr/lib.


The problem the original reporter described comes from the fact that he has installed OpenSSL from ports, but OpenSSL from the base system is being loaded by Qt (setting LD_LIBRARY_PATH should solve this problem). It is weird that base's OpenSSL seems to be calling ports' OpenSSL, but it's hard to know why with that incomplete backtrace.


As for compiling qt4-network with -openssl-linked, that is another way to solve the issue, as Qt then links to OpenSSL instead of loading it at runtime.


So, Shew, can you check if setting LD_LIBRARY_PATH correctly helps with your problem?

comment:9 Changed 9 years ago by Shew

Hey! LD_LIBRARY_PATH works.

If I set it to '/usr/local/lib:/usr/lib:/lib' then Vidalia starts properly.

If I set it to '/lib:/usr/lib:/usr/local/lib' then it crashes as usual.

I haven't tried linking OpenSSL yet, but I will try that next. I have also noticed that under some conditions Vidalia starts properly, but I'm not sure what the conditions are yet. I will try and track those conditions down if I can.

comment:10 Changed 8 years ago by chiiph

Resolution: fixed
Status: reopenedclosed

The dependency issue with OpenSSL has been fixed with 0.2.12.
Thanks everyone.

Note: See TracTickets for help on using tickets.