Bug 107805 - (AGP Radeon 9200) - x86 Attempt to free NULL pointer
Summary: (AGP Radeon 9200) - x86 Attempt to free NULL pointer
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: 1
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Dave Jones
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-10-23 07:12 UTC by Warren Togami
Modified: 2015-01-04 22:03 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-09-29 19:33:56 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
XF86Config (3.08 KB, text/plain)
2003-10-23 07:18 UTC, Warren Togami
no flags Details
XFree86.0.log (43.48 KB, text/plain)
2003-10-23 07:18 UTC, Warren Togami
no flags Details
dmesg.txt (10.52 KB, text/plain)
2003-10-23 07:20 UTC, Warren Togami
no flags Details
lspci.txt (11.84 KB, text/plain)
2003-10-23 07:22 UTC, Warren Togami
no flags Details
linux-2.4.23-pre8.warren.agpgart.diff (54.85 KB, patch)
2003-10-29 09:06 UTC, Warren Togami
no flags Details | Diff
glxinfo.txt (2.96 KB, text/plain)
2003-10-29 09:07 UTC, Warren Togami
no flags Details
dmesg.txt with working agpgart (10.44 KB, text/plain)
2003-10-29 09:07 UTC, Warren Togami
no flags Details
XFree86.0.log with working agpgart (47.86 KB, text/plain)
2003-10-29 09:09 UTC, Warren Togami
no flags Details

Description Warren Togami 2003-10-23 07:12:36 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.1) Gecko/20031009

Description of problem:
Whenever I restart X with either CTRL-ALT-Backspace or kill PID, the following
shows up in dmesg:

[drm:radeon_ioremapfree:mappings] *ERROR* Attempt to free NULL pointer
[drm:radeon_ioremapfree:mappings] *ERROR* Excess frees: 2 frees, 1 allocs

Hardware:
Athlon64 3200+
MSI Neo motherboard
Built By ATI Radeon 9200 128MB

Version-Release number of selected component (if applicable):
kernel-2.4.22-1.2097.nptl
XFree86-4.3.0-40

How reproducible:
Always

Comment 1 Warren Togami 2003-10-23 07:18:03 UTC
Created attachment 95424 [details]
XF86Config

Comment 2 Warren Togami 2003-10-23 07:18:37 UTC
Created attachment 95425 [details]
XFree86.0.log

Comment 3 Warren Togami 2003-10-23 07:20:49 UTC
Created attachment 95426 [details]
dmesg.txt

Comment 4 Warren Togami 2003-10-23 07:22:04 UTC
Created attachment 95427 [details]
lspci.txt

Comment 5 Warren Togami 2003-10-26 22:32:35 UTC
Before it loads the radeon driver, this is within the dmesg output:
Linux agpgart interface v0.99 (c) Jeff Hartmann
agpgart: Maximum main memory to use for agp memory: 941M
agpgart: Unsupported Via chipset (device id: 3188), you might want to try
agp_try_unsupported=1.
agpgart: no supported devices found.

When I tried agp_try_unsupported=1...

Linux agpgart interface v0.99 (c) Jeff Hartmann
agpgart: Maximum main memory to use for agp memory: 941M
agpgart: Trying generic Via routines for device id: 3188
agpgart: unable to determine aperture size.

This agpgart problem is unrelated I am guessing.

Comment 6 Mike A. Harris 2003-10-27 06:56:10 UTC
Just to be certain, I have to ask...  This is with Fedora Core x86 32bit OS
install and 32bit kernel right?

Comment 7 Mike A. Harris 2003-10-27 07:00:18 UTC
(II) RADEON(0): [pci] 8192 kB allocated with handle 0xf8a3b000
(II) RADEON(0): [pci] ring handle = 0xf8a3b000
(II) RADEON(0): [pci] Ring mapped at 0xb7131000
(II) RADEON(0): [pci] Ring contents 0x00000000
(II) RADEON(0): [pci] ring read ptr handle = 0xf8b3c000
(II) RADEON(0): [pci] Ring read ptr mapped at 0xb7130000
(II) RADEON(0): [pci] Ring read ptr contents 0x00000000
(II) RADEON(0): [pci] vertex/indirect buffers handle = 0xf8b3d000
(II) RADEON(0): [pci] Vertex/indirect buffers mapped at 0xb6f30000
(II) RADEON(0): [pci] Vertex/indirect buffers contents 0x00000000

Seems to indicate PCIgart is being used due to agp not being available.
Odd that agp messages appear below that though.  Could be a side effect
of PCI Radeon not being officially supported (which is the same thing
as AGP Radeon operating in PCI mode).  It'd be nice to have both work
though.

