View Issue Details

IDProjectCategoryView StatusLast Update
0008713Talermechant backendpublic2024-04-15 21:32
Reportersebasjm Assigned ToChristian Grothoff  
PriorityhighSeveritycrashReproducibilityhave not tried
Status closedResolutionfixed 
Product Versiongit (master) 
Target Version0.10Fixed in Version0.10 
Summary0008713: crash getting otp devices by id
Descriptioncurl 'http://merchant.taler.test:1180/private/otp-devices/asd' \
  -H 'Authorization: Bearer secret-token:MY2Z5XHSYR48XFHDQ7WMHP0SYBZ4RY5ECRJDYND50TJYQEGSWMXG' \

LOGS

(R3MPCZPZB44QWXCNYQQQKXMNH4) INFO Handling request (GET) for URL '/private/otp-devices/asd'
(R3MPCZPZB44QWXCNYQQQKXMNH4) ERROR Assertion failed at amount.c:219. Aborting.
Process 2114958 (taler-merchant-) of user 1000 dumped core.


DUMP


(gdb) bt
#0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=140145461982656) at ./nptl/pthread_kill.c:44
#1 __pthread_kill_internal (signo=6, threadid=140145461982656) at ./nptl/pthread_kill.c:78
#2 __GI___pthread_kill (threadid=140145461982656, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
#3 0x00007f7629a56476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#4 0x00007f7629a3c7f3 in __GI_abort () at ./stdlib/abort.c:79
#5 0x00007f7629c6dbe1 in GNUNET_abort_ () at common_logging.c:280
#6 0x00007f7629d7e2bd in TALER_amount_hton (res=0x7ffd7594b9e0, d=0x7ffd7594baf0) at amount.c:219
#7 0x00007f7629d853aa in TALER_build_pos_confirmation (pos_key=0x55e4e3c3cfb0 "S6O7O7N63R7O64K3WYKDFO46AGDB3PDT",
    pos_alg=TALER_MCA_WITH_PRICE, total=0x7ffd7594baf0, ts=...) at crypto_confirmation.c:264
#8 0x000055e4e2a7ffd3 in TMH_private_get_otp_devices_ID (rh=0x55e4e2ad0a60 <private_handlers+1760>, connection=0x55e4e3237f70,
    hc=0x55e4e337d050) at taler-merchant-httpd_private-get-otp-devices-ID.c:83
#9 0x000055e4e2a5b283 in url_handler (cls=0x0, connection=0x55e4e3237f70, url=0x55e4e3c565e4 "/private/otp-devices/asd",
    method=0x55e4e3c565e0 "GET", version=0x55e4e3c565fd "HTTP/1.0", upload_data=0x0, upload_data_size=0x7ffd7594bd20,
    con_cls=0x55e4e3237fc8) at taler-merchant-httpd.c:1489
#10 0x00007f7629d31a7c in ?? () from /lib/x86_64-linux-gnu/libmicrohttpd.so.12
#11 0x00007f7629d33b48 in ?? () from /lib/x86_64-linux-gnu/libmicrohttpd.so.12
#12 0x00007f7629d36440 in ?? () from /lib/x86_64-linux-gnu/libmicrohttpd.so.12
#13 0x00007f7629d38181 in ?? () from /lib/x86_64-linux-gnu/libmicrohttpd.so.12
#14 0x00007f7629d387c8 in MHD_run_wait () from /lib/x86_64-linux-gnu/libmicrohttpd.so.12
#15 0x00007f7629d3884b in MHD_run () from /lib/x86_64-linux-gnu/libmicrohttpd.so.12
#16 0x00007f7629dee861 in run_daemon (cls=0x0) at mhd_run.c:68
#17 0x00007f7629cc93a1 in GNUNET_SCHEDULER_do_work (sh=0x55e4e31cccc0) at scheduler.c:2137
#18 0x00007f7629cca1c3 in select_loop (sh=0x55e4e31cccc0, context=0x7ffd7594cc20) at scheduler.c:2436
#19 0x00007f7629cc469b in GNUNET_SCHEDULER_run (task=0x7f7629cbcc16 <program_main>, task_cls=0x7ffd7594cd30) at scheduler.c:738
#20 0x00007f7629cbde83 in GNUNET_PROGRAM_run2 (argc=5, argv=0x7ffd7594d1f8, binaryName=0x55e4e2aaf758 "taler-merchant-httpd",
    binaryHelp=0x55e4e2aaf730 "Taler merchant's HTTP backend interface", options=0x7ffd7594cf70, task=0x55e4e2a5d6ca <run>,
    task_cls=0x0, run_without_scheduler=0) at program.c:381
#21 0x00007f7629cbdfe6 in GNUNET_PROGRAM_run (argc=5, argv=0x7ffd7594d1f8, binaryName=0x55e4e2aaf758 "taler-merchant-httpd",
    binaryHelp=0x55e4e2aaf730 "Taler merchant's HTTP backend interface", options=0x7ffd7594cf70, task=0x55e4e2a5d6ca <run>,
    task_cls=0x0) at program.c:408
#22 0x000055e4e2a5e104 in main (argc=5, argv=0x7ffd7594d1f8) at taler-merchant-httpd.c:2386
TagsNo tags attached.

Activities

sebasjm

2024-04-08 17:27

developer   ~0022156

Looks like it happen with otp_algorithm = 2

curl 'http://merchant.taler.test:1180/private/otp-devices' -H 'Authorization: Bearer secret-token:MY2Z5XHSYR48XFHDQ7WMHP0SYBZ4RY5ECRJDYND50TJYQEGSWMXG' --data-raw '{"otp_device_id":"w4","otp_device_description":"w4","otp_algorithm":2,"otp_key":"6N37WIMOYR5LQKLYBW6PUIBP2NCJTJFH"}'

Christian Grothoff

2024-04-08 19:49

manager   ~0022159

Fixed in exchange.git, 34c68308..e2a59c12.

Happens if you did NOT pass an amount but the algorithm required one -- and then we asserted instead of just not returning the "otp_code".

Issue History

Date Modified Username Field Change
2024-04-08 17:22 sebasjm New Issue
2024-04-08 17:22 sebasjm Status new => assigned
2024-04-08 17:22 sebasjm Assigned To => Christian Grothoff
2024-04-08 17:27 sebasjm Note Added: 0022156
2024-04-08 19:49 Christian Grothoff Note Added: 0022159
2024-04-08 19:50 Christian Grothoff Status assigned => resolved
2024-04-08 19:50 Christian Grothoff Resolution open => fixed
2024-04-08 19:50 Christian Grothoff Fixed in Version => 0.10
2024-04-08 19:50 Christian Grothoff Product Version 0.10 => git (master)
2024-04-08 19:50 Christian Grothoff Target Version git (master) => 0.10
2024-04-15 21:32 Christian Grothoff Status resolved => closed