All of lore.kernel.org
 help / color / mirror / Atom feed
* [Bug 1913669] [NEW] FPE in npcm7xx_adc_convert
@ 2021-01-29  2:36 Alexander Bulekov
  2021-01-29 10:30   ` [Bug 1913669] " Philippe Mathieu-Daudé
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Alexander Bulekov @ 2021-01-29  2:36 UTC (permalink / raw)
  To: qemu-devel

Public bug reported:

Reproducer:
cat << EOF | ./qemu-system-aarch64 -M npcm750-evb \
-accel qtest -qtest stdio
write 0xf000c000 0x4 0x02400200
clock_step
EOF

Trace:
../hw/adc/npcm7xx_adc.c:60:51: runtime error: division by zero
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../hw/adc/npcm7xx_adc.c:60:51 in
AddressSanitizer:DEADLYSIGNAL
=================================================================
==717962==ERROR: AddressSanitizer: FPE on unknown address 0x55901aa6e67a (pc 0x55901aa6e67a bp 0x7fff0ac087e0 sp 0x7fff0ac087a0 T0)
#0 0x55901aa6e67a in npcm7xx_adc_convert /hw/adc/npcm7xx_adc.c:60:51
#1 0x55901aa6e67a in npcm7xx_adc_convert_done /hw/adc/npcm7xx_adc.c:106:15
#2 0x55901ceb847e in timerlist_run_timers /util/qemu-timer.c:574:9
#3 0x55901c05d804 in qtest_clock_warp /softmmu/qtest.c:356:9
#4 0x55901c059781 in qtest_process_command /softmmu/qtest.c:752:9
#5 0x55901c051b97 in qtest_process_inbuf /softmmu/qtest.c:797:9
#6 0x55901c8a2286 in fd_chr_read /chardev/char-fd.c:68:9
#7 0x7fa5c43f1aae in g_main_context_dispatch (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x51aae)
#8 0x55901cefd363 in glib_pollfds_poll /util/main-loop.c:232:9
#9 0x55901cefd363 in os_host_main_loop_wait /util/main-loop.c:255:5
#10 0x55901cefd363 in main_loop_wait /util/main-loop.c:531:11
#11 0x55901bfb8599 in qemu_main_loop /softmmu/runstate.c:721:9
#12 0x55901a2451fd in main /softmmu/main.c:50:5
#13 0x7fa5c3e96cc9 in __libc_start_main csu/../csu/libc-start.c:308:16
#14 0x55901a198bc9 in _start (/home/alxndr/Development/qemu/build/qemu-system-aarch64+0x3350bc9)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: FPE /hw/adc/npcm7xx_adc.c:60:51 in npcm7xx_adc_convert

** Affects: qemu
     Importance: Undecided
         Status: New


** Tags: fuzzer

** Tags added: fuzzer

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1913669

Title:
  FPE in npcm7xx_adc_convert

Status in QEMU:
  New

Bug description:
  Reproducer:
  cat << EOF | ./qemu-system-aarch64 -M npcm750-evb \
  -accel qtest -qtest stdio
  write 0xf000c000 0x4 0x02400200
  clock_step
  EOF

  Trace:
  ../hw/adc/npcm7xx_adc.c:60:51: runtime error: division by zero
  SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../hw/adc/npcm7xx_adc.c:60:51 in
  AddressSanitizer:DEADLYSIGNAL
  =================================================================
  ==717962==ERROR: AddressSanitizer: FPE on unknown address 0x55901aa6e67a (pc 0x55901aa6e67a bp 0x7fff0ac087e0 sp 0x7fff0ac087a0 T0)
  #0 0x55901aa6e67a in npcm7xx_adc_convert /hw/adc/npcm7xx_adc.c:60:51
  #1 0x55901aa6e67a in npcm7xx_adc_convert_done /hw/adc/npcm7xx_adc.c:106:15
  #2 0x55901ceb847e in timerlist_run_timers /util/qemu-timer.c:574:9
  #3 0x55901c05d804 in qtest_clock_warp /softmmu/qtest.c:356:9
  #4 0x55901c059781 in qtest_process_command /softmmu/qtest.c:752:9
  #5 0x55901c051b97 in qtest_process_inbuf /softmmu/qtest.c:797:9
  #6 0x55901c8a2286 in fd_chr_read /chardev/char-fd.c:68:9
  #7 0x7fa5c43f1aae in g_main_context_dispatch (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x51aae)
  #8 0x55901cefd363 in glib_pollfds_poll /util/main-loop.c:232:9
  #9 0x55901cefd363 in os_host_main_loop_wait /util/main-loop.c:255:5
  #10 0x55901cefd363 in main_loop_wait /util/main-loop.c:531:11
  #11 0x55901bfb8599 in qemu_main_loop /softmmu/runstate.c:721:9
  #12 0x55901a2451fd in main /softmmu/main.c:50:5
  #13 0x7fa5c3e96cc9 in __libc_start_main csu/../csu/libc-start.c:308:16
  #14 0x55901a198bc9 in _start (/home/alxndr/Development/qemu/build/qemu-system-aarch64+0x3350bc9)

  AddressSanitizer can not provide additional info.
  SUMMARY: AddressSanitizer: FPE /hw/adc/npcm7xx_adc.c:60:51 in npcm7xx_adc_convert

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1913669/+subscriptions


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Bug 1913669] [NEW] FPE in npcm7xx_adc_convert
@ 2021-01-29 10:30   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-01-29 10:30 UTC (permalink / raw)
  To: Bug 1913669, qemu-devel
  Cc: Hao Wu, Tyrone Ting, Havard Skinnemoen, Doug Evans

Cc'ing supporters:

$ ./scripts/get_maintainer.pl -f hw/arm/npcm7xx.c
Havard Skinnemoen <hskinnemoen@google.com> (supporter:Nuvoton NPCM7xx)
Tyrone Ting <kfting@nuvoton.com> (supporter:Nuvoton NPCM7xx)

On 1/29/21 3:36 AM, Alexander Bulekov wrote:
> Public bug reported:
> 
> Reproducer:
> cat << EOF | ./qemu-system-aarch64 -M npcm750-evb \
> -accel qtest -qtest stdio
> write 0xf000c000 0x4 0x02400200
> clock_step
> EOF
> 
> Trace:
> ../hw/adc/npcm7xx_adc.c:60:51: runtime error: division by zero
> SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../hw/adc/npcm7xx_adc.c:60:51 in
> AddressSanitizer:DEADLYSIGNAL
> =================================================================
> ==717962==ERROR: AddressSanitizer: FPE on unknown address 0x55901aa6e67a (pc 0x55901aa6e67a bp 0x7fff0ac087e0 sp 0x7fff0ac087a0 T0)
> #0 0x55901aa6e67a in npcm7xx_adc_convert /hw/adc/npcm7xx_adc.c:60:51
> #1 0x55901aa6e67a in npcm7xx_adc_convert_done /hw/adc/npcm7xx_adc.c:106:15
> #2 0x55901ceb847e in timerlist_run_timers /util/qemu-timer.c:574:9
> #3 0x55901c05d804 in qtest_clock_warp /softmmu/qtest.c:356:9
> #4 0x55901c059781 in qtest_process_command /softmmu/qtest.c:752:9
> #5 0x55901c051b97 in qtest_process_inbuf /softmmu/qtest.c:797:9
> #6 0x55901c8a2286 in fd_chr_read /chardev/char-fd.c:68:9
> #7 0x7fa5c43f1aae in g_main_context_dispatch (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x51aae)
> #8 0x55901cefd363 in glib_pollfds_poll /util/main-loop.c:232:9
> #9 0x55901cefd363 in os_host_main_loop_wait /util/main-loop.c:255:5
> #10 0x55901cefd363 in main_loop_wait /util/main-loop.c:531:11
> #11 0x55901bfb8599 in qemu_main_loop /softmmu/runstate.c:721:9
> #12 0x55901a2451fd in main /softmmu/main.c:50:5
> #13 0x7fa5c3e96cc9 in __libc_start_main csu/../csu/libc-start.c:308:16
> #14 0x55901a198bc9 in _start (/home/alxndr/Development/qemu/build/qemu-system-aarch64+0x3350bc9)
> 
> AddressSanitizer can not provide additional info.
> SUMMARY: AddressSanitizer: FPE /hw/adc/npcm7xx_adc.c:60:51 in npcm7xx_adc_convert

The ADC realization in npcm7xx_realize is incomplete, vref/iref
properties are not set, thus 0.

Looking at the qtests (npcm7xx_adc-test.c) these are set via
'qom-set' QMP calls.

Assuming vref/iref are constant on a board, shouldn't we have
a npcm7xx_adc_realize() method checking these properties are
set, returning a proper error message if not?

Thanks,

Phil.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug 1913669] Re: FPE in npcm7xx_adc_convert
@ 2021-01-29 10:30   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-01-29 10:30 UTC (permalink / raw)
  To: qemu-devel

Cc'ing supporters:

$ ./scripts/get_maintainer.pl -f hw/arm/npcm7xx.c
Havard Skinnemoen <hskinnemoen@google.com> (supporter:Nuvoton NPCM7xx)
Tyrone Ting <kfting@nuvoton.com> (supporter:Nuvoton NPCM7xx)

On 1/29/21 3:36 AM, Alexander Bulekov wrote:
> Public bug reported:
> 
> Reproducer:
> cat << EOF | ./qemu-system-aarch64 -M npcm750-evb \
> -accel qtest -qtest stdio
> write 0xf000c000 0x4 0x02400200
> clock_step
> EOF
> 
> Trace:
> ../hw/adc/npcm7xx_adc.c:60:51: runtime error: division by zero
> SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../hw/adc/npcm7xx_adc.c:60:51 in
> AddressSanitizer:DEADLYSIGNAL
> =================================================================
> ==717962==ERROR: AddressSanitizer: FPE on unknown address 0x55901aa6e67a (pc 0x55901aa6e67a bp 0x7fff0ac087e0 sp 0x7fff0ac087a0 T0)
> #0 0x55901aa6e67a in npcm7xx_adc_convert /hw/adc/npcm7xx_adc.c:60:51
> #1 0x55901aa6e67a in npcm7xx_adc_convert_done /hw/adc/npcm7xx_adc.c:106:15
> #2 0x55901ceb847e in timerlist_run_timers /util/qemu-timer.c:574:9
> #3 0x55901c05d804 in qtest_clock_warp /softmmu/qtest.c:356:9
> #4 0x55901c059781 in qtest_process_command /softmmu/qtest.c:752:9
> #5 0x55901c051b97 in qtest_process_inbuf /softmmu/qtest.c:797:9
> #6 0x55901c8a2286 in fd_chr_read /chardev/char-fd.c:68:9
> #7 0x7fa5c43f1aae in g_main_context_dispatch (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x51aae)
> #8 0x55901cefd363 in glib_pollfds_poll /util/main-loop.c:232:9
> #9 0x55901cefd363 in os_host_main_loop_wait /util/main-loop.c:255:5
> #10 0x55901cefd363 in main_loop_wait /util/main-loop.c:531:11
> #11 0x55901bfb8599 in qemu_main_loop /softmmu/runstate.c:721:9
> #12 0x55901a2451fd in main /softmmu/main.c:50:5
> #13 0x7fa5c3e96cc9 in __libc_start_main csu/../csu/libc-start.c:308:16
> #14 0x55901a198bc9 in _start (/home/alxndr/Development/qemu/build/qemu-system-aarch64+0x3350bc9)
> 
> AddressSanitizer can not provide additional info.
> SUMMARY: AddressSanitizer: FPE /hw/adc/npcm7xx_adc.c:60:51 in npcm7xx_adc_convert

The ADC realization in npcm7xx_realize is incomplete, vref/iref
properties are not set, thus 0.

Looking at the qtests (npcm7xx_adc-test.c) these are set via
'qom-set' QMP calls.

Assuming vref/iref are constant on a board, shouldn't we have
a npcm7xx_adc_realize() method checking these properties are
set, returning a proper error message if not?

Thanks,

Phil.


** Tags added: arm

** Changed in: qemu
       Status: New => Confirmed

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1913669

Title:
  FPE in npcm7xx_adc_convert

Status in QEMU:
  Confirmed

Bug description:
  Reproducer:
  cat << EOF | ./qemu-system-aarch64 -M npcm750-evb \
  -accel qtest -qtest stdio
  write 0xf000c000 0x4 0x02400200
  clock_step
  EOF

  Trace:
  ../hw/adc/npcm7xx_adc.c:60:51: runtime error: division by zero
  SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../hw/adc/npcm7xx_adc.c:60:51 in
  AddressSanitizer:DEADLYSIGNAL
  =================================================================
  ==717962==ERROR: AddressSanitizer: FPE on unknown address 0x55901aa6e67a (pc 0x55901aa6e67a bp 0x7fff0ac087e0 sp 0x7fff0ac087a0 T0)
  #0 0x55901aa6e67a in npcm7xx_adc_convert /hw/adc/npcm7xx_adc.c:60:51
  #1 0x55901aa6e67a in npcm7xx_adc_convert_done /hw/adc/npcm7xx_adc.c:106:15
  #2 0x55901ceb847e in timerlist_run_timers /util/qemu-timer.c:574:9
  #3 0x55901c05d804 in qtest_clock_warp /softmmu/qtest.c:356:9
  #4 0x55901c059781 in qtest_process_command /softmmu/qtest.c:752:9
  #5 0x55901c051b97 in qtest_process_inbuf /softmmu/qtest.c:797:9
  #6 0x55901c8a2286 in fd_chr_read /chardev/char-fd.c:68:9
  #7 0x7fa5c43f1aae in g_main_context_dispatch (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x51aae)
  #8 0x55901cefd363 in glib_pollfds_poll /util/main-loop.c:232:9
  #9 0x55901cefd363 in os_host_main_loop_wait /util/main-loop.c:255:5
  #10 0x55901cefd363 in main_loop_wait /util/main-loop.c:531:11
  #11 0x55901bfb8599 in qemu_main_loop /softmmu/runstate.c:721:9
  #12 0x55901a2451fd in main /softmmu/main.c:50:5
  #13 0x7fa5c3e96cc9 in __libc_start_main csu/../csu/libc-start.c:308:16
  #14 0x55901a198bc9 in _start (/home/alxndr/Development/qemu/build/qemu-system-aarch64+0x3350bc9)

  AddressSanitizer can not provide additional info.
  SUMMARY: AddressSanitizer: FPE /hw/adc/npcm7xx_adc.c:60:51 in npcm7xx_adc_convert

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1913669/+subscriptions


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug 1913669] Re: FPE in npcm7xx_adc_convert
  2021-01-29  2:36 [Bug 1913669] [NEW] FPE in npcm7xx_adc_convert Alexander Bulekov
  2021-01-29 10:30   ` [Bug 1913669] " Philippe Mathieu-Daudé