Dave - is this AMD64 AGP chipset supported in 32bit OS kernel?  

Comment 8 Mike A. Harris 2003-10-27 07:01:57 UTC
agpgart: Maximum main memory to use for agp memory: 941M
agpgart: Unsupported Via chipset (device id: 3188), you might want to try
agp_try_unsupported=1.
agpgart: no supported devices found.


Appears it isn't supported.  Try using agp_try_unsupported=1 as suggested
above.


[drm] Initialized radeon 1.7.0 20020828 on minor 0
[drm] Loading R200 Microcode
[drm:radeon_ioremapfree:mappings] *ERROR* Attempt to free NULL pointer
[drm:radeon_ioremapfree:mappings] *ERROR* Excess frees: 2 frees, 1 allocs
[drm] Loading R200 Microcode
[drm:radeon_ioremapfree:mappings] *ERROR* Excess frees: 3 frees, 2 allocs
[drm:radeon_ioremapfree:mappings] *ERROR* Attempt to free NULL pointer
[drm:radeon_ioremapfree:mappings] *ERROR* Excess frees: 4 frees, 2 allocs

Looks like there are DRM bugs also when it falls back to PCIgart mode.

Comment 9 Warren Togami 2003-10-27 14:03:06 UTC
Yes, 32bit kernel and 32bit OS with Fedora Core.  Bug 108041 currently prevents
me from using this motherboard in RHEL 3 AS for AMD64, although chip knew the
workaround.

Comment 10 Warren Togami 2003-10-27 16:54:36 UTC
> Try using agp_try_unsupported=1 as suggested above.

I did, see Comment #5.


Comment 11 Dave Jones 2003-10-27 17:27:52 UTC
The problem here is that try_unsupported tries the generic VIA routines, which
on this hardware is wrong, it needs to try generic AMD routines so that it can
use the agpgart in the on-CPU northbridge.


Comment 12 Warren Togami 2003-10-28 08:14:15 UTC
Thank you Dave.  Can you suggest a quick & dirty hack to force generic AMD
routines for strictly testing purposes?  I will attempt the patching and
building if you can help guide me to the right source locations.


