Bug 434539

Summary: Synergy segaulting in libstdc++
Product: [Fedora] Fedora Reporter: Paul Black <paul.0000.black>
Component: synergyAssignee: Matthias Saou <matthias>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 9CC: hdegoede, max.andersen, redhat
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: 1.3.1-9.fc9 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-06-03 07:32:34 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Backtrace from segfault
none
Backtrace from segfault of synergyc (!client!)
none
First attempt at fixing this none

Description Paul Black 2008-02-22 16:37:11 UTC
Description of problem:
14:09:54 kernel: synergys[17635]: segfault at 18 ip 37b066b6c8 sp 7fff0e7742f8
error 4 in libstdc++.so.6.0.10[37b0600000+ee000]
14:17:22 kernel: synergys[20880]: segfault at 18 ip 37b066b6c8 sp 7fffed9db558
error 4 in libstdc++.so.6.0.10[37b0600000+ee000]
16:14:30 kernel: synergys[20933]: segfault at 18 ip 37b066b6c8 sp 7fffd90a2c28
error 4 in libstdc++.so.6.0.10[37b0600000+ee000]
16:15:32 kernel: synergys[21087]: segfault at 18 ip 37b066b6c8 sp 7fffcb7df368
error 4 in libstdc++.so.6.0.10[37b0600000+ee000]
16:26:43 kernel: synergys[21206]: segfault at 18 ip 37b066b6c8 sp 7fffea500088
error 4 in libstdc++.so.6.0.10[37b0600000+ee000]
16:34:17 kernel: synergys[21255]: segfault at 18 ip 37b066b6c8 sp 7fffdc170cf8
error 4 in libstdc++.so.6.0.10[37b0600000+ee000]


Version-Release number of selected component (if applicable):
synergy-1.3.1-5.fc8.x86_64

How reproducible:
Will run for a while but happens regularly. Didn't happen under Fedora 8

Steps to Reproduce:
1. Run synergys. Have client connect
2. Use synergy


Actual results:
synergys keeps running.

Expected results:
synergys segfaults.

Additional info:
I did recompile synergy under GCC 4.3 (required some header files to be added)
but problem remained.

Comment 1 Matthias Saou 2008-02-24 13:54:32 UTC
Can you try with the rebuild from yesterday? I doubt it'll fix the problem if a
local rebuild didn't, but you never know...

If the problem persists, please install synergy-debuginfo and gdb, run it after
"ulimit -c unlimited", then run "gdb synergys core.xyz" enter "bt" and paste
here the complete backtrace you get.

Comment 2 Paul Black 2008-03-12 09:10:08 UTC
Created attachment 297741 [details]
Backtrace from segfault

Comment 3 Paul Black 2008-03-25 09:19:30 UTC
I think this may be caused by copying data to the clipboard in Windows.

If I select something in Outlook or Firefox and hit CTRL-C, when the mouse moves
back to the Linux screen, synergys segfaults.


Comment 4 Bug Zapper 2008-05-14 05:34:52 UTC
Changing version to '9' as part of upcoming Fedora 9 GA.
More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 5 Stefan Neufeind 2008-05-15 11:55:43 UTC
Hmm, I've lately seen synergyc crashing occasionally since upgrading to Fedora
9. Not sure if this is related. If I manage to get something reproducable, I'll
see to catch a backtrace ...

Comment 6 Stefan Neufeind 2008-05-19 18:19:59 UTC
Created attachment 305988 [details]
Backtrace from segfault of synergyc (!client!)

Comment 7 Stefan Neufeind 2008-05-19 18:21:39 UTC
Please see attached backtrace from the client. This happened to me similar over
the last few days. synergyc was always started with "-f" to make it easier to
debug something.

While I've been able to encounter the segfault again, unfortunately I still lack
a means to easily reproduce this crash (e.g. for further checking or confirm fix).

Comment 8 Matthias Saou 2008-05-30 16:10:39 UTC
*** Bug 447696 has been marked as a duplicate of this bug. ***

Comment 9 Matthias Saou 2008-05-30 16:20:31 UTC
Things are looking quite bad, as synergy's development seems to have stopped
completely. I've looked at a few upstream bugreports, and found some which are
very similar to this one, but unfortunately none have fixes posted. From the
synergy website, the "Known Bugs" link goes to a pretty alarming list :
http://sourceforge.net/tracker/?func=browse&group_id=59275&atid=490467