@ 2021-08-21  4:15 ` Alexander Bulekov
  2021-08-21  6:31 ` Thomas Huth
  2 siblings, 0 replies; 5+ messages in thread
From: Alexander Bulekov @ 2021-08-21  4:15 UTC (permalink / raw)
  To: qemu-devel

I moved this report over to QEMU's new bug tracker on gitlab.com.
Please continue with the discussion here:

https://gitlab.com/qemu-project/qemu/-/issues/550

** Bug watch added: gitlab.com/qemu-project/qemu/-/issues #550
   https://gitlab.com/qemu-project/qemu/-/issues/550

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1913669

Title:
  FPE in npcm7xx_adc_convert

Status in QEMU:
  Confirmed

Bug description:
  Reproducer:
  cat << EOF | ./qemu-system-aarch64 -M npcm750-evb \
  -accel qtest -qtest stdio
  write 0xf000c000 0x4 0x02400200
  clock_step
  EOF

  Trace:
  ../hw/adc/npcm7xx_adc.c:60:51: runtime error: division by zero
  SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../hw/adc/npcm7xx_adc.c:60:51 in
  AddressSanitizer:DEADLYSIGNAL
  =================================================================
  ==717962==ERROR: AddressSanitizer: FPE on unknown address 0x55901aa6e67a (pc 0x55901aa6e67a bp 0x7fff0ac087e0 sp 0x7fff0ac087a0 T0)
  #0 0x55901aa6e67a in npcm7xx_adc_convert /hw/adc/npcm7xx_adc.c:60:51
  #1 0x55901aa6e67a in npcm7xx_adc_convert_done /hw/adc/npcm7xx_adc.c:106:15
  #2 0x55901ceb847e in timerlist_run_timers /util/qemu-timer.c:574:9
  #3 0x55901c05d804 in qtest_clock_warp /softmmu/qtest.c:356:9
  #4 0x55901c059781 in qtest_process_command /softmmu/qtest.c:752:9
  #5 0x55901c051b97 in qtest_process_inbuf /softmmu/qtest.c:797:9
  #6 0x55901c8a2286 in fd_chr_read /chardev/char-fd.c:68:9
  #7 0x7fa5c43f1aae in g_main_context_dispatch (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x51aae)
  #8 0x55901cefd363 in glib_pollfds_poll /util/main-loop.c:232:9
  #9 0x55901cefd363 in os_host_main_loop_wait /util/main-loop.c:255:5
  #10 0x55901cefd363 in main_loop_wait /util/main-loop.c:531:11
  #11 0x55901bfb8599 in qemu_main_loop /softmmu/runstate.c:721:9
  #12 0x55901a2451fd in main /softmmu/main.c:50:5
  #13 0x7fa5c3e96cc9 in __libc_start_main csu/../csu/libc-start.c:308:16
  #14 0x55901a198bc9 in _start (/home/alxndr/Development/qemu/build/qemu-system-aarch64+0x3350bc9)

  AddressSanitizer can not provide additional info.
  SUMMARY: AddressSanitizer: FPE /hw/adc/npcm7xx_adc.c:60:51 in npcm7xx_adc_convert

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1913669/+subscriptions



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug 1913669] Re: FPE in npcm7xx_adc_convert
  2021-01-29  2:36 [Bug 1913669] [NEW] FPE in npcm7xx_adc_convert Alexander Bulekov
  2021-01-29 10:30   ` [Bug 1913669] " Philippe Mathieu-Daudé
  2021-08-21  4:15 ` Alexander Bulekov
