patiencediff tries to malloc 0 bytes; tests fail on AIX
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Fix Released
|
Medium
|
Martin Pool | ||
2.0 |
Fix Released
|
Medium
|
Unassigned | ||
2.1 |
Fix Released
|
Medium
|
Unassigned |
Bug Description
When running patiencediff tests on AIX:
bzrlib.
bzrlib.
bzrlib.
bzrlib.
bzrlib.
bzrlib.
bzrlib.
bzrlib.
bzrlib.
bzrlib.
bzrlib.
bzrlib.
bzrlib.
bzrlib.
bzrlib.
bzrlib.
bzrlib.
bzrlib.
bzrlib.
bzrlib.
bzrlib.
bzrlib.
bzrlib.
bzrlib.
all these fail with MemoryError.
It turns out that the patiencediff extension occasionally tries to malloc 0 bytes. On AIX this returns NULL which is not guarded against (but is in the spec). Patiencediff code counts this as a failure to allocate memory.
I have attached a patch which stops this happening (basically just checks if we were malloc'ing zero bytes as well). With this change all tests pass successfully.
Related branches
- Andrew Bennetts: Approve
-
Diff: 178 lines (+57/-27)2 files modifiedNEWS (+3/-0)
bzrlib/_patiencediff_c.c (+54/-27)
- John A Meinel: Approve
- Diff: 0 lines
summary: |
- patiencediff tests fail on AIX + patiencediff tries to malloc 0 bytes; tests fail on AIX |
Changed in bzr: | |
importance: | Undecided → Low |
status: | New → In Progress |
tags: | added: aix pyrex sunos |
Changed in bzr: | |
importance: | Low → Medium |
assignee: | nobody → Martin Pool (mbp) |
This is ok, but I think a better patch would just recognize when we are trying to do a zero-length comparison, and stop trying at that point. Are you able to put something like that together?