Bugzilla – Bug 322868
[PATCH][windows] ironpython: os.popen() causes segfault
Last modified: 2007-09-15 21:24:46 UTC
---- Reported by anthony@interlink.com.au 2006-12-06 18:26:20 MST ---- On both IronPython 1.0.1 and IPCE release 4, os.popen() segfaults under Mono 1.17.1 (on Ubuntu edgy). To reproduce: ipy.exe -c "import os; print os.popen('/bin/ls', 'r').read()" Stacktrace follows, for whatever value it is... I can't tell immediately whether it's an IronPython or Mono problem, although it _appears_ to be in Mono. Dino Viehland <dinov@exchange.microsoft.com> added: > I would expect this to be a Mono bug as IronPython is entirely managed > code. > There's always the possibility we are generating invalid IL but we're not > aware of any places where we currently do that (as we validate all the IL > we generate w/ peverify during our test runs, which include importing the > CPython os module). ================================================================= Got a SIGSEGV while executing native code. This usually indicates a fatal error in the mono runtime or one of the native libraries used by your application. ================================================================= Stacktrace at (wrapper managed-to-native) System.Diagnostics.Process.CreateProcess_internal (System.Diagnostics.ProcessStartInfo,intptr,intptr,intptr,System.Diagnostics.Process/ProcInfo&) <0x00004> at (wrapper managed-to-native) System.Diagnostics.Process.CreateProcess_internal (System.Diagnostics.ProcessStartInfo,intptr,intptr,intptr,System.Diagnostics.Process/ProcInfo&) <0xffffffff> at System.Diagnostics.Process.Start_noshell (System.Diagnostics.ProcessStartInfo,System.Diagnostics.Process) <0x00547> at System.Diagnostics.Process.Start_common (System.Diagnostics.ProcessStartInfo,System.Diagnostics.Process) <0x0007c> at System.Diagnostics.Process.Start (System.Diagnostics.ProcessStartInfo) <0x00032> at IronPython.Modules.PythonNT.OpenPipedCommand (IronPython.Runtime.Calls.ICallerContext,string,string,int) <0x000ae> at IronPython.Modules.PythonNT.OpenPipedCommand (IronPython.Runtime.Calls.ICallerContext,string,string) <0x00015> at (wrapper dynamic-method) System.Object.OpenPipedCommand##49 (IronPython.Runtime.Calls.ICallerContext,object,object) <0xffffffff> at (wrapper delegate-invoke) System.MulticastDelegate.invoke_object_ICallerContext_object_object (IronPython.Runtime.Calls.ICallerContext,object,object) <0xffffffff> at IronPython.Runtime.Calls.FastCallableWithContextAny.Call (IronPython.Runtime.Calls.ICallerContext,object,object) <0x00023> at IronPython.Runtime.Calls.BuiltinFunction.Call (IronPython.Runtime.Calls.ICallerContext,object,object) <0x00023> at IronPython.Runtime.Operations.Ops.CallWithContext (IronPython.Runtime.Calls.ICallerContext,object,object,object) <0x00042> at (wrapper dynamic-method) System.Object.<stdin>##47 (IronPython.Runtime.ModuleScope) <0xffffffff> at (wrapper delegate-invoke) System.MulticastDelegate.invoke_object_ModuleScope (IronPython.Runtime.ModuleScope) <0xffffffff> at IronPython.Hosting.CompiledCode.Run (IronPython.Runtime.ModuleScope) <0x00048> at IronPython.Hosting.PythonEngine.ExecuteToConsole (string,IronPython.Hosting.EngineModule,System.Collections.Generic.IDictionary`2) <0x00180> at IronPython.Hosting.PythonEngine.ExecuteToConsole (string) <0x00015> at IronPythonConsole.PythonCommandLine.RunString (IronPython.Hosting.PythonEngine,string) <0x000bc> at IronPythonConsole.PythonCommandLine.Run (IronPython.Hosting.PythonEngine,string) <0x0002b> at IronPythonConsole.PythonCommandLine.Main (string[]) <0x002bf> at (wrapper runtime-invoke) System.Object.runtime_invoke_int_string[] (object,intptr,intptr,intptr) <0xffffffff> Native stacktrace: /usr/bin/mono(mono_handle_native_sigsegv+0xde) [0x815644e] /usr/bin/mono [0x8122c88] [0xffffe440] /usr/bin/mono(mono_unicode_to_external+0x3f) [0x811309f] /usr/bin/mono [0x8103947] /usr/bin/mono [0x80d6b57] [0xb6e5d3fa] [0xb6e5c880] [0xb6e5c275] [0xb6e5c0cb] [0xb6e5ba5f] [0xb6e5b996] [0xb6e5b90a] [0xb6e6b45c] [0xb6e6b3d4] [0xb6e5acfc] [0xb6e5ac73] [0xb6e5b6b3] [0xb6e5378a] [0xb6e53711] [0xb6e5af89] [0xb6e5adee] [0xb706d4fd] [0xb706d34c] [0xb79725a0] [0xb7971a84] /usr/bin/mono(mono_runtime_exec_main+0x9f) [0x80996ef] /usr/bin/mono(mono_runtime_run_main+0x1b9) [0x8099999] /usr/bin/mono(mono_main+0xe47) [0x805d477] /usr/bin/mono [0x805c122] /lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xdc) [0xb7d058cc] /usr/bin/mono [0x805c071] ---- Additional Comments From dick@ximian.com 2006-12-07 06:42:21 MST ---- I think this has been fixed with newer releases. Please try 1.2.2 and reopen if the problem still occurs. ---- Additional Comments From lupus@ximian.com 2006-12-07 11:22:44 MST ---- I fixed this in svn for non-windows platforms. In ProcessStartInfo only filename must be set, the arguments are optional. Someone needs to fix the windows case which has a slightly different codepath. ---- Additional Comments From joncham@gmail.com 2006-12-07 19:32:12 MST ---- Created an attachment (id=171038) Win32 patch ---- Additional Comments From joncham@gmail.com 2006-12-07 19:32:47 MST ---- Patch for Win32 codepath. ---- Additional Comments From dick@ximian.com 2006-12-08 11:25:56 MST ---- Patch applied to svn r69226. Thanks. Imported an attachment (id=171038) Unknown operating system unknown. Setting to default OS "Other".