As I lack knowledge to fix the current issues, either this would need to be
looked into by someone more knowledgeable (which is why I'm cc'ing Hans, in case
he can have a look... but it's C++... ;-)), or having synergy in Fedora should
be reconsidered, given its current status (although I personally think it would
be too bad to have it removed, as I still use it and haven't seen these crashes
yet).

Comment 10 Hans de Goede 2008-05-30 22:18:33 UTC
I think I've found the cause (and fixed) the backtrace from comment #2, I say I
think, as I don't have a working synergy setup myself, so the only checking of
my fix I've done is checked that it still compiles.

Once its done buidling you can download a test verison of the fixed packages here:
http://koji.fedoraproject.org/koji/taskinfo?taskID=637490

For those curious I'll also attach my patch, It fixes a classic case of using an
iterator after erasing the element that the iterator referenced to before doing
the erase. I wish c++ programmers would learn to not do this, as I've seen this
bug too often.


Comment 11 Hans de Goede 2008-05-30 22:19:15 UTC
Created attachment 307244 [details]
First attempt at fixing this

Comment 12 Paul Black 2008-06-02 08:08:18 UTC
The fix works for me.

Cheers


Comment 13 Stefan Neufeind 2008-06-02 08:18:41 UTC
Hasn't crashed here so far :-) Looks better imho. Might take a few more days to
be completely sure all errors are gone, but then we could easily reopen the bug
if needed.

Works. Great work, Hans!

Comment 14 Hans de Goede 2008-06-02 09:43:53 UTC
Good to hear my time was invested well :)

So shall I push an update of synergy containing this fix?


Comment 15 Stefan Neufeind 2008-06-02 09:51:46 UTC
From my point of view the patch seems to be fine, and prevents occassional
crashes (2-3 times per day for me). Please go for it.

Comment 16 Matthias Saou 2008-06-02 09:53:28 UTC
My hero! :-)
Feel free to push the update if you want, otherwise just say so and I'll do it
myself based on your patch. Thanks a lot, Hans!

Comment 17 Hans de Goede 2008-06-02 10:02:02 UTC
Fixed version building for devel, F-9 and F-8 (not sure if its needed for F-8,
seems to be triggered by changes in gcc-4.3's stdlibc++, but can't hurt).

Will push as update once done building.


Comment 18 Stefan Neufeind 2008-06-02 10:06:22 UTC
Any chance you could also submit that upstream? :-)

Comment 19 Paul Black 2008-06-02 10:09:47 UTC
I never encountered the problem on F-8.

Once again, thanks for the good work.


Comment 20 Fedora Update System 2008-06-02 10:15:58 UTC
synergy-1.3.1-8.fc9 has been submitted as an update for Fedora 9

Comment 21 Hans de Goede 2008-06-02 19:37:51 UTC
(In reply to comment #18)
> Any chance you could also submit that upstream? :-)

Good point, this has lead me to going to upstreams patch tracker, which has
quite a few patches queued which were never applied as upstream seems, well
basicly dead :(

Anyways I've taken 2 bugfix patches from the tracker, which fix bugs which I was
able to reproduce and applied them to the Fedora package, for good measure I
also checked the Debian packages and took 2 manpages from there, so now instead
of synergy-1.3.1-8.fc9 I proudly present you synergy-1.3.1-9.fc9:
* Mon Jun 02 2008 Hans de Goede <j.w.r.degoede> 1.3.1-9
- Drop no longer needed patch0, stop regenerating autoxxx files
- Apply the following bug fixes from upstream's bug tracker:
  -off by one bugfix to X11 selection (fixes copy and paste by selection)
  -call DPMSOn() when entering screen to make sure powersaving mode is canceled
   on X11 client systems when the fake mouse / keyb become active
- Add manpages (courtesy of Debian)

There alos is the following bugfix in upstream, but I couldn't reproduce, I
guess this only happens with windows servers:
-Fix modifier keys getting stuck down when switching between screens using
 a hotkey combination

Applying that to our packages thus will be of little use. Also potentially
interesting are the following new features patches:
-add option to leave focus to last focussed app when leaving screen, this
 is usefull for example to keep remote controls working with mythtv when
 the synergy cursor is on a different screen
-add options to only switch screens when the mouse pointer leaves a screen
 and one of shift/ctrl/alt (configurable) is pressed

I don't use synergy much myself, do this features sound usefull to you?

Anyways now pushing synergy-1.3.1-8 to FC-9 and FC-8.

Comment 22 Fedora Update System 2008-06-02 19:54:31 UTC
synergy-1.3.1-9.fc9 has been submitted as an update for Fedora 9

Comment 23 Fedora Update System 2008-06-02 19:55:27 UTC
synergy-1.3.1-9.fc8 has been submitted as an update for Fedora 8

Comment 24 Max Rydahl Andersen 2008-06-03 06:50:04 UTC
(In reply to comment #21)
> (In reply to comment #18)
> Applying that to our packages thus will be of little use. Also potentially
> interesting are the following new features patches:
> -add option to leave focus to last focussed app when leaving screen, this
>  is usefull for example to keep remote controls working with mythtv when
>  the synergy cursor is on a different screen
> -add options to only switch screens when the mouse pointer leaves a screen
>  and one of shift/ctrl/alt (configurable) is pressed
> 
> I don't use synergy much myself, do this features sound usefull to you?

If the patches won't be available in the windows or mac clients and become 
incompatible with Fedora's synergy then I don't think these are usefull. 
> Anyways now pushing synergy-1.3.1-8 to FC-9 and FC-8.



Comment 25 Fedora Update System 2008-06-03 07:32:32 UTC
synergy-1.3.1-9.fc9 has been pushed to the Fedora 9 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 26 Fedora Update System 2008-06-03 07:36:20 UTC
synergy-1.3.1-9.fc8 has been pushed to the Fedora 8 stable repository.  If problems still persist, please make note of it in this bug report.