I was trying to have a look at 
https://github.com/sagemath/sage/issues/38630 using %crun, but I get the 
error below.  Anybody knows what's going on?  I found 
https://stackoverflow.com/questions/32508296/gperftools-error-substr-outside-of-string-at-usr-local-bin-pprof-line-3618,
 
but cannot decipher the answer.

Martin

sage: %crun p=random_prime(2**500)
Using local file 
/home/martin/sage/local/var/lib/sage/venv-python3.10/bin/python3.
Using local file /home/martin/tmp/tmp8s303_77/tmp_lq02l0j6.perf.
substr outside of string at /usr/bin/google-pprof line 3695.
Use of uninitialized value in string eq at /usr/bin/google-pprof line 3695.
substr outside of string at /usr/bin/google-pprof line 3697.
Use of uninitialized value in string eq at /usr/bin/google-pprof line 3697.
/home/martin/tmp/tmp8s303_77/tmp_lq02l0j6.perf: header size >= 2**16
---------------------------------------------------------------------------
CalledProcessError                        Traceback (most recent call last)
Cell In[2], line 1
----> 1 get_ipython().run_line_magic('crun', 'p=random_prime(2**500)')

File 
~/sage/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/IPython/core/interactiveshell.py:2456,
 
in InteractiveShell.run_line_magic(self, magic_name, line, _stack_depth)
   2454     kwargs['local_ns'] = self.get_local_scope(stack_depth)
   2455 with self.builtin_trap:
-> 2456     result = fn(*args, **kwargs)
   2458 # The code below prevents the output from being displayed
   2459 # when using magics with decorator @output_can_be_silenced
   2460 # when the last Python token in the expression is a ';'.
   2461 if getattr(fn, magic.MAGIC_OUTPUT_CAN_BE_SILENCED, False):

File ~/sage/src/sage/repl/ipython_extension.py:97, in SageMagics.crun(self, 
s)
     79 r"""
     80 Profile C function calls
     81 
   (...)
     94     sage: shell.quit()
     95 """
     96 import sage.misc.gperftools
---> 97 sage.misc.gperftools.crun(s, evaluator=self.shell.ex)

File ~/sage/src/sage/misc/gperftools.py:375, in crun(s, evaluator)
    373 finally:
    374     prof.stop()
--> 375 prof.top()

File ~/sage/src/sage/misc/gperftools.py:298, in Profiler.top(self, 
cumulative)
    296     args += ['--cum']
    297 args += ['--text', self._executable(), self.filename()]
--> 298 self._call_pprof(*args)

File ~/sage/src/sage/misc/gperftools.py:272, in Profiler._call_pprof(self, 
*args, **kwds)
    252 """
    253 Run the pprof binary
    254 
   (...)
    269     ...
    270 """
    271 from subprocess import check_call
--> 272 check_call([self._pprof()] + list(args), **kwds)

File /usr/lib/python3.10/subprocess.py:369, in check_call(*popenargs, 
**kwargs)
    367     if cmd is None:
    368         cmd = popenargs[0]
--> 369     raise CalledProcessError(retcode, cmd)
    370 return 0

CalledProcessError: Command '['google-pprof', '--cum', '--text', 
'/home/martin/sage/local/var/lib/sage/venv-python3.10/bin/python3', 
'/home/martin/tmp/tmp8s303_77/tmp_lq02l0j6.perf']' returned non-zero exit 
status 1.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/2fd7e504-a458-414e-ac36-97a294d85060n%40googlegroups.com.

Reply via email to