Bug 385707 - memcheck-amd64-linux crashing
Summary: memcheck-amd64-linux crashing
Status: RESOLVED NOT A BUG
Alias: None
Product: valgrind
Classification: Developer tools
Component: memcheck (show other bugs)
Version: 3.12.0
Platform: Ubuntu Linux
: NOR crash
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-13 16:42 UTC by Federico Perez
Modified: 2023-02-28 10:37 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
memcheck output (233.75 KB, text/plain)
2017-10-13 16:42 UTC, Federico Perez
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Federico Perez 2017-10-13 16:42:52 UTC
Created attachment 108333 [details]
memcheck output

Found this crash when debugging project.
I think it's not a normal case.
Comment 1 Federico Perez 2017-10-13 16:46:01 UTC
I need confirmation about if this corresponds to a bug. In that case I would like to solve it. Thanks.
Comment 2 Tom Hughes 2017-10-13 16:56:03 UTC
There are invalid writes reported, so fix those and the crash will likely go away.

It's almost certainly not a bug in valgrind, it's just your program corrupting memory, and valgrind is helpfully telling you exactly where.
Comment 3 Daniel Gutson 2018-07-28 22:14:19 UTC
Have you seen this?

--11098-- VALGRIND INTERNAL ERROR: Valgrind received a signal 11 (SIGSEGV) - exiting
--11098-- si_code=128;  Faulting address: 0x0;  sp: 0x802db5dc0

valgrind: the 'impossible' happened:
   Killed by fatal signal


And the program happens to be the python interpreter.
If it is the interpreter doing invalid writes, why valgrind says internal error and that impossible happened? Shouldn't it be prepared to handle signals?
Comment 4 Philippe Waroquiers 2018-07-31 22:02:20 UTC
(In reply to Daniel Gutson from comment #3)
> Have you seen this?
> 
> --11098-- VALGRIND INTERNAL ERROR: Valgrind received a signal 11 (SIGSEGV) -
> exiting
> --11098-- si_code=128;  Faulting address: 0x0;  sp: 0x802db5dc0
> 
> valgrind: the 'impossible' happened:
>    Killed by fatal signal
> 
> 
> And the program happens to be the python interpreter.
> If it is the interpreter doing invalid writes, why valgrind says internal
> error and that impossible happened? Shouldn't it be prepared to handle
> signals?

For sure, valgrind can run an application that (properly) uses signal.
The above SIGSEGV msg means that the signal happened at a time
when valgrind was executing its own code (and not when running
the guest code).
Such SIGSEGV might be a bug in valgrind, or as indicated by Tom,
might be the result of a problem in the guest application.

Running python 'properly' under valgrind is typically implying
to compile the python interpreter with special options
(at least that was the case with python 2.7 IIUC).


You might have with recent python a way to run more cleanly
under valgrind. e.g. found the below on the web:

PYTHONMALLOC=malloc python3 foobar.py


It might be worth in any case to retry with a more recent valgrind
either 3.13 last release, or the git trunk version, just in case ...
Comment 5 Daniel Gutson 2018-07-31 22:52:58 UTC
Thanks Philippe. We will retry with the conditions you suggest and will write the results here.
Comment 6 Paul Floyd 2023-02-28 10:37:27 UTC
I don't think that this was a bug 5 years ago and still not a bug.