Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 95628 - detox unsupported on ppc
Summary: detox unsupported on ppc
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: PPC Linux
: High normal (vote)
Assignee: Gentoo Shell Tools project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-09 20:47 UTC by Goyo Roth
Modified: 2005-06-12 04:13 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
alters a char variable troublesome on ppc (detox.simple.patch,440 bytes, patch)
2005-06-09 20:54 UTC, Goyo Roth
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Goyo Roth 2005-06-09 20:47:22 UTC
Detox is masked for ppc. This is despite the fact that it compiles because it
does not run. The fix is incredibly simple. I've submitted it to the author, but
he has not responded. I thought gentoo might want to patch it and unmask another
package. 
Unlike intel machines, ppc chars default to unsigned. The author assigned the
results of a function returning an integer to a char and tested it for
negativity, indicating the end of a list. Since the char is unsigned, it is
never negative. Yield: infinite loop in argument parsing. 
The fix: dump the char for an int or explicitly define the char as signed. I've
opted for the latter.
Patch attached. 

Sorry if this isn't the proper forum for such things.

Reproducible: Always
Steps to Reproduce:
1. ebuild /usr/portage/app-misc/detox/detox-1.1.1.ebuild merge
2. detox foo\ bar
3. 

Actual Results:  
Program hangs. gdb reveals it is caught in the cli argument parsing loop for the
reasons described above. 

Expected Results:  
renamed foo\ bar to foo_bar. With my patch, it now does.

An incredibly small patch follows . . .
Comment 1 Goyo Roth 2005-06-09 20:54:07 UTC
Created attachment 60963 [details, diff]
alters a char variable troublesome on ppc
Comment 2 Luca Barbato gentoo-dev 2005-06-10 05:45:05 UTC
int poptGetNextOpt(poptContext con);

the current code is just WRONG.

please report upstream to use the right size for variables.
Comment 3 Aaron Walker (RETIRED) gentoo-dev 2005-06-10 06:21:32 UTC
Yeah as Luca pointed it out, the current code is incorrect (not just missing a
'signed' specified).  c needs to be an int, so that also fixes the signed issue.

Fixed in 1.1.1-r1.  Thanks for the report.
Comment 4 Goyo Roth 2005-06-10 18:59:15 UTC
(In reply to comment #3)
> Yeah as Luca pointed it out, the current code is incorrect (not just missing a
> 'signed' specified).  c needs to be an int, so that also fixes the signed issue.
> 
> Fixed in 1.1.1-r1.  Thanks for the report.

Yes, I believe I mentioned that:

> The fix: dump the char for an int or explicitly define the char as signed.
I've opted for the latter.

I stuck with the char in hopes that the original author, who surly thought he
was gaining something by using a char rather than something more obvious, would
be more likely to incorporate the patch.

No matter. Thank you much. I'm glad the issue is resolved.
Comment 5 Goyo Roth 2005-06-10 23:19:29 UTC
The intent of this fix was to unmask the package on ppc. I see the new version,
but ppc is still masked. What remains to put it into ~ppc?
Comment 6 Aaron Walker (RETIRED) gentoo-dev 2005-06-11 04:17:03 UTC
That'd be up to the ppc team.
Comment 7 David Holm (RETIRED) gentoo-dev 2005-06-12 04:13:13 UTC
It's in ~ppc now.