Bug 80201 - general protection fault: 0000 [#1] SMP (while using HTB)
Summary: general protection fault: 0000 [#1] SMP (while using HTB)
Status: NEW
Alias: None
Product: Networking
Classification: Unclassified
Component: Other (show other bugs)
Hardware: x86-64 Linux
: P1 normal
Assignee: Stephen Hemminger
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-14 11:12 UTC by Cenek Zach
Modified: 2016-02-15 20:20 UTC (History)
4 users (show)

See Also:
Kernel Version: Linux 3.10.41-1.el6.elrepo.x86_64, Linux 3.14.13 vanilla
Subsystem:
Regression: No
Bisected commit-id:


Attachments
Kernel GPF stack trace (5.46 KB, text/plain)
2014-07-14 11:12 UTC, Cenek Zach
Details
Kernel GPF stack trace 2 (9.43 KB, text/plain)
2014-07-23 11:34 UTC, Cenek Zach
Details
crash info 2014/08/25 (44.47 KB, text/x-log)
2014-08-25 16:29 UTC, Cenek Zach
Details
crash in HTB module #1 (3.93 KB, text/plain)
2014-08-29 11:32 UTC, Cenek Zach
Details
crash in SFQ module #1 (4.16 KB, text/plain)
2014-08-29 11:33 UTC, Cenek Zach
Details
crash in SFQ module #2 (5.42 KB, text/plain)
2014-08-29 11:33 UTC, Cenek Zach
Details

Description Cenek Zach 2014-07-14 11:12:38 UTC
Created attachment 142971 [details]
Kernel GPF stack trace

Encountered GPF under normal circumstances - no heavy load (CPU, IO, net). 

HTB configuration is very simple: 1 HTB class with SFQ qdisc and filter on source port 80:

tc qdisc add dev eth0 root handle 1: htb default 30
tc class add dev eth0 parent 1: classid 1:1 htb rate $LIMIT burst 1500k cburst 1500k
tc qdisc add dev eth0 parent 1:1 handle 10: sfq perturb 10
tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip sport 80 0xffff flowid 1:1

Relevant part of vmcore-dmesg.txt attached.
Comment 1 Cenek Zach 2014-07-23 11:34:52 UTC
Created attachment 144021 [details]
Kernel GPF stack trace 2
Comment 2 Cenek Zach 2014-07-23 11:36:35 UTC
Another similar occurence; same hardware and configuration. 

This time NULL pointer dereference was detected:

...
BUG: unable to handle kernel NULL pointer dereference at 0000000000000002
...

See Kernel GPF stack trace 2.
Comment 3 Eric Dumazet 2014-07-23 18:17:44 UTC
This kind of setup is not supported.

HTB leaves must have work conserving qdisc.
Comment 4 Cenek Zach 2014-07-24 06:52:00 UTC
Sorry, I do not understand.

We have SFQ qdisc under the HTB leave; SFQ is work conserving.
Comment 5 Alan 2014-07-29 15:43:53 UTC
it should still not oops either.
Comment 6 Eric Dumazet 2014-08-05 11:53:53 UTC
Hmm... the bug seems to be triggered in SFQ, as 'perturb 10' uses a timer.

When sfq_rehash() is called, root qdisc is properly held, but sfq_reset() might be called without qdisc being held, via qdisc_destroy()


Can you check that not using 'perturb 10' is helping ?
Comment 7 Cenek Zach 2014-08-06 08:24:00 UTC
As we encountered this on our production server, we have moved to latest (at the time) longterm - vanilla 3.14.13. 

We have it compiled with debug symbols, so I should be able to provide more info if the problem occurs again (I'm not sure how likely it is as the versions are quite apart).
Comment 8 Eric Dumazet 2014-08-06 10:07:58 UTC
Note that 3.14 will crash the same way, if you use 'pertub XX' in your sfq qdisc
Comment 9 Cenek Zach 2014-08-06 10:32:47 UTC
Ok, we will be able to test it then. When the crash occurs next time, I will remove the perturb 10 option.
Comment 10 Cenek Zach 2014-08-25 16:24:04 UTC
We have now 4 servers under load and have observed 3 crashes in 2 days (with the 'perturb 10' option). 

I have setup the SFQ without the 'perturb' option on all servers around 15:30, and observed 1 crash already. I placed the end of the log and back-trace from the vmcore to the attachments.

Incidently, does the omitting of the 'perturb' option disables the rehashing, or is a default value used? 'tc qdisc show' does not show the option any more:

# tc qdisc show
qdisc htb 1: dev em1 root refcnt 47 r2q 5000 default 30 direct_packets_stat 9545
qdisc sfq 10: dev em1 parent 1:1 limit 127p quantum 1514b
Comment 11 Cenek Zach 2014-08-25 16:29:03 UTC
Created attachment 148041 [details]
crash info 2014/08/25
Comment 12 Cenek Zach 2014-08-25 16:39:15 UTC
I might have a clue. We are changing the limits imposed by HTB each minute using following command:

$TC class change dev "$BL_DEVICE" parent 1: classid 1:1 htb rate "$LIMIT" burst "$BL_BURST" cburst "$BL_CBURST" quantum 60000

And this command was definitely running in 3/4 cases at the time of crash (found him in 'crash> bt -a')
Comment 13 Cong Wang 2014-08-28 17:25:37 UTC
Without 'perturb', the rehash timer will be disabled, which means rehashing is disabled too.

Can you try to find where exactly the kernel crashes? I mean try to map the faulting address to the source code. It should give us some clue on which pointer was NULL'ed.
Comment 14 Cenek Zach 2014-08-29 11:32:59 UTC
Created attachment 148661 [details]
crash in HTB module #1
Comment 15 Cenek Zach 2014-08-29 11:33:13 UTC
Created attachment 148671 [details]
crash in SFQ module #1
Comment 16 Cenek Zach 2014-08-29 11:33:28 UTC
Created attachment 148681 [details]
crash in SFQ module #2
Comment 17 Cenek Zach 2014-08-29 11:42:45 UTC
We have experienced 7 crashes, 3 with and 4 without the perturb option. 

I found 3 places where the crashes occurred, and uploaded a txt file with details for each case. I will call them, according to the files: HTB#1, SFQ#1 and SFQ#2

Crash cases:

With the 'perturb 10' option:

HTB#1: 1x
SFQ#1: 2x

Withou the 'perturb 10' option:

HTB#1: 1x
SFQ#1: 1x
SFQ#2: 2x

However, the crashes without the option were all on single server (out of four, all running the same kernel and configuration). It might be coincidence, but it might indicate a corruption somewhere...

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