Bug 147492 - [PATCH] textproc/scim-bridge segfaults.
Summary: [PATCH] textproc/scim-bridge segfaults.
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Ashish SHUKLA
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-05 08:00 UTC by Ashish Shukla
Modified: 2010-07-07 08:10 UTC (History)
0 users

See Also:


Attachments
file.diff (1.80 KB, patch)
2010-06-05 08:00 UTC, Ashish Shukla
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ashish Shukla 2010-06-05 08:00:13 UTC
When trying to use scim-bridge with Emacs via scim-bridge.el[1], I got the following error:

SCIM: file-error: ("make client process failed" "no such file or directory" :name "scim-bridge" :service "/tmp/scim-bridge-0.3.0.socket-1001@localhost:0.0" :buffer " *scim-bridge(:0.0)*" :family local :server nil :noquery t)

On looking in the /tmp directory, I found following socket file created:

/tmp/scim-bridge-0.3.0.socket-1001@localhost:0.

And also it crashes sometimes due to this socket name mismatch
issue. The socket path created by scim-bridge is incomplete according
to other scim-bridge clients (e.g. scim-bridge.el).

After truss-ing, I figured out it is trying to create the socket with correct path name, but fails to create properly:

,---- an excerpt from: truss $(which scim-bridge)
| socket(PF_LOCAL,SOCK_STREAM,0)			 = 3 (0x3)
| connect(3,{ AF_UNIX "/tmp/scim-bridge-0.3.0.socket-1001@localhost:0.0" },49) ERR#2 'No such file or directory'
| close(3)					 = 0 (0x0)
| unlink("/tmp/scim-bridge-0.3.0.socket-1001@localhost:0.0") ERR#2 'No such file or directory'
| socket(PF_LOCAL,SOCK_STREAM,0)			 = 3 (0x3)
| fcntl(3,F_GETFL,)				 = 2 (0x2)
| fcntl(3,F_SETFL,O_NONBLOCK|0x2)			 = 0 (0x0)
| bind(3,{ AF_UNIX "/tmp/scim-bridge-0.3.0.socket-1001@localhost:0.0" },49) = 0 (0x0)
| listen(0x3,0x40,0x31,0x8080808080808080,0x101010101010101,0x8080808080808080) = 0 (0x0)
`----

The attached diff file fixes the issue. I don't use Qt4, but chances
are that textproc/scim-bridge-qt4 is buggy too, since they share same
distfile. Thus this diff also needs to be applied on
textproc/scim-bridge-qt4 .

I've filed a bug report[2] on their bug tracker.

[1] - https://launchpad.net/scim-bridge.el
[2] - https://sourceforge.net/tracker/?func=detail&aid=3011721&group_id=108454&atid=650539

How-To-Repeat: Make sure you're running in X11.

1. Install scim-bridge .

% sudo make -C /usr/ports/textproc/scim-bridge install

2. Execute scim-bridge.

% scim-bridge

3. Check the path name of the socket, iff scim-bridge is not crashed. 

% ls /tmp/scim-bridge*

You'll notice a path name ending with '0.' assuming your X11 DISPLAY is ":0.0".
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2010-06-05 08:00:21 UTC
Maintainer of textproc/scim-bridge,

Please note that PR ports/147492 has just been submitted.

If it contains a patch for an upgrade, an enhancement or a bug fix
you agree on, reply to this email stating that you approve the patch
and a committer will take care of it.

The full text of the PR can be found at:
    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/147492

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 2 Edwin Groothuis freebsd_committer freebsd_triage 2010-06-05 08:00:24 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 3 Stefan Walter freebsd_committer freebsd_triage 2010-07-01 07:11:37 UTC
Responsible Changed
From-To: freebsd-ports-bugs->ashish

Submitter is a committer now.
Comment 4 Henry Hu 2010-07-01 09:03:56 UTC
I'm sorry, but I switched from scim to ibus, since scim crashes frequently here.
So I cannot track the updates of scim-bridge and scim-bridge-qt4, and
I cannot easily verify if it works here.
If you have time, would you please take the maintainer of
textproc/scim-bridge and textproc/scim-bridge-qt4?

-- 
Cheers,
Henry
Comment 5 Ashish Shukla 2010-07-01 10:50:43 UTC
Henry Hu writes:
> I'm sorry, but I switched from scim to ibus, since scim crashes frequently here.
> So I cannot track the updates of scim-bridge and scim-bridge-qt4, and
> I cannot easily verify if it works here.
> If you have time, would you please take the maintainer of
> textproc/scim-bridge and textproc/scim-bridge-qt4?


The fix I sent to you was already tested by the original reporter who reported
me the error. Anyways, I think I'll be able to maintain it.

> -- 
> Cheers,
> Henry


-- 
Ashish SHUKLA

âBeware of bugs in the above code; I have only proved it correct, not
tried it.â (Donald Knuth, 1977-03-22)
Comment 6 dfilter service freebsd_committer freebsd_triage 2010-07-07 08:07:53 UTC
ashish      2010-07-07 07:07:44 UTC

  FreeBSD ports repository

  Modified files:
    textproc/scim-bridge Makefile 
  Added files:
    textproc/scim-bridge/files 
                               patch-agent_scim-bridge-agent-accept-listener.cpp 
  Log:
  - Add patch to fix the issue mentioned in the PR.
  - Transfer maintainership to self.
  
  PR:             ports/147492
  Approved by:    pgj (mentor), henry.hu.sh@gmail.com (maintainer)
  Feature safe:   yes
  
  Revision  Changes    Path
  1.7       +1 -1      ports/textproc/scim-bridge/Makefile
  1.1       +29 -0     ports/textproc/scim-bridge/files/patch-agent_scim-bridge-agent-accept-listener.cpp (new)
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 7 dfilter service freebsd_committer freebsd_triage 2010-07-07 08:09:51 UTC
ashish      2010-07-07 07:09:33 UTC

  FreeBSD ports repository

  Modified files:
    textproc/scim-bridge-qt4 Makefile 
  Added files:
    textproc/scim-bridge-qt4/files 
                                   patch-agent_scim-bridge-agent-accept-listener.cpp 
  Log:
  - Add patch to fix the issue mentioned in the PR.
  - Transfer maintainership to self.
  
  PR:             ports/147492
  Approved by:    pgj (mentor), henry.hu.sh@gmail.com (maintainer)
  Feature safe:   yes
  
  Revision  Changes    Path
  1.6       +1 -1      ports/textproc/scim-bridge-qt4/Makefile
  1.1       +29 -0     ports/textproc/scim-bridge-qt4/files/patch-agent_scim-bridge-agent-accept-listener.cpp (new)
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 8 Ashish SHUKLA freebsd_committer freebsd_triage 2010-07-07 08:10:50 UTC
State Changed
From-To: feedback->closed

Committed. Thanks!