Bug 107805 - (AGP Radeon 9200) - x86 Attempt to free NULL pointer
(AGP Radeon 9200) - x86 Attempt to free NULL pointer
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: kernel (Show other bugs)
1
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Dave Jones
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-10-23 03:12 EDT by Warren Togami
Modified: 2015-01-04 17:03 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-09-29 15:33:56 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Warren Togami 2003-10-23 03:12:36 EDT
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 03:18:03 EDT
Created attachment 95424 [details]
XF86Config
Comment 2 Warren Togami 2003-10-23 03:18:37 EDT
Created attachment 95425 [details]
XFree86.0.log
Comment 3 Warren Togami 2003-10-23 03:20:49 EDT
Created attachment 95426 [details]
dmesg.txt
Comment 4 Warren Togami 2003-10-23 03:22:04 EDT
Created attachment 95427 [details]
lspci.txt
Comment 5 Warren Togami 2003-10-26 17:32:35 EST
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 01:56:10 EST
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 02:00:18 EST
(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 02:01:57 EST
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 09:03:06 EST
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 11:54:36 EST
> Try using agp_try_unsupported=1 as suggested above.

I did, see Comment #5.
Comment 11 Dave Jones 2003-10-27 12:27:52 EST
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 03:14:15 EST
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 04:45:23 EST
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 04:03:31 EST
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 04:06:15 EST
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 04:07:16 EST
Created attachment 95569 [details]
glxinfo.txt
Comment 17 Warren Togami 2003-10-29 04:07:57 EST
Created attachment 95570 [details]
dmesg.txt with working agpgart
Comment 18 Warren Togami 2003-10-29 04:09:08 EST
Created attachment 95571 [details]
XFree86.0.log with working agpgart
Comment 19 Warren Togami 2003-10-30 01:01:33 EST
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 02:24:53 EST
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 06:29:35 EST
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 06:34:49 EST
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@redhat.com 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 06:37:26 EST
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 07:04:48 EST
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 07:53:04 EST
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 07:53:50 EST
Clarification: x86 still exhibits this problem, but it seems that
x86_64 never did have this problem.
Comment 27 David Lawrence 2004-09-29 15:33:56 EDT
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.