Bug 9230 - Tracebacks sometimes apparently truncated
Summary: Tracebacks sometimes apparently truncated
Status: RESOLVED FIXED
Alias: None
Product: BitBake
Classification: Build System, Metadata & Runtime
Component: bitbake (show other bugs)
Version: 2.0
Hardware: x86 Multiple
: Medium+ minor
Target Milestone: 2.1 M4
Assignee: Richard Purdie
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2016-03-09 04:57 UTC by Paul Eggleton
Modified: 2016-04-04 15:06 UTC (History)
2 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Eggleton 2016-03-09 04:57:08 UTC
I sometimes hit situations working on BitBake code where a printed exception traceback is truncated - the function where the exception is occurring isn't listed, instead it stops a function or two prior.

A trivial reproducer for this was the missing argument to ParameterError in fetch2/npm.py; simply run the following:

recipetool create npm://registry.npmjs.org

This should try to raise ParameterError except the requisite number of arguments haven't been passed; so what you get is a TypeError; however the last line in the trace isn't the errant one. Here's what I get:

---------- snip ----------
Traceback (most recent call last):
  File "/home/paul/poky/poky/scripts/recipetool", line 116, in <module>
    ret = main()
  File "/home/paul/poky/poky/scripts/recipetool", line 107, in main
    ret = args.func(args)
  File "/home/paul/poky/poky/scripts/lib/recipetool/create.py", line 366, in create_recipe
    checksums = scriptutils.fetch_uri(tinfoil.config_data, fetchuri, srctree, srcrev)
  File "/home/paul/poky/poky/scripts/lib/scriptutils.py", line 85, in fetch_uri
    fetcher = bb.fetch2.Fetch([uri], localdata)
  File "/home/paul/poky/poky/bitbake/lib/bb/fetch2/__init__.py", line 1493, in __init__
    self.ud[url] = FetchData(url, d, localonly)
TypeError: __init__() takes exactly 3 arguments (2 given)
---------- snip ----------

(Note that I've sent a patch to pass the correct number of arguments, so if that's been merged you'll naturally need to revert it locally to see this again.)

At a guess, this may have something to do with the object structure and the indirection that's being used (i.e. the call to self.method.urldata_init(self, d)). I'm unsure as to whether all of this is caused by a bug in our code or just a general python bug though.