depexp.py: Fix segfault if DISPLAY is not set
PATCH v2 1/1 depexp.py: Fix segfault if DISPLAY is not set
bitbake -g -u depexp <package> segfaults when DISPLAY is not set properly. Fix it with a proper check.
[YOCTO #7299]
--- bitbake/lib/bb/ui/depexp.py | 7 +++++++ 1 file changed, 7 insertions(+)
bitbake/lib/bb/ui/depexp.py +7 -0
@@ -17,6 +17,7 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +import sys import gobject import gtk import Queue
@@ -215,6 +216,12 @@ def main(server, eventHandler, params): print("XMLRPC Fault getting commandline:\n %s" % x) return + try: + gtk.init_check() + except: + sys.stderr.write("Please set DISPLAY variable before running this command \n") + return + shutdown = 0 gtkgui = gtkthread(shutdown)
Signature · 1 line
1.9.1
gentle ping..
Quoted 37 lines · Maxin B. John
bitbake -g -u depexp <package> segfaults when DISPLAY is not set properly. Fix it with a proper check.
[YOCTO #7299]
Signed-off-by Maxin B. John <[email protected]>--- bitbake/lib/bb/ui/depexp.py | 7 +++++++ 1 file changed, 7 insertions(+)bitbake/lib/bb/ui/depexp.py +7
-0@@ -17,6 +17,7 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +import sys import gobject import gtk import Queue@@ -215,6 +216,12 @@ def main(server, eventHandler, params): print("XMLRPC Fault getting commandline:\n %s" % x) return + try: + gtk.init_check() + except: + sys.stderr.write("Please set DISPLAY variable before running this command \n") + return + shutdown = 0 gtkgui = gtkthread(shutdown)Signature · 1 line
1.9.1
Quoted 23 lines · Maxin B. John
bitbake -g -u depexp <package> segfaults when DISPLAY is not set properly. Fix it with a proper check.
[YOCTO #7299]
Signed-off-by Maxin B. John <[email protected]>--- bitbake/lib/bb/ui/depexp.py | 7 +++++++ 1 file changed, 7 insertions(+)bitbake/lib/bb/ui/depexp.py +1
-0@@ -17,6 +17,7 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +import sys import gobject import gtk import Queue
bitbake/lib/bb/ui/depexp.py def main(server, eventHandler, params): · line 223
Quoted 8 lines
bitbake/lib/bb/ui/depexp.py +5
-0@@ -215,6 +216,12 @@ def main(server, eventHandler, params): print("XMLRPC Fault getting commandline:\n %s" % x) return + try: + gtk.init_check() + except: + sys.stderr.write("Please set DISPLAY variable before running this command \n") + return
Sorry about the delay in replying. Its usually bad form to put generic except clauses into python. Is there a specific exception we should be trapping here?
Cheers,
Richard
Hi,
Quoted 27 lines · Richard Purdie
Quoted 26 lines · Maxin B. John
bitbake -g -u depexp <package> segfaults when DISPLAY is not set properly. Fix it with a proper check.
[YOCTO #7299]
Signed-off-by Maxin B. John <[email protected]>--- bitbake/lib/bb/ui/depexp.py | 7 +++++++ 1 file changed, 7 insertions(+)bitbake/lib/bb/ui/depexp.py +1
-0@@ -17,6 +17,7 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +import sys import gobject import gtk import Queue@@ -215,6 +216,12 @@ def main(server, eventHandler, params): print("XMLRPC Fault getting commandline:\n %s" % x) return
Quoted 9 lines
bitbake/lib/bb/ui/depexp.py def main(server, eventHandler, params): · line 223
Quoted 5 lines
bitbake/lib/bb/ui/depexp.py +5
-0+ try: + gtk.init_check() + except: + sys.stderr.write("Please set DISPLAY variable before running this command \n") + returnSorry about the delay in replying. Its usually bad form to put generic except clauses into python. Is there a specific exception we should be trapping here?
The exception should be the RuntimeError here. I will update and send the v3.
Quoted 2 lines
Cheers,
Richard
Best Regards,
Maxin