After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 400184 - _vte_pty_open declaration mismatch - breaks on Solaris
_vte_pty_open declaration mismatch - breaks on Solaris
Status: RESOLVED FIXED
Product: vte
Classification: Core
Component: general
0.15.x
Other Solaris
: Normal major
: ---
Assigned To: VTE Maintainers
VTE Maintainers
Depends on:
Blocks:
 
 
Reported: 2007-01-24 13:00 UTC by Damien Carbery
Modified: 2007-01-24 20:41 UTC
See Also:
GNOME target: ---
GNOME version: 2.17/2.18


Attachments
Sync up _vte_pty_open definition and declaration (586 bytes, patch)
2007-01-24 13:04 UTC, Damien Carbery
committed Details | Review
Cast GPid to pid_t in public functions (1.86 KB, patch)
2007-01-24 16:56 UTC, Chris Wilson
none Details | Review
Revert to using pid_t for public functions (2.77 KB, patch)
2007-01-24 17:42 UTC, Chris Wilson
none Details | Review
Revert to using pid_t for public functions, take 2 (5.83 KB, patch)
2007-01-24 19:17 UTC, Chris Wilson
committed Details | Review

Description Damien Carbery 2007-01-24 13:00:07 UTC
The declaration of _vte_pty_open in pty.h and the definition in pty.c are no longer in sync. This breaks the build on Solaris.
http://svn.gnome.org/viewcvs/vte/trunk/src/pty.c?rev=1493&r1=1430&r2=1493

In pty.c the first parameter changed from:
  pid_t *child
to
  GPid *child

"pty.c", line 955: identifier redeclared: _vte_pty_open
 current : function(pointer to int, pointer to pointer to char, pointer to const char, pointer to pointer to char, pointer to const char, int, int, int, int, int) returning int
 previous: function(pointer to long, pointer to pointer to char, pointer to const char, pointer to pointer to char, pointer to const char, int, int, int, int, int) returning int : "pty.h", line 31
cc: acomp failed for pty.c

The attached patch syncs them again.
Comment 1 Damien Carbery 2007-01-24 13:04:47 UTC
Created attachment 81064 [details] [review]
Sync up _vte_pty_open definition and declaration
Comment 2 Chris Wilson 2007-01-24 14:33:43 UTC
Thanks.

r1513: 2007-01-24  Chris Wilson <chris@chris-wilson.co.uk>

	Bug 400184 – _vte_pty_open declaration mismatch - breaks on Solaris

	Patch by Damien Carbery.

	* src/pty.h:
		Update prototype to match new definition.

Comment 3 Behdad Esfahbod 2007-01-24 16:13:15 UTC
Damien, is any architecture on which Solaris defines int and long sizes of different sizes?  If this is the case, we need to back up the pid_t->GPid change.
Comment 4 Chris Wilson 2007-01-24 16:41:02 UTC
Hmm, don't think this is the case as the compiler warning says:
current: ... returning int [function definition in pty.c]
previous: ... returning int [function definition in pty.h]
Comment 5 Chris Wilson 2007-01-24 16:42:20 UTC
Excuse me, completely misread that.
(I was supposed to be looking at the first argument, the pointer to long)
Comment 6 Chris Wilson 2007-01-24 16:51:45 UTC
Behdad, to be safe we should change the public functions to return pid_t once more and flag up the issue on your GLib GPid bug.
Comment 7 Chris Wilson 2007-01-24 16:56:20 UTC
Created attachment 81089 [details] [review]
Cast GPid to pid_t in public functions

Unfortunately the issue if sizeof (pid_t) != sizeof (GPid) is propagated from g_spawn.
Comment 8 Behdad Esfahbod 2007-01-24 17:19:43 UTC
Yeah, lets back up...  At least in all public interfaces.
Comment 9 Behdad Esfahbod 2007-01-24 17:21:56 UTC
These are the ones that need to change back:

pty.h:int _vte_pty_open(GPid *child, char **env_add,
reaper.h:int vte_reaper_add_child(GPid pid);
vte.h:GPid vte_terminal_fork_command(VteTerminal *terminal,
vte.h:GPid vte_terminal_forkpty(VteTerminal *terminal,


And don't we have to include sys/types.h again?
Comment 10 Chris Wilson 2007-01-24 17:42:53 UTC
Created attachment 81094 [details] [review]
Revert to using pid_t for public functions

Hmm, not sure about the reaper change as it uses GPid in 0.14.1.
Comment 11 Chris Wilson 2007-01-24 17:44:32 UTC
And the _vte_pty_open() is private.
Comment 12 Chris Wilson 2007-01-24 17:46:32 UTC
Oh, do we also worry about the python exports?
Comment 13 Behdad Esfahbod 2007-01-24 18:06:44 UTC
(In reply to comment #11)
> And the _vte_pty_open() is private.

Not really.  The header was public, so I didn't hide those symbols:

-export-symbols-regex ^vte_terminal_.*|^_vte_pty_.*|^vte_reaper_.*|_vte_debug_.*"

But we probably should, and increase soname.  But someone should first search on Google code and make sure they really aren't used...



Yes, I think we should revert the python changes too.
Comment 14 Chris Wilson 2007-01-24 19:17:46 UTC
Created attachment 81104 [details] [review]
Revert to using pid_t for public functions, take 2

That propagates the changes back to pid_t. Though internally we now have (GPid)(pid_t)(GPid)...

 python/vte.defs     |    4 ++--
 python/vte.override |    4 ++--
 src/pty.c           |   15 ++++++++++-----
 src/pty.h           |    5 ++---
 src/vte.c           |   14 +++++---------
 src/vte.h           |    6 ++++--
 6 files changed, 25 insertions(+), 23 deletions(-)

Leaving reaper unchanged.
Comment 15 Chris Wilson 2007-01-24 20:41:40 UTC
r1519: 2007-01-24  Chris Wilson <chris@chris-wilson.co.uk>

	Bug 400184 – _vte_pty_open declaration mismatch - breaks on Solaris
	actually revealed a faux-pas in the conversion of the public
	interfaces to GPid - that it broke the ABI.

	However, the intention is to remove the exposed pid_t, cf bug 400333.

	* python/vte.defs:
	* python/vte.override:
	* src/pty.c: (_vte_pty_open):
	* src/pty.h:
	* src/vte.c: (_vte_terminal_fork_basic), (vte_terminal_forkpty):
	* src/vte.h:
		Revert the exposed GPids back to pid_t.