Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 144984 - Uninitialized variable access in obscure circumstances.
Summary: Uninitialized variable access in obscure circumstances.
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: Catalyst (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Catalyst Developers
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2006-08-24 09:14 UTC by Bardur Arantsson
Modified: 2006-12-06 13:45 UTC (History)
0 users

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


Attachments
Patch that fixes the problem (blah.patch,776 bytes, patch)
2006-08-24 09:15 UTC, Bardur Arantsson
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Bardur Arantsson 2006-08-24 09:14:24 UTC
The error looks like this:

-- output begins --
Catalyst aborting....
Traceback (most recent call last):
  File "/usr/bin/catalyst", line 380, in ?
    build_target(addlargs, targetmap)
  File "/usr/bin/catalyst", line 198, in build_target
    mytarget.run()
  File "/usr/lib/catalyst/modules/generic_stage_target.py", line 1063, in run
    apply(getattr(self,x))
  File "/usr/lib/catalyst/modules/livecd_stage2_target.py", line 116, in unpack
    print display_msg
UnboundLocalError: local variable 'display_msg' referenced before assignment
-- output ends --

I'll be attaching a trivial patch shortly.

I think the logic in there still looks suspect though: AFAICT there may be other scenarios than the one I accidentally tried where 'unpack' may remain True while unpack_cmd does not get set to anything meaningful. With my patch this will result in the new error message as well -- I'm not sure how appropriate that is.

Anyway, the patch certainly certainly shouldn't cause any regressions.
The new message only triggers when an undefined variable would be accessed anyway.
Comment 1 Bardur Arantsson 2006-08-24 09:15:26 UTC
Created attachment 95018 [details, diff]
Patch that fixes the problem
Comment 2 Chris Gianelloni (RETIRED) gentoo-dev 2006-11-22 08:38:29 UTC
I've added this to SVN... thanks for the patch!
Comment 3 Chris Gianelloni (RETIRED) gentoo-dev 2006-12-06 13:45:09 UTC
Fixed in 2.0.1