Comment 13 Dave Jones 2003-10-28 09:45:23 UTC
In drivers/char/agp/agpgart_be.c there's an enormous struct at line 5147 or so.
Page down to the #ifdef CONFIG_AGP_AMD_8151, and this is where you need to add
support for other vendors.
A simpler way would be to just copy the drivers/char/agp from the latest 2.4.23pre
which should have this and other GART updates, and shouldn't cause much disruption
(you may have to hand patch include/linux/pci_ids.h and copy include/linux/agp* too.

Comment 14 Warren Togami 2003-10-29 09:03:31 UTC
I took your latter advice and merged in the agpgart stuff from 2.4.23-pre8.  I
tried to look at everything manually to avoid possibly backing out anything that
was included in rawhide but not pre8, but I think I couldn't find anything. 
agpgart now seems to work:

agpgart: Maximum main memory to use for agp memory: 941M
agpgart: Detected GART in AMD K8 Northbridge
agpgart: AGP aperture is 128M @ 0xd0000000
[drm] AGP 0.99 Aperture @ 0xd0000000 128MB
[drm] Initialized radeon 1.7.0 20020828 on minor 0
[drm] Loading R200 Microcode

However restarting X still results in these errors:

[drm:radeon_ioremapfree:mappings] *ERROR* Attempt to free NULL pointer
[drm:radeon_ioremapfree:mappings] *ERROR* Excess frees: 2 frees, 1 allocs
[drm] Loading R200 Microcode

Both without and with working agpgart, glxgears shows numbers like this.  Isn't
this abnormally low?

1931 frames in 5.0 seconds = 386.200 FPS
2219 frames in 5.0 seconds = 443.800 FPS
2217 frames in 5.0 seconds = 443.400 FPS

I am attaching my kernel patch and more information next.

Comment 15 Warren Togami 2003-10-29 09:06:15 UTC
Created attachment 95568 [details]
linux-2.4.23-pre8.warren.agpgart.diff

Apply last to kernel-2.4.22-1.2110.nptl for working agpgart.  In
SOURCES/*.config make sure you s/CONFIG_AGP_AMD_8151/CONFIG_AGP_AMD_K8/ since
the option was renamed.

Comment 16 Warren Togami 2003-10-29 09:07:16 UTC
Created attachment 95569 [details]
glxinfo.txt

Comment 17 Warren Togami 2003-10-29 09:07:57 UTC
Created attachment 95570 [details]
dmesg.txt with working agpgart

Comment 18 Warren Togami 2003-10-29 09:09:08 UTC
Created attachment 95571 [details]
XFree86.0.log with working agpgart

Comment 19 Warren Togami 2003-10-30 06:01:33 UTC
mharris wrote:
> (II) RADEON(0): [pci] 8192 kB allocated with handle 0xf8a70000
> (II) RADEON(0): [pci] ring handle = 0xf8a70000
> (II) RADEON(0): [pci] Ring mapped at 0xb722c000
> You're not using agpgart
> You're using pcigart
> Which means....  my pcigart patch works!
> w00t!
> XFree86.0.log with working agpgart
> not working agpgart you mean.  ;o)
> Your log tells me two things:
> 1) pcigart works!
> 2) pcigart is automatically used now when agp fails
> 3) kernel pcigart and/or DRM has a bug (the DRM errors in your kernel log)
> 4) I don't know how to count
> ;oP
>
> looks like....  agpgart is loading, then X isn't using it.

Same problem with vanilla 2.4.23-pre8 where agpgart loads, but X doesn't use it.
 Dave any other suggestions for me to try?

Comment 20 Mike A. Harris 2003-10-30 07:24:53 UTC
Just a note of clarification:

"> 1) pcigart works!"

can be translated to mean "wow, pcigart is being loaded and X is trying to use
it automatically now".  I clarify that to differentiate the word "works" which
implies that it actually works, when that's not what I meant.  ;o)

IOW, pcigart is known to not work properly on all hardware, but it is nice
to see the driver try to use it now at least, which is the intention of a
patch I'm applying that hasn't been too heavily tested.  Nice to see it
confirmed at least, even though it doesn't seem to work.  ;o)

Comment 21 Warren Togami 2003-11-29 11:29:35 UTC
kernel-2.4.22-1.2122.nptl on pre-alpha FC1 for AMD64 no longer
exhibits the "Attempt to free NULL pointer" problem, however according
to mharris, pcigart is still not working properly.  Bug #111191 is a
separate issue within XFree86 which exposed this problem.

Hopefully will be able to test this newer kernel with x86 FC1 soon.

Comment 22 Mike A. Harris 2003-11-29 11:34:49 UTC
blah, we just had a mid air collision and I lost everything.

Bugzilla, you suck!

(After trying to submit the above, bugzilla died telling me it
had an internal error, and stating there was a problem with my
browser.  Nice one.)

"Bugzilla has suffered an internal error. Please save this page and
send it to dkl with details of what you were doing at the
time this message appeared.
URL: https://bugzilla.redhat.com/bugzilla/process_bug.cgi
knob was not defined; this may indicate a bug in your browser."

;o)

Comment 23 Mike A. Harris 2003-11-29 11:37:26 UTC
Actually, pcigart looks like it is working fine, on AMD64 at least,
but please test with latest x86 kernel from davej.  ;o)

The problem is that you're using AGP Radeon and PCI mode is getting
activated due to driver bug we discussed.  PCI mode should, and does
work for you though on AMD64, so that's not a bug in pcigart on
AMD64 at least.  The x86 bug needs to be confirmed yet.  And the
AGP/PCI detection thing I'll handle in the other bug report, both
are isolated issues..  Just mentioning it all here for davej for
completeness.

Comment 24 Warren Togami 2003-11-29 12:04:48 UTC
For absolute completeness, Warren should remember to reinstall FC1 x86
and properly test the same thing with the x86 kernel.

Comment 25 Warren Togami 2003-12-25 12:53:04 UTC
Finally tested with FC1 x86 and kernel-2.4.22-1.2135.nptl.  I am still
seeing many Attempt to free null pointer errors like mentioned above,
but now the counts are 20+ most of the time.

Note that this only happens when X exits.

Comment 26 Warren Togami 2003-12-25 12:53:50 UTC
Clarification: x86 still exhibits this problem, but it seems that
x86_64 never did have this problem.

Comment 27 David Lawrence 2004-09-29 19:33:56 UTC
Thanks for the bug report. However, Red Hat no longer maintains this version of
the product. Please upgrade to the latest version and open a new bug if the problem
persists.

The Fedora Legacy project (http://fedoralegacy.org/) maintains some older releases, 
and if you believe this bug is interesting to them, please report the problem in
the bug tracker at: http://bugzilla.fedora.us/



Note You need to log in before you can comment on or make changes to this bug.