@ 2021-08-21  6:31 ` Thomas Huth
  2 siblings, 0 replies; 5+ messages in thread
From: Thomas Huth @ 2021-08-21  6:31 UTC (permalink / raw)
  To: qemu-devel

Thanks for moving it over! ... let's close this one here on Launchpad
now.


** Changed in: qemu
       Status: Confirmed => Invalid

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1913669

Title:
  FPE in npcm7xx_adc_convert

Status in QEMU:
  Invalid

Bug description:
  Reproducer:
  cat << EOF | ./qemu-system-aarch64 -M npcm750-evb \
  -accel qtest -qtest stdio
  write 0xf000c000 0x4 0x02400200
  clock_step
  EOF

  Trace:
  ../hw/adc/npcm7xx_adc.c:60:51: runtime error: division by zero
  SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../hw/adc/npcm7xx_adc.c:60:51 in
  AddressSanitizer:DEADLYSIGNAL
  =================================================================
  ==717962==ERROR: AddressSanitizer: FPE on unknown address 0x55901aa6e67a (pc 0x55901aa6e67a bp 0x7fff0ac087e0 sp 0x7fff0ac087a0 T0)
  #0 0x55901aa6e67a in npcm7xx_adc_convert /hw/adc/npcm7xx_adc.c:60:51
  #1 0x55901aa6e67a in npcm7xx_adc_convert_done /hw/adc/npcm7xx_adc.c:106:15
  #2 0x55901ceb847e in timerlist_run_timers /util/qemu-timer.c:574:9
  #3 0x55901c05d804 in qtest_clock_warp /softmmu/qtest.c:356:9
  #4 0x55901c059781 in qtest_process_command /softmmu/qtest.c:752:9
  #5 0x55901c051b97 in qtest_process_inbuf /softmmu/qtest.c:797:9
  #6 0x55901c8a2286 in fd_chr_read /chardev/char-fd.c:68:9
  #7 0x7fa5c43f1aae in g_main_context_dispatch (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x51aae)
  #8 0x55901cefd363 in glib_pollfds_poll /util/main-loop.c:232:9
  #9 0x55901cefd363 in os_host_main_loop_wait /util/main-loop.c:255:5
  #10 0x55901cefd363 in main_loop_wait /util/main-loop.c:531:11
  #11 0x55901bfb8599 in qemu_main_loop /softmmu/runstate.c:721:9
  #12 0x55901a2451fd in main /softmmu/main.c:50:5
  #13 0x7fa5c3e96cc9 in __libc_start_main csu/../csu/libc-start.c:308:16
  #14 0x55901a198bc9 in _start (/home/alxndr/Development/qemu/build/qemu-system-aarch64+0x3350bc9)

  AddressSanitizer can not provide additional info.
  SUMMARY: AddressSanitizer: FPE /hw/adc/npcm7xx_adc.c:60:51 in npcm7xx_adc_convert

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1913669/+subscriptions



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-08-21  6:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-29  2:36 [Bug 1913669] [NEW] FPE in npcm7xx_adc_convert Alexander Bulekov
2021-01-29 10:30 ` Philippe Mathieu-Daudé
2021-01-29 10:30   ` [Bug 1913669] " Philippe Mathieu-Daudé
2021-08-21  4:15 ` Alexander Bulekov
2021-08-21  6:31 ` Thomas Huth

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.