Hi All,done in this project. Does anyone know a tool that can catch C pointer and heap issues?
I have an Open Source (native C) project that has some memory issue. It is generating a SIGSEGV if a free() is called on a specific pointer. This is usually the result of the heap being corrupted. Sadly, there are about 1M calls to malloc() and free()
TIA,
Randall
Hi All,
I have an Open Source (native C) project that has some memory issue. It is = >generating a SIGSEGV if a free() is called on a specific pointer. This is u= >sually the result of the heap being corrupted. Sadly, there are about 1M ca= >lls to malloc() and free() done in this project. Does anyone know a tool th= >at can catch C pointer and heap issues?
TIA,
Randall
In article <153cd7f7-0553-4f0b...@googlegroups.com>,
rsbe...@nexbridge.com says...
Hi All,
I have an Open Source (native C) project that has some memory issue. It is = >generating a SIGSEGV if a free() is called on a specific pointer. This is u= >sually the result of the heap being corrupted. Sadly, there are about 1M ca= >lls to malloc() and free() done in this project. Does anyone know a tool th= >at can catch C pointer and heap issues?
TIA,Native inspect has an option to do malloc/free tracking and
Randall
heap checking when using ZRTCDLL as a UL.
Another option is to call heap_check_always(2);
as the first thing in main(). There might be a ENV var
to trigger that as well.
Also, You should always have the define set
add define =_ERASE_ON_FREE_,Class MAP, FILE ON
as it causes the heap manager to init memory to a known pattern
on a free() so dereferences after a free() can be easier to find.
Having =_ERASE_ON_FREE_ set exposed a number of
"reference after free" problems in early versiona ODBC/MX.
https://support.hpe.com/hpesc/public/docDisplay? docLocale=en_US&docId=c02784099
https://support.hpe.com/hpesc/public/docDisplay? docLocale=en_US&docId=c02131733
On Wednesday, December 8, 2021 at 12:05:57 p.m. UTC-5, JShepherd wrote:
In article <153cd7f7-0553-4f0b...@googlegroups.com>,
rsbe...@nexbridge.com says...
Hi All,
I have an Open Source (native C) project that has some memory issue. It is =
generating a SIGSEGV if a free() is called on a specific pointer. This is u=
sually the result of the heap being corrupted. Sadly, there are about 1M ca=
lls to malloc() and free() done in this project. Does anyone know a tool th=
at can catch C pointer and heap issues?
TIA,Native inspect has an option to do malloc/free tracking and
Randall
heap checking when using ZRTCDLL as a UL.
Another option is to call heap_check_always(2);
as the first thing in main(). There might be a ENV var
to trigger that as well.
Also, You should always have the define set
add define =_ERASE_ON_FREE_,Class MAP, FILE ON
as it causes the heap manager to init memory to a known pattern
on a free() so dereferences after a free() can be easier to find.
Having =_ERASE_ON_FREE_ set exposed a number of
"reference after free" problems in early versiona ODBC/MX.
https://support.hpe.com/hpesc/public/docDisplay? docLocale=en_US&docId=c02784099
https://support.hpe.com/hpesc/public/docDisplay? docLocale=en_US&docId=c02131733Thanks. Sadly, nothing was found out of this. All I get is a SIGSEGV during the atexit() processing. It's frustrating.
Hi Randall.
Take a look at:
http://www.hexco.de/rmdebug/
It might help.
gc
On Wednesday, December 8, 2021 at 2:13:02 PM UTC-6, Randall wrote:
On Wednesday, December 8, 2021 at 12:05:57 p.m. UTC-5, JShepherd wrote:
In article <153cd7f7-0553-4f0b...@googlegroups.com>, rsbe...@nexbridge.com says...
Hi All,
I have an Open Source (native C) project that has some memory issue. It is =
generating a SIGSEGV if a free() is called on a specific pointer. This is u=
sually the result of the heap being corrupted. Sadly, there are about 1M ca=
lls to malloc() and free() done in this project. Does anyone know a tool th=
at can catch C pointer and heap issues?
TIA,Native inspect has an option to do malloc/free tracking and
Randall
heap checking when using ZRTCDLL as a UL.
Another option is to call heap_check_always(2);
as the first thing in main(). There might be a ENV var
to trigger that as well.
Also, You should always have the define set
add define =_ERASE_ON_FREE_,Class MAP, FILE ON
as it causes the heap manager to init memory to a known pattern
on a free() so dereferences after a free() can be easier to find.
Having =_ERASE_ON_FREE_ set exposed a number of
"reference after free" problems in early versiona ODBC/MX.
https://support.hpe.com/hpesc/public/docDisplay? docLocale=en_US&docId=c02784099
https://support.hpe.com/hpesc/public/docDisplay? docLocale=en_US&docId=c02131733Thanks. Sadly, nothing was found out of this. All I get is a SIGSEGV during the atexit() processing. It's frustrating.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 295 |
Nodes: | 16 (3 / 13) |
Uptime: | 09:24:25 |
Calls: | 6,644 |
Calls today: | 4 |
Files: | 12,190 |
Messages: | 5,326,